/* ============================================
   PROFESSIONAL ATTENDANCE SYSTEM
   People & Partners Insurance PLC
   ============================================ */

:root {
    --teal-primary: #5AACA8;
    --teal-dark: #4a8e8a;
    --teal-darker: #3a7e7a;
    --teal-light: #6fbcb8;
    --teal-lighter: #d4f1f0;
    --teal-subtle: #e8f7f6;

    --navy: #1a3847;
    --navy-light: #2a4857;

    --white: #ffffff;
    --off-white: #fafbfc;
    --gray-50: #f8f9fa;
    --gray-100: #f1f3f5;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #868e96;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;

    --success: #0fa968;
    --warning: #f59e0b;
    --error: #dc2626;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.15);

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

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

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============================================
   MAIN LAYOUT
   ============================================ */

.main-container {
    display: grid;
    grid-template-columns: 380px 1fr;
    min-height: 100vh;
}

/* ============================================
   LEFT PANEL - BRANDING
   ============================================ */

.left-panel {
    background: linear-gradient(180deg, var(--teal-primary) 0%, var(--teal-dark) 100%);
    color: white;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    gap: 40px;
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
}

.left-panel::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.left-panel::after {
    content: '';
    position: absolute;
    bottom: -100px;
    left: -100px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite reverse;
}

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

.brand-header {
    text-align: center;
    position: relative;
    z-index: 1;
}

.logo-container {
    width: 160px;
    height: 160px;
    margin: 0 auto 20px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 15px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.logo-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.company-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: relative;
    z-index: 1;
    border-radius: 50%;
}

/* Fallback if logo doesn't load */
.company-logo:not([src]),
.company-logo[src=""],
.company-logo[src="logo.png"]:not([complete]) {
    display: none;
}

.logo-container:has(.company-logo:not([src])),
.logo-container:has(.company-logo[src=""]) {
    background: linear-gradient(135deg, var(--teal-lighter) 0%, var(--teal-light) 100%);
}

.logo-container:has(.company-logo:not([src]))::after,
.logo-container:has(.company-logo[src=""])::after {
    content: 'P&P';
    font-size: 36px;
    font-weight: 800;
    color: var(--teal-primary);
    letter-spacing: 2px;
}

.brand-title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.brand-subtitle {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 2px;
    opacity: 0.95;
    margin-bottom: 15px;
}

.brand-tagline {
    font-size: 15px;
    font-weight: 400;
    font-style: italic;
    opacity: 0.9;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    display: inline-block;
}

/* Info Cards */
.info-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.info-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.info-card:hover::before {
    left: 100%;
}

.info-card:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateX(8px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.card-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.card-content h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.card-content p {
    font-size: 13px;
    opacity: 0.9;
    font-weight: 300;
}

/* Live Clock Section */
.clock-section {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-lg);
    padding: 30px 24px;
    text-align: center;
    position: relative;
    z-index: 1;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    margin-bottom: 20px;
}

.clock-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    animation: clockGlow 4s ease-in-out infinite;
}

@keyframes clockGlow {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(10px, 10px); }
}

.current-time {
    font-size: 48px;
    font-weight: 700;
    color: white;
    line-height: 1;
    margin-bottom: 8px;
    font-family: 'Courier New', monospace;
    letter-spacing: 3px;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
    animation: timeFlicker 2s ease-in-out infinite;
}

@keyframes timeFlicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.95; }
}

.current-date {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.work-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    color: white;
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(255, 255, 255, 0);
    }
}

