:root {
    --bg-color: #0f172a;
    --panel-bg: rgba(30, 41, 59, 0.7);
    --panel-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --font-family: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    background-image: 
        radial-gradient(at 0% 0%, hsla(253,16%,7%,1) 0, transparent 50%), 
        radial-gradient(at 50% 0%, hsla(225,39%,30%,0.3) 0, transparent 50%), 
        radial-gradient(at 100% 0%, hsla(339,49%,30%,0.3) 0, transparent 50%);
}

.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--panel-border);
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
}

.logo {
    display: flex;
    align-items: center;
    padding: 0 2rem;
    margin-bottom: 3rem;
    gap: 1rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 8px;
}

.nav-links {
    list-style: none;
}

.nav-links li a {
    display: block;
    padding: 1rem 2rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.nav-links li.active a, .nav-links li a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    border-right: 3px solid var(--primary-color);
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.avatar {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Glass Panel */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.glass-panel h3 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* Layout Grid */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-gap: 2rem;
}

.history-section {
    grid-column: 1 / -1;
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--panel-border);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.upload-area:hover, .upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.05);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.text-sm {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.hidden {
    display: none !important;
}

.upload-progress {
    margin-bottom: 1.5rem;
}

.progress-bar {
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    transition: width 0.3s ease;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
    font-family: var(--font-family);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

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

.primary-btn:hover:not(:disabled) {
    background: var(--primary-hover);
}

.primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.secondary-btn {
    background: rgba(255,255,255,0.1);
    color: white;
    width: auto;
}

.secondary-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* Status Cards */
.status-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.status-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.card-icon.blue { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.card-icon.green { background: rgba(16, 185, 129, 0.2); color: #34d399; }

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

.badge.success { background: rgba(16, 185, 129, 0.2); color: #34d399; }

/* Table */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--panel-border);
}

th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.snapshot-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--panel-border);
    transition: transform 0.3s ease;
}

.snapshot-img:hover {
    transform: scale(1.5);
}

.text-center {
    text-align: center;
}

/* Tab System */
.tab-content {
    transition: opacity 0.3s ease;
    animation: tabFadeIn 0.4s ease;
}
@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}
.tab-content.hidden {
    display: none !important;
}
.nav-links li {
    cursor: pointer;
}

/* Filter checkboxes */
.filter-container {
    margin-top: 1.25rem;
    margin-bottom: 1.5rem;
    text-align: left;
    background: rgba(0, 0, 0, 0.15);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--panel-border);
}
.filter-title {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.radio-group {
    display: flex;
    gap: 1.5rem;
}
.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}
.radio-label input[type="radio"] {
    accent-color: var(--primary-color);
    width: 16px;
    height: 16px;
}

/* Modal overlay & Lightbox */
.modal {
    position: fixed;
    z-index: 9999 !important;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.modal.hidden {
    display: none !important;
}
.modal-content {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    animation: modalSlide 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalSlide {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.close-btn {
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s ease;
}
.close-btn:hover {
    color: var(--text-primary);
}

/* Lightbox specific */
.lightbox-content {
    max-width: 800px;
    padding: 1.75rem;
}
.lightbox-body {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 1.5rem;
    align-items: center;
}
#lightboxImg {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--panel-border);
    object-fit: cover;
    max-height: 400px;
    background: rgba(0,0,0,0.3);
}
.lightbox-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
    height: 100%;
}
.lightbox-details h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}
.lightbox-details p {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Forms inside modal */
.form-group {
    margin-bottom: 1.2rem;
    text-align: left;
}
.form-group label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}
.form-group input[type="text"], .form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--panel-border);
    background: rgba(0, 0, 0, 0.4);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}
.form-group input[type="text"]:focus, .form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}
.avatar-preview {
    width: 90px;
    height: 90px;
    border-radius: 12px;
    border: 1px solid var(--panel-border);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.25);
    margin-bottom: 0.5rem;
}
.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Video Library and Identities Grid layout */
.videos-grid, .identities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

