/* ===== BASE STYLES FROM styles-new.css ===== */

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1e293b;
    --gray: #64748b;
    --light-gray: #f1f5f9;
    --border: #e2e8f0;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--dark);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== HERO ===== */
.hero {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 48px 0;
    margin-bottom: 40px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.hero-content {
    text-align: center;
    color: white;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    backdrop-filter: blur(10px);
}

.logo-icon {
    font-size: 32px;
}

.logo-text {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.hero-title {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 16px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: 20px;
    font-weight: 400;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== STATUS CARD ===== */
.status-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px 32px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.status-card.active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.status-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.status-icon {
    font-size: 48px;
    flex-shrink: 0;
}

.status-text h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.status-text p {
    font-size: 14px;
    opacity: 0.8;
}

/* ===== SECTION CARD ===== */
.section-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 40px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.section-header {
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 0;
    color: var(--dark);
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border-radius: 50%;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}

.section-description {
    color: var(--gray);
    font-size: 16px;
    margin-left: 56px;
}

/* ===== UPLOAD AREA ===== */
.upload-area {
    border: 3px dashed var(--border);
    border-radius: var(--radius);
    padding: 48px 32px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--light-gray);
    position: relative;
    overflow: hidden;
}

.upload-area:hover {
    border-color: var(--primary);
    background: #f8faff;
    transform: translateY(-2px);
}

.upload-area.drag-over {
    border-color: var(--primary);
    background: #f8faff;
    box-shadow: inset 0 0 20px rgba(99, 102, 241, 0.1);
}

.upload-content {
    pointer-events: none;
}

.upload-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.upload-area h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
}

.upload-area p {
    color: var(--gray);
    margin-bottom: 16px;
}

.upload-hint {
    display: inline-block;
    font-size: 13px;
    color: var(--gray);
    background: white;
    padding: 6px 16px;
    border-radius: 20px;
}

.upload-preview {
    position: relative;
    display: inline-block;
    max-width: 400px;
}

.upload-preview img {
    width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.btn-remove {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.95);
    color: white;
    border: none;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

.btn-remove:hover {
    background: var(--danger);
    transform: scale(1.1);
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    margin-top: 24px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-secondary:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-icon {
    font-size: 20px;
}

/* ===== PROGRESS BAR ===== */
.progress-container {
    margin-top: 24px;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: var(--light-gray);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 10px;
    transition: width 0.4s ease;
    width: 0%;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    text-align: center;
    margin-top: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
}

/* ===== FILES INFO ===== */
.files-info {
    margin-top: 16px;
    padding: 12px 20px;
    background: var(--light-gray);
    border-radius: var(--radius);
    text-align: center;
}

.files-count {
    font-weight: 600;
    color: var(--primary);
}

/* ===== PROCESSING STATUS ===== */
.processing-status {
    margin-top: 24px;
    text-align: center;
}

/* ===== MODE SELECTOR (TOGGLE SWITCH) ===== */
.mode-selector {
    margin: 24px 0;
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.toggle-switch {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    cursor: pointer;
}

.toggle-switch input {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 60px;
    height: 30px;
    background: #cbd5e1;
    border-radius: 30px;
    transition: var(--transition);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(30px);
}

.mode-labels {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 12px;
}

.mode-label {
    font-size: 14px;
    font-weight: 500;
    color: #94a3b8;
    transition: var(--transition);
}

.mode-label.active {
    color: var(--dark);
    font-weight: 600;
}

.mode-description {
    margin-top: 12px;
    font-size: 12px;
    color: #64748b;
    text-align: center;
    line-height: 1.5;
}

.spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 5px solid var(--light-gray);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner-small {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
}

#processing-text {
    font-weight: 600;
    color: var(--primary);
}

/* ===== RESULTS ===== */
.results-section {
    background: white;
    border-radius: var(--radius-lg);
    padding: 40px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-lg);
}

.results-legend {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.legend-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 16px;
}

.legend-badge.match {
    background: #d1fae5;
    color: #059669;
}

.legend-badge.probable {
    background: #fed7aa;
    color: #d97706;
}

.legend-badge.no-match {
    background: #fee2e2;
    color: #dc2626;
}

/* ===== IMAGE GALLERY ===== */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.gallery-item {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 3px solid transparent;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.gallery-item.match {
    border-color: var(--success);
}

.gallery-item.probable {
    border-color: var(--warning);
}

.gallery-item.no-match {
    border-color: var(--danger);
}

.gallery-item-header {
    padding: 16px 20px;
    color: white;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gallery-item.match .gallery-item-header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.gallery-item.probable .gallery-item-header {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.gallery-item.no-match .gallery-item-header {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.gallery-item-badge {
    font-size: 24px;
}

.gallery-item-image {
    position: relative;
    width: 100%;
    padding-top: 75%;
    overflow: hidden;
    background: #f8fafc;
    cursor: pointer;
    transition: var(--transition);
}

.gallery-item-image:hover {
    opacity: 0.9;
}

.gallery-item-image::after {
    content: '🔍';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    opacity: 0;
    transition: var(--transition);
    pointer-events: none;
}

.gallery-item-image:hover::after {
    opacity: 0.7;
}

.gallery-item-image img,
.gallery-item-image canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-item-image canvas {
    pointer-events: none;
}

.gallery-item-info {
    padding: 20px;
}

.gallery-item-info p {
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--gray);
}

.gallery-item-info strong {
    color: var(--dark);
    font-weight: 600;
}

/* ===== FOOTER ===== */
.footer {
    text-align: center;
    padding: 32px 0;
    color: white;
    font-size: 14px;
    opacity: 0.9;
}

/* ===== LIGHTBOX ===== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

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

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    cursor: pointer;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: var(--transition);
    z-index: 10001;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

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

.lightbox-content img,
.lightbox-content canvas {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--radius);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    display: block;
}

.lightbox-info {
    margin-top: 20px;
    color: white;
    text-align: center;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.1);
    padding: 16px 32px;
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
}

.lightbox-info strong {
    color: white;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .hero-title {
        font-size: 32px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    .section-card {
        padding: 24px;
    }
    
    .section-title {
        font-size: 22px;
    }
    
    .upload-area {
        padding: 32px 20px;
    }
    
    .image-gallery {
        grid-template-columns: 1fr;
    }
    
    .results-legend {
        flex-direction: column;
        gap: 12px;
    }
    
    .lightbox-content {
        max-width: 95vw;
        max-height: 70vh;
    }
    
    .lightbox-close {
        top: 10px;
        right: 10px;
        font-size: 30px;
        width: 40px;
        height: 40px;
    }
    
    .lightbox-info {
        font-size: 14px;
        padding: 12px 20px;
    }
}

/* ===== PROFILES-SPECIFIC STYLES ===== */

/* Hero Section with Admin Button */
.hero-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
}

.hero-left {
    flex: 1;
}

.btn-admin {
    background: white;
    color: var(--primary);
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    margin-top: 0;
    width: auto;
}

.btn-admin:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: #f8f9ff;
}

/* Profiles Grid */
.profiles-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-top: 24px;
}

.profile-card {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    border: 3px solid transparent;
    position: relative;
}

.profile-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-light);
}