.work-status.working .status-dot {
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

.work-status.before-work .status-dot {
    background: #fbbf24;
    box-shadow: 0 0 8px #fbbf24;
}

.work-status.after-work .status-dot {
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444;
}

/* Workday Progress Bar */
.workday-progress {
    margin-top: 20px;
    position: relative;
    z-index: 1;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #3b82f6, #8b5cf6);
    background-size: 200% 100%;
    border-radius: 10px;
    transition: width 1s ease-out;
    position: relative;
    animation: progressGradient 3s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

@keyframes progressGradient {
    0%, 100% { background-position: 0% 0%; }
    50% { background-position: 100% 0%; }
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    filter: blur(8px);
    animation: progressGlow 2s ease-in-out infinite;
}

@keyframes progressGlow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
}

.progress-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Working Hours Card Enhancement */
.work-hours-card {
    background: rgba(255, 255, 255, 0.25) !important;
    border: 2px solid rgba(255, 255, 255, 0.4) !important;
}

.work-hours-time {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: white !important;
    letter-spacing: 1px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Stats Section */
.stats-section {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    z-index: 1;
}

.stats-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

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

.stat-value {
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #ffffff 0%, rgba(255,255,255,0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    animation: countUp 0.5s ease-out;
}

@keyframes countUp {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.stat-label {
    font-size: 12px;
    opacity: 0.9;
    font-weight: 400;
}

/* Quick Links */
.quick-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.quick-link-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius);
    color: white;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.quick-link-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.quick-link-btn.primary {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.quick-link-btn.primary:hover {
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

/* ============================================
   RIGHT PANEL - CAMERA & LOG
   ============================================ */

.right-panel {
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    overflow-y: auto;
}

/* Camera Container */
.camera-container {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    border: 2px solid var(--gray-100);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.camera-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, var(--teal-lighter), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
    animation: rotateBorder 8s linear infinite;
    pointer-events: none;
    z-index: -1;
}

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

.camera-container:hover {
    box-shadow: var(--shadow-lg), 0 0 40px rgba(90, 172, 168, 0.2);
    border-color: var(--teal-primary);
    transform: translateY(-2px);
}

.camera-container:hover::before {
    opacity: 0.3;
}

.camera-header {
    padding: 24px 30px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, transparent 0%, rgba(90, 172, 168, 0.03) 100%);
    position: relative;
    overflow: hidden;
}

.camera-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(90, 172, 168, 0.08), transparent);
    animation: headerShine 3s ease-in-out infinite;
}

@keyframes headerShine {
    0%, 100% { left: -100%; }
    50% { left: 100%; }
}

.camera-header h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--gray-900);
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, var(--gray-900) 0%, var(--teal-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--success);
}

.pulse-dot {
    width: 10px;
    height: 10px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 0 0 var(--success);
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(15, 169, 104, 0.7);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(15, 169, 104, 0);
    }
}

/* Video Wrapper */
.video-wrapper {
    position: relative;
    background: var(--gray-900);
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border: 3px solid transparent;
    background-image:
        linear-gradient(var(--gray-900), var(--gray-900)),
        linear-gradient(135deg, var(--teal-primary), var(--teal-dark), var(--teal-primary));
    background-origin: border-box;
    background-clip: padding-box, border-box;
}

.video-wrapper::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: inherit;
    padding: 3px;
    background: linear-gradient(135deg, var(--teal-primary), var(--teal-dark));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0;
    animation: borderPulse 3s ease-in-out infinite;
}

@keyframes borderPulse {
    0%, 100% { opacity: 0; }
    50% { opacity: 0.5; }
}

#cameraFeed {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#faceCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Detection Frame */
.detection-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 320px;
    height: 420px;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    animation: breathe 2s ease-in-out infinite;
}

.detection-frame.active {
    opacity: 1;
}

@keyframes breathe {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.02); }
}

.frame-corner {
    position: absolute;
    width: 50px;
    height: 50px;
    border: 3px solid var(--teal-primary);
    box-shadow: 0 0 15px var(--teal-primary);
    filter: drop-shadow(0 0 8px rgba(90, 172, 168, 0.6));
}

.frame-corner.tl {
    top: 0;
    left: 0;
    border-right: none;
    border-bottom: none;
    border-top-left-radius: 12px;
}

.frame-corner.tr {
    top: 0;
    right: 0;
    border-left: none;
    border-bottom: none;
    border-top-right-radius: 12px;
}

.frame-corner.bl {
    bottom: 0;
    left: 0;
    border-right: none;
    border-top: none;
    border-bottom-left-radius: 12px;
}

.frame-corner.br {
    bottom: 0;
    right: 0;
    border-left: none;
    border-top: none;
    border-bottom-right-radius: 12px;
}

.scan-beam {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--teal-primary), transparent);
    box-shadow: 0 0 20px var(--teal-primary);
    animation: scanning 3s ease-in-out infinite;
}

@keyframes scanning {
    0%, 100% { top: 0; opacity: 0.5; }
    50% { top: calc(100% - 3px); opacity: 1; }
}

/* Instructions Overlay */
.instructions-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    pointer-events: none;
}

