/* Employment Records Management System - Custom Styles */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

.navbar-brand {
    font-weight: bold;
}

.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.card-header {
    border-radius: 10px 10px 0 0 !important;
    border: none;
    font-weight: bold;
}

.upload-area {
    background-color: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    transition: all 0.3s ease;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-area:hover {
    border-color: #0d6efd;
    background-color: #e7f3ff;
}

.upload-area.dragover {
    border-color: #0d6efd;
    background-color: #e7f3ff;
}

.btn {
    border-radius: 8px;
    font-weight: 500;
}

.btn-primary {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0b5ed7 0%, #0a58ca 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3);
}

.badge {
    font-size: 0.75em;
}

.crop-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid #fff;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

/* Aadhar Card Crop Overlay (3.37:2.1 ratio approximately) */
.crop-overlay.aadhar {
    width: 300px;
    height: 187px;
}

/* PAN Card Crop Overlay (1.59:1 ratio approximately) */
.crop-overlay.pan {
    width: 300px;
    height: 189px;
}

/* License Crop Overlay (same as Aadhar) */
.crop-overlay.license {
    width: 300px;
    height: 187px;
}

/* Selfie Crop Overlay (square) */
.crop-overlay.selfie {
    width: 250px;
    height: 250px;
    border-radius: 50%;
}

/* Signature Crop Overlay (rectangular) */
.crop-overlay.signature {
    width: 300px;
    height: 100px;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    border-radius: 10px;
}

@media (max-width: 768px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    .card-body {
        padding: 1rem;
    }

    .upload-area {
        min-height: 100px;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1.1rem;
    }

    .card-body .row .col-md-3 {
        margin-bottom: 1rem;
    }

    .upload-section h6 {
        font-size: 1rem;
    }
}

/* Toast notifications - improved styling */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.bg-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
}

.toast.bg-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%) !important;
    color: #000 !important;
}

.toast.bg-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%) !important;
}

.toast .btn {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

/* Preview cards for captured documents */
.preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.preview-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 0.75rem;
    min-width: 220px;
    max-width: 100%;
}

.preview-thumb {
    width: 120px;
    height: 90px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #dee2e6;
}

.preview-placeholder {
    width: 120px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    background: #f8f9fa;
}

.preview-info {
    flex: 1;
}

.preview-title {
    margin-bottom: 0.2rem;
    font-weight: 600;
}

.preview-card {
    position: relative;
}

.preview-remove {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 2;
}

/* Camera permission prompt */
#cameraPermissionPrompt {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 10px;
}

#cameraPermissionPrompt .spinner-border {
    width: 3rem;
    height: 3rem;
    margin-top: 1rem;
}

/* Camera content area */
#cameraContent {
    position: relative;
}

#cameraContent video {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    background: #000;
}

/* Success animation */
.upload-success {
    animation: bounceIn 0.6s ease-out;
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

/* Error styling */
.upload-error {
    border-color: #dc3545 !important;
    background-color: #f8d7da !important;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-overlay .spinner-border {
    width: 4rem;
    height: 4rem;
}