.profile-card.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f1ff 100%);
}

.profile-checkbox {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    z-index: 10;
}

.profile-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 16px;
    border: 4px solid var(--border);
    transition: var(--transition);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light-gray);
}

.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-card.selected .profile-photo {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.profile-info h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 4px;
}

.profile-info p {
    font-size: 14px;
    color: var(--gray);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 16px;
    margin-top: 24px;
    justify-content: center;
}

.action-buttons .btn {
    width: auto;
    margin-top: 0;
}

.btn-outline {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
    box-shadow: var(--shadow-sm);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-outline.active,
.btn-secondary.active {
    position: relative;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

.btn-outline.active::after,
.btn-secondary.active::after {
    content: '✓';
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: var(--success);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 24px 32px;
    border-bottom: 2px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--gray);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--light-gray);
    color: var(--dark);
}

.modal-body {
    padding: 32px;
}

.modal-actions {
    padding: 24px 32px;
    border-top: 2px solid var(--border);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-actions .btn {
    width: auto;
    margin-top: 0;
    padding: 12px 24px;
}

/* Form Group */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 16px;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Photo Upload Area */
.photo-upload-area {
    border: 3px dashed var(--border);
    border-radius: var(--radius);
    padding: 32px 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--light-gray);
}

.photo-upload-area:hover {
    border-color: var(--primary);
    background: #f8faff;
}

.photo-upload-area.has-photo {
    border-style: solid;
    border-color: var(--success);
    background: #f0fdf4;
}

.photo-preview {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    margin: 0 auto;
    border: 4px solid var(--primary);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light-gray);
}

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

.photo-upload-area p {
    color: var(--gray);
    font-size: 14px;
    margin-top: 8px;
}

/* Admin Login */
.admin-login {
    padding: 32px;
}

.admin-login h2 {
    text-align: center;
    margin-bottom: 24px;
    font-size: 24px;
    color: var(--dark);
}

/* Admin Panel */
.admin-panel {
    background: white;
    border-radius: var(--radius-lg);
    padding: 40px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-lg);
}

.admin-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.admin-panel-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark);
}

.admin-profile-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.admin-profile-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--light-gray);
    border-radius: var(--radius);
    transition: var(--transition);
}

.admin-profile-item:hover {
    background: #e8ecf5;
}