.instructions-overlay svg {
    margin-bottom: 16px;
    opacity: 0.8;
}

.instructions-overlay p {
    font-size: 15px;
    font-weight: 500;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.instructions-overlay.hidden {
    display: none;
}

/* Recognition Result */
.recognition-result {
    padding: 30px;
    background: linear-gradient(135deg, var(--teal-subtle) 0%, rgba(255, 255, 255, 0.95) 100%);
    border-top: 3px solid var(--teal-primary);
    position: relative;
    overflow: hidden;
    animation: resultSlideIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.recognition-result::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
    animation: successShine 2s ease-in-out;
}

@keyframes successShine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.recognition-result.hidden {
    display: none;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--teal-lighter);
    margin-bottom: 20px;
    position: relative;
}

.result-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--teal-primary), var(--teal-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 26px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(90, 172, 168, 0.3), 0 0 0 0 rgba(90, 172, 168, 0.5);
    animation: avatarPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), avatarPulse 2s ease-in-out infinite 0.5s;
    position: relative;
}

@keyframes avatarPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes avatarPulse {
    0%, 100% {
        box-shadow: 0 4px 16px rgba(90, 172, 168, 0.3), 0 0 0 0 rgba(90, 172, 168, 0.5);
    }
    50% {
        box-shadow: 0 4px 16px rgba(90, 172, 168, 0.5), 0 0 0 15px rgba(90, 172, 168, 0);
    }
}

.result-info {
    flex: 1;
}

.result-info h3 {
    font-size: 22px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.result-info p {
    font-size: 14px;
    color: var(--gray-600);
    font-weight: 500;
}

.result-status {
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    position: relative;
    overflow: hidden;
    animation: statusBounce 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.3s;
}

@keyframes statusBounce {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.15);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.result-status::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.result-status:hover::before {
    width: 300px;
    height: 300px;
}

.result-status.on-time {
    background: linear-gradient(135deg, var(--success), #0c8754);
    color: white;
    box-shadow: 0 4px 15px rgba(15, 169, 104, 0.4);
}

.result-status.late {
    background: linear-gradient(135deg, var(--warning), #dc7609);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.result-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.detail-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    background: white;
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
    transition: all 0.3s ease;
    animation: detailFadeIn 0.5s ease backwards;
}

.detail-row:nth-child(1) { animation-delay: 0.5s; }
.detail-row:nth-child(2) { animation-delay: 0.6s; }
.detail-row:nth-child(3) { animation-delay: 0.7s; }
.detail-row:nth-child(4) { animation-delay: 0.8s; }

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

.detail-row:hover {
    background: var(--teal-subtle);
    border-color: var(--teal-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(90, 172, 168, 0.15);
}

.detail-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-label::before {
    content: '';
    width: 3px;
    height: 12px;
    background: var(--teal-primary);
    border-radius: 2px;
}

.detail-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-900);
    margin-left: 9px;
}

/* ============================================
   ATTENDANCE LOG
   ============================================ */

.attendance-log {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    border: 2px solid var(--gray-100);
    transition: all 0.3s ease;
    position: relative;
}

.attendance-log::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg,
        var(--teal-primary) 0%,
        var(--teal-light) 25%,
        var(--teal-primary) 50%,
        var(--teal-light) 75%,
        var(--teal-primary) 100%);
    background-size: 200% 100%;
    animation: gradientSlide 3s linear infinite;
}

@keyframes gradientSlide {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

.attendance-log:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--teal-lighter);
}

.log-header {
    padding: 28px 30px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, transparent 0%, rgba(90, 172, 168, 0.02) 100%);
}

.log-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 10px;
}

.log-header h3::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(180deg, var(--teal-primary), var(--teal-dark));
    border-radius: 4px;
}

.refresh-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.2s ease;
}

.refresh-btn:hover {
    background: var(--teal-primary);
    color: white;
    transform: rotate(90deg);
}

.log-entries {
    max-height: 400px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
.log-entries::-webkit-scrollbar {
    width: 8px;
}

.log-entries::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 4px;
}

.log-entries::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--teal-primary), var(--teal-dark));
    border-radius: 4px;
    transition: background 0.3s ease;
}

.log-entries::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--teal-dark), var(--teal-darker));
}

.log-entry {
    padding: 20px 30px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
    position: relative;
}

.log-entry::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(90deg, var(--teal-lighter), transparent);
    transition: width 0.3s ease;
}

