/**
 * ID Documents Modal Styles
 * Simple, clean styling for ID document management
 */

/* Main container */
.id-documents-content {
    padding: 20px;
}

.id-documents-content h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
    font-weight: 600;
}

/* Status section */
.id-status-section {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.id-status-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.status-item {
    display: flex;
    align-items: center;
    font-size: 14px;
}

.status-label {
    font-weight: 500;
    color: #6c757d;
    margin-right: 8px;
    min-width: 120px;
}

.status-value {
    color: #212529;
}

/* Photos section */
.id-photos-section {
    margin-bottom: 20px;
}

.id-photos-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    min-height: 50px;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

/* Photo slot styles */
.id-photo-slot {
    position: relative;
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.id-photo-slot .photo-label {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    z-index: 2;
    backdrop-filter: blur(8px);
}

.id-photo-slot.empty-slot {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    border: 2px dashed #dee2e6;
    background: #fafbfc;
}

.id-photo-slot.empty-slot .photo-label {
    position: static;
    background: none;
    color: #495057;
    margin-bottom: auto;
}

.empty-slot-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.empty-slot-text {
    margin-top: 10px;
    color: #6c757d;
    font-size: 14px;
}

.id-photo-slot.has-photo {
    aspect-ratio: 3/2;
}

.id-photo-slot.has-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.id-photo-slot.has-photo:hover img {
    transform: scale(1.02);
}

.id-photo-item {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* 1:1 aspect ratio */
    border-radius: 6px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.id-photo-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.id-photo-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-delete-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.id-photo-item:hover .photo-delete-btn,
.id-photo-slot:hover .photo-delete-btn {
    opacity: 1;
}

.loading-photos,
.no-photos,
.error-message {
    text-align: center;
    color: #6c757d;
    font-size: 14px;
    padding: 20px;
}

.error-message {
    color: #dc3545;
}

/* Form styles */
.id-document-form {
    background: white;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 4px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    color: #495057;
    background-color: #fff;
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Upload area */
.photo-upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.photo-upload-area:hover {
    border-color: #80bdff;
    background: #e9ecef;
}

.photo-upload-area.drag-over {
    border-color: #0056b3;
    background: rgba(0, 123, 255, 0.1);
}

.photo-upload-area p {
    margin: 0 0 5px 0;
    font-weight: 500;
    color: #495057;
}

.photo-upload-area small {
    color: #6c757d;
}

/* Preview grid - Fixed 2 columns for front/back */
.photo-preview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
    max-width: 400px;
}

.id-photo-preview-item {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    border-radius: 4px;
    overflow: hidden;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
}

.preview-image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.id-photo-preview-item:hover .preview-overlay {
    opacity: 1;
}

.remove-preview-btn {
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Form actions */
.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.btn {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease-in-out;
}

.btn-primary {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #004085;
}

.btn-secondary {
    color: #212529;
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
    border-color: #4e555b;
}

/* Simple Lightbox styles */
.id-lightbox-simple {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 100020;
    display: none;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    display: block;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    background: none;
    border: none;
    color: white;
    font-size: 40px;
    cursor: pointer;
    z-index: 10;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.lightbox-close:hover {
    opacity: 1;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
    width: 50px;
    height: 80px;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.lightbox-nav:hover {
    background: rgba(0, 0, 0, 0.8);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-footer {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 14px;
    opacity: 0.8;
}

.id-lightbox-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-top: 1px solid #e9ecef;
    background: white;
}

.id-lightbox-info {
    font-size: 14px;
    color: #666;
}

.id-lightbox-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.id-lightbox-btn-danger {
    background: #dc3545;
    color: white;
}

.id-lightbox-btn-danger:hover {
    background: #c82333;
}

/* Alert messages */
.id-message {
    margin-bottom: 15px;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 14px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Approval Status Styles */
.photo-status {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
    backdrop-filter: blur(8px);
}

.photo-status svg {
    width: 14px;
    height: 14px;
}

.photo-status.approved {
    background: rgba(40, 199, 111, 0.9);
    color: white;
}

.photo-status.rejected {
    background: rgba(234, 84, 85, 0.9);
    color: white;
}

.photo-status.pending {
    background: rgba(255, 159, 10, 0.9);
    color: white;
}

.id-photo-item.status-approved .photo-delete-btn {
    display: none !important;
}

/* Approved Documents Notice */
.approved-notice {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Disabled form state */
.id-document-form input:disabled,
.id-document-form select:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
}

.id-document-form button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Status-based button styles */
.btn-pending {
    background-color: #ff9f0a !important;
    border-color: #ff9f0a !important;
    color: white;
}

.btn-pending:hover {
    background-color: #e6900a !important;
    border-color: #cc8000 !important;
}

.btn-approved {
    background-color: #28c76f !important;
    border-color: #28c76f !important;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-approved:hover {
    background-color: #22a55c !important;
    border-color: #1e9251 !important;
}

.btn-approved svg {
    width: 16px;
    height: 16px;
}

/* Locked field styles */
.field-locked {
    position: relative;
}

.field-locked::after {
    content: '🔒';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 0.5;
}

/* Hide reset button when pending/approved */
.status-pending .btn-secondary[onclick*="reset"],
.status-approved .btn-secondary[onclick*="reset"] {
    display: none;
}

/* Confirmation dialog */
.id-confirmation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 100030;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.id-confirmation-dialog {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 480px;
    width: 90%;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.confirmation-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
}

.confirmation-header h3 {
    margin: 0;
    font-size: 20px;
    color: #212529;
    display: flex;
    align-items: center;
    gap: 10px;
}

.confirmation-header .warning-icon {
    color: #ff9f0a;
    font-size: 24px;
}

.confirmation-body {
    padding: 24px;
}

.confirmation-body p {
    margin: 0 0 16px 0;
    line-height: 1.6;
    color: #495057;
}

.confirmation-body .warning-text {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 12px 16px;
    margin: 16px 0;
    color: #856404;
    font-size: 14px;
}

.confirmation-body .warning-text strong {
    display: block;
    margin-bottom: 4px;
}

.confirmation-footer {
    padding: 16px 24px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.confirmation-footer .btn {
    min-width: 100px;
}

.btn-confirm {
    background-color: #007bff;
    color: white;
    border: 1px solid #007bff;
}

.btn-confirm:hover {
    background-color: #0056b3;
    border-color: #004085;
}

.btn-cancel {
    background-color: #6c757d;
    color: white;
    border: 1px solid #6c757d;
}

.btn-cancel:hover {
    background-color: #545b62;
    border-color: #4e555b;
}

/* Profile modal ID button status colors */
.id-documents-btn-pending {
    background-color: #ff9f0a !important;
    border-color: #ff9f0a !important;
}

.id-documents-btn-pending:hover {
    background-color: #e6900a !important;
    border-color: #cc8000 !important;
}

.id-documents-btn-approved {
    background-color: #28c76f !important;
    border-color: #28c76f !important;
}

.id-documents-btn-approved:hover {
    background-color: #22a55c !important;
    border-color: #1e9251 !important;
}

.id-documents-btn .btn-icon {
    position: relative;
}

.id-documents-btn-approved .btn-icon::after,
.id-documents-btn-pending .btn-icon::after {
    content: '•';
    position: absolute;
    top: -2px;
    right: -2px;
    font-size: 8px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.id-documents-btn-approved .btn-icon::after {
    background: #28c76f;
    color: white;
    content: '✓';
}

.id-documents-btn-pending .btn-icon::after {
    background: #ff9f0a;
    color: white;
}

/* Loading overlay */
.id-documents-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: inherit;
}

.id-documents-loading-content {
    text-align: center;
    padding: 20px;
}

.id-documents-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.id-documents-loading-text {
    font-size: 16px;
    color: #495057;
    font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .id-photos-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .id-photo-slot.empty-slot {
        min-height: 150px;
    }
}