.admin-profile-item .profile-photo {
    width: 60px;
    height: 60px;
    margin: 0;
    flex-shrink: 0;
    border-width: 3px;
}

.admin-profile-item .profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-profile-info {
    flex: 1;
}

.admin-profile-info h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 4px;
}

.admin-profile-info p {
    font-size: 14px;
    color: var(--gray);
}
}

.admin-profile-info {
    flex: 1;
}

.admin-profile-info h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 4px;
}

.admin-profile-info p {
    font-size: 14px;
    color: var(--gray);
}

.admin-profile-actions {
    display: flex;
    gap: 8px;
}

.btn-icon-action {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: var(--transition);
    padding: 0;
}

.btn-icon-action.edit {
    background: var(--primary-light);
    color: white;
}

.btn-icon-action.edit:hover {
    background: var(--primary);
    transform: scale(1.1);
}

.btn-icon-action.delete {
    background: var(--danger);
    color: white;
}

.btn-icon-action.delete:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* Gallery Badge - Match Status */
.gallery-image {
    position: relative;
    width: 100%;
    padding-top: 75%; /* 4:3 aspect ratio */
    overflow: hidden;
    background: #f8fafc;
    cursor: pointer;
    border-radius: var(--radius) var(--radius) 0 0;
}

.gallery-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-image:hover {
    opacity: 0.95;
}

.gallery-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 10;
    box-shadow: var(--shadow-md);
}

.gallery-badge.match {
    background: var(--success);
    color: white;
}

.gallery-badge.probable {
    background: var(--warning);
    color: white;
}

.gallery-badge.no-match {
    background: var(--danger);
    color: white;
}

/* Face Tag - Person Name + Similarity */
.gallery-info {
    padding: 16px;
}

.gallery-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 12px;
    word-break: break-word;
}

.faces-found {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.face-tag {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--light-gray);
    border-radius: 8px;
    font-size: 13px;
}

.face-tag.confirmed {
    background: #d1fae5;
    border-left: 4px solid var(--success);
}

.face-tag.probable {
    background: #fed7aa;
    border-left: 4px solid var(--warning);
}

.face-tag.unknown {
    background: #f3f4f6;
    border-left: 4px solid var(--gray);
    color: var(--gray);
}

.face-name {
    font-weight: 600;
    color: var(--dark);
}

.face-tag.probable .face-name {
    color: var(--warning);
}

.face-similarity {
    font-weight: 700;
    color: var(--success);
    font-size: 12px;
}

.face-tag.probable .face-similarity {
    color: var(--warning);
}

/* Results Filters */
.results-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid var(--border);
    background: white;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    color: var(--dark);
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 32px;
    color: var(--gray);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 16px;
    color: var(--gray);
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 60px 32px;
}

.loading-state .spinner {
    width: 60px;
    height: 60px;
    border-width: 6px;
}

.loading-state p {
    margin-top: 16px;
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
}

/* Error Message */
.error-message {
    color: var(--danger);
    font-size: 14px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.error-message::before {
    content: '⚠️';
}

/* Success Message */
.success-message {
    color: var(--success);
    font-size: 14px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.success-message::before {
    content: '✓';
}

/* Utilities */
.text-center {
    text-align: center;
}

.mt-24 {
    margin-top: 24px;
}

.mb-24 {
    margin-bottom: 24px;
}

.hidden {
    display: none !important;
}

/* Responsive Breakpoints for Profiles */
@media (max-width: 1200px) {
    .profiles-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .profiles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hero-content {
        flex-direction: column;
        gap: 24px;
        text-align: center;
    }
    
    .hero-left {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .profiles-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
    
    .modal-content {
        width: 95%;
    }
    
    .modal-header,
    .modal-body,
    .modal-actions {
        padding: 20px;
    }
    
    .admin-profile-item {
        flex-wrap: wrap;
    }
    
    .results-filters {
        flex-direction: column;
    }
    
    .filter-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .profile-photo {
        width: 100px;
        height: 100px;
    }
    
    .profile-info h3 {
        font-size: 16px;
    }
    
    .admin-panel {
        padding: 24px;
    }
}

/* ===== NUEVAS MEJORAS ===== */

/* Drag & Drop */
.drag-drop-zone {
    position: relative;
}

.drag-drop-zone.drag-over {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
    transform: scale(1.02);
}

.drag-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(99, 102, 241, 0.95);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
}

.drag-overlay-content {
    text-align: center;
    color: white;
}

.drag-icon {
    font-size: 48px;
    margin-bottom: 16px;
    animation: bounce 0.6s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.upload-hint {
    margin-top: 8px;
    font-size: 13px;
    color: var(--gray);
}

/* Modo Selector Mejorado (Grid de cards) */
.mode-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.mode-card {
    position: relative;
    cursor: pointer;
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    transition: var(--transition);
    background: white;
}

.mode-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.mode-card-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mode-card .mode-icon {
    font-size: 24px;
}

.mode-card .mode-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--dark);
}

.mode-card .mode-desc {
    font-size: 11px;
    color: var(--gray);
}

.mode-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.mode-card.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
}