/* Video card styling */
.video-card {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: left;
    transition: all 0.3s ease;
}
.video-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 25px -10px rgba(0, 0, 0, 0.6);
}
.video-card-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    word-break: break-all;
    line-height: 1.4;
}
.video-card-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}
.video-card-actions {
    display: flex;
    gap: 10px;
}

/* Identity card styling */
.identity-card {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    transition: all 0.3s ease;
}
.identity-card:hover {
    border-color: #8b5cf6;
    transform: translateY(-4px);
}
.identity-card-avatar {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    border: 1px solid var(--panel-border);
    overflow: hidden;
    object-fit: cover;
}
.identity-card-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}
.identity-card-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
}
.identity-card-type {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.identity-card-delete {
    position: absolute;
    right: 0.75rem;
    top: 0.75rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s ease;
}
.identity-card-delete:hover {
    color: var(--danger-color);
}

.danger-btn {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #f87171 !important;
    width: auto;
}
.danger-btn:hover {
    background: var(--danger-color) !important;
    color: white !important;
}

.badge.danger {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* Header Status Panel */
.header-status-panel {
    display: flex;
    gap: 1.25rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--panel-border);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    backdrop-filter: blur(8px);
}
.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.status-dot.green {
    background-color: var(--success-color);
    box-shadow: 0 0 8px var(--success-color);
    animation: statusPulse 2s infinite;
}
.status-dot.red {
    background-color: var(--danger-color);
    box-shadow: 0 0 8px var(--danger-color);
}
@keyframes statusPulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* Toast Notification Styles */
.toast-card {
    min-width: 300px;
    max-width: 400px;
    background: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    box-shadow: 0 10px 30px -5px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    pointer-events: auto;
    animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1), toastFadeOut 0.35s ease 2.7s forwards;
}
.toast-card.success {
    border-left: 4px solid var(--success-color);
}
.toast-card.error {
    border-left: 4px solid var(--danger-color);
}
.toast-card.info {
    border-left: 4px solid var(--primary-color);
}
.toast-card.warning {
    border-left: 4px solid #f59e0b;
}

@keyframes toastSlideIn {
    from { transform: translateX(50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes toastFadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); }
}

/* Layout Adjustments */
.guide-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Live Camera indicator */
.live-status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 800;
    color: #f87171;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    letter-spacing: 0.03em;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--danger-color);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--danger-color);
    display: inline-block;
    animation: pulseLive 1.5s infinite ease-in-out;
}

@keyframes pulseLive {
    0% { transform: scale(1); opacity: 1; box-shadow: 0 0 4px var(--danger-color); }
    50% { transform: scale(1.3); opacity: 0.5; box-shadow: 0 0 12px var(--danger-color); }
    100% { transform: scale(1); opacity: 1; box-shadow: 0 0 4px var(--danger-color); }
}

/* ====================================================
   PREMIUM GLASSMORPHISM LOGIN OVERLAY & DROPDOWN STYLES
   ==================================================== */

.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 50% 50%, rgba(30, 41, 59, 0.4), rgba(15, 23, 42, 0.95));
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    display: none !important;
}

.login-card {
    width: 90%;
    max-width: 440px;
    padding: 3rem 2.5rem;
    border-radius: 24px;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.4),
        inset 0 0 30px rgba(255, 255, 255, 0.02);
    text-align: center;
    backdrop-filter: blur(20px);
}

.login-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.login-logo-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
}

.login-header h2 {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(to right, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 2.25rem;
    font-weight: 400;
    letter-spacing: 0.02em;
}

.login-card input[type="text"], 
.login-card input[type="password"] {
    width: 100%;
    padding: 0.8rem 1.1rem;
    border-radius: 10px;
    border: 1px solid var(--panel-border);
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.login-card input[type="text"]:focus, 
.login-card input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    background: rgba(15, 23, 42, 0.8);
}

/* Avatar Dropdown System */
.profile-dropdown {
    transform-origin: top right;
    animation: dropdownSlide 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.profile-dropdown a:hover {
    background: rgba(255, 255, 255, 0.06);
}

#avatarBtn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

/* Animations helper */
.animate-fade-in {
    animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Input password fields styles inside standard modals */
.form-content input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--panel-border);
    background: rgba(0, 0, 0, 0.4);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form-content input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}