.log-entry:hover::before {
    width: 100%;
}

.log-entry:hover {
    background: var(--gray-50);
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.log-entry:last-child {
    border-bottom: none;
}

.entry-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--teal-light), var(--teal-primary), var(--teal-dark));
    background-size: 200% 200%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    font-weight: 600;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(90, 172, 168, 0.3);
    position: relative;
    animation: gradientRotate 3s ease infinite;
    transition: all 0.3s ease;
}

@keyframes gradientRotate {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.entry-avatar::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--teal-lighter), var(--teal-primary));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    filter: blur(8px);
}

.log-entry:hover .entry-avatar {
    transform: scale(1.1) rotate(5deg);
}

.log-entry:hover .entry-avatar::before {
    opacity: 0.7;
}

.entry-info {
    flex: 1;
}

.entry-info h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.entry-info p {
    font-size: 13px;
    color: var(--gray-600);
}

.entry-time {
    font-size: 14px;
    font-weight: 600;
    color: var(--teal-primary);
}

.log-entries:empty::before {
    content: 'No attendance records yet';
    display: block;
    padding: 60px 30px;
    text-align: center;
    color: var(--gray-400);
    font-size: 14px;
}

/* ============================================
   ANIMATED BACKGROUND PARTICLES
   ============================================ */

.right-panel::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(90, 172, 168, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(90, 172, 168, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(90, 172, 168, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    animation: particleFloat 20s ease-in-out infinite;
}

@keyframes particleFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    25% { transform: translateY(-10px) scale(1.05); }
    50% { transform: translateY(-5px) scale(0.98); }
    75% { transform: translateY(-15px) scale(1.02); }
}

.right-panel > * {
    position: relative;
    z-index: 1;
}

/* ============================================
   NOTIFICATION TOAST
   ============================================ */

.notification-toast {
    position: fixed;
    top: 30px;
    right: 30px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 20px;
    display: flex;
    gap: 16px;
    min-width: 350px;
    z-index: 1000;
    animation: slideInRight 0.4s ease, notificationPulse 0.5s ease 0.4s;
    border-left: 4px solid var(--teal-primary);
    border: 2px solid var(--teal-lighter);
    backdrop-filter: blur(10px);
}

@keyframes notificationPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

.notification-toast.hidden {
    display: none;
}

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

.toast-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--teal-lighter);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.toast-message {
    font-size: 13px;
    color: var(--gray-600);
}

/* ============================================
   LOADING OVERLAY
   ============================================ */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.loading-overlay.hidden {
    display: none;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    position: relative;
    margin-bottom: 24px;
}

.loading-spinner::before,
.loading-spinner::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    border: 4px solid transparent;
    border-top-color: var(--teal-primary);
    border-right-color: var(--teal-primary);
    animation: spinnerRotate 1.2s linear infinite;
}

.loading-spinner::before {
    width: 60px;
    height: 60px;
    top: 0;
    left: 0;
}

.loading-spinner::after {
    width: 40px;
    height: 40px;
    top: 10px;
    left: 10px;
    border-top-color: var(--teal-light);
    border-right-color: var(--teal-light);
    animation-duration: 0.8s;
    animation-direction: reverse;
}

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

.loading-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--gray-700);
    animation: textPulse 1.5s ease-in-out infinite;
}

@keyframes textPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ============================================
   UTILITY ANIMATIONS
   ============================================ */

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

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

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

/* Smooth transitions for all interactive elements */
button, a, .info-card, .log-entry, .detail-row {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1200px) {
    .main-container {
        grid-template-columns: 320px 1fr;
    }

    .left-panel {
        padding: 30px 20px;
    }

    .right-panel {
        padding: 30px;
    }
}

@media (max-width: 968px) {
    .main-container {
        grid-template-columns: 1fr;
    }

    .left-panel {
        padding: 30px 20px;
    }

    .result-details {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .right-panel {
        padding: 20px;
    }

    .camera-header,
    .log-header {
        padding: 20px;
    }

    .recognition-result {
        padding: 20px;
    }

    .result-header {
        flex-wrap: wrap;
    }

    .log-entry {
        padding: 16px 20px;
    }

    .notification-toast {
        right: 20px;
        left: 20px;
        min-width: auto;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-item {
        padding: 12px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: var(--radius-sm);
    }
}