.mode-card.active .mode-title {
    color: var(--primary);
}

/* Filtros de Resultados */
.results-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-select {
    padding: 8px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    background: white;
    color: var(--dark);
    cursor: pointer;
    transition: var(--transition);
}

.filter-select:hover {
    border-color: var(--primary);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Admin - Configuración de Umbrales */
.admin-section {
    margin-bottom: 32px;
}

.admin-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--dark);
}

.threshold-config {
    background: var(--light-gray);
    padding: 20px;
    border-radius: var(--radius);
}

.threshold-item {
    margin-bottom: 24px;
}

.threshold-item:last-child {
    margin-bottom: 0;
}

.threshold-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark);
}

.threshold-item strong {
    color: var(--primary);
    font-size: 18px;
}

.threshold-hint {
    display: block;
    font-size: 12px;
    font-weight: normal;
    color: var(--gray);
    margin-top: 4px;
}

.threshold-item input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #ef4444 0%, #f59e0b 50%, #10b981 100%);
    outline: none;
    -webkit-appearance: none;
}

.threshold-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--primary);
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

.threshold-item input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--primary);
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

.admin-divider {
    height: 1px;
    background: var(--border);
    margin: 32px 0;
}

/* Lightbox Mejorado */
.lightbox-controls {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
    display: flex;
    gap: 16px;
    background: rgba(0, 0, 0, 0.8);
    padding: 12px 20px;
    border-radius: 24px;
    backdrop-filter: blur(10px);
}

.lightbox-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}

.lightbox-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.lightbox-info {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    max-width: 600px;
    backdrop-filter: blur(10px);
}

.lightbox-info h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
}

.lightbox-info p {
    margin: 4px 0;
    font-size: 13px;
    opacity: 0.9;
}

/* Modo Oscuro */
body.dark-mode {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #e2e8f0;
}

.dark-mode .card {
    background: #1e293b;
    border-color: #334155;
}

.dark-mode .section {
    background: #1e293b;
}

.dark-mode .section-title,
.dark-mode .profile-name,
.dark-mode h2, .dark-mode h3 {
    color: #e2e8f0;
}

.dark-mode .mode-card {
    background: #1e293b;
    border-color: #334155;
}

.dark-mode .mode-card.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
}

.dark-mode .filter-select {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

.dark-mode .threshold-config {
    background: #0f172a;
}

.dark-mode .modal-content {
    background: #1e293b;
}

.dark-mode .form-group input,
.dark-mode .form-group select {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

.dark-mode .gallery-item {
    background: #1e293b;
    border-color: #334155;
}

.dark-mode .compare-column {
    background: #0f172a;
}

.dark-mode .compare-header {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(139, 92, 246, 0.3) 100%);
}

.dark-mode .compare-stats {
    background: #1e293b;
}

.dark-mode-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: var(--shadow-xl);
    transition: var(--transition);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark-mode-btn:hover {
    transform: scale(1.1) rotate(20deg);
}

.dark-mode .dark-mode-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
}

.dark-mode .dark-mode-icon::after {
    content: '☀️';
}

/* Modo Comparación */
.gallery-item.compare-mode {
    padding: 24px;
}

.compare-column {
    background: white;
    border-radius: var(--radius);
    padding: 16px;
    overflow: hidden;
}

.compare-header {
    font-size: 18px;
    font-weight: 700;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border-radius: var(--radius);
    margin-bottom: 12px;
    text-align: center;
}

.compare-image {
    position: relative;
    cursor: pointer;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 12px;
    transition: var(--transition);
}

.compare-image:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

.compare-image img {
    width: 100%;
    height: auto;
    display: block;
}

.compare-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
    color: white;
    font-weight: 600;
    font-size: 16px;
}

.compare-image:hover .compare-overlay {
    opacity: 1;
}

.compare-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--light-gray);
    padding: 12px;
    border-radius: var(--radius);
}

.compare-stats .stat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: white;
    border-radius: 8px;
    font-weight: 500;
}

.compare-stats .stat.confirmed {
    border-left: 4px solid var(--success);
}

.compare-stats .stat.probable {
    border-left: 4px solid var(--warning);
}

.compare-stats .stat.unknown {
    border-left: 4px solid var(--danger);
}

.compare-stats .stat.time {
    border-left: 4px solid var(--primary);
}

@media (max-width: 768px) {
    .mode-grid {
        grid-template-columns: 1fr;
    }
    
    .results-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-select {
        width: 100%;
    }
    
    .gallery-item.compare-mode > div {
        grid-template-columns: 1fr !important;
    }
}
