/* ═══════════════════════════════════════════════════════════
   UT Elearning - Attendance Automation System
   Premium Light Theme — Clean, Creative, Powerful
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    /* Background Layers */
    --bg-body: #f0f4f8;
    --bg-white: #ffffff;
    --bg-subtle: #f8fafc;
    --bg-tinted: #eef4fb;

    /* Text */
    --text-heading: #0f172a;
    --text-body: #334155;
    --text-muted: #94a3b8;
    --text-white: #ffffff;

    /* Primary - Electric Indigo */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --primary-bg: rgba(99, 102, 241, 0.06);
    --primary-glow: rgba(99, 102, 241, 0.25);

    /* Secondary - Teal */
    --teal: #14b8a6;
    --teal-bg: rgba(20, 184, 166, 0.08);

    /* Accent - Amber */
    --amber: #f59e0b;
    --amber-bg: rgba(245, 158, 11, 0.08);

    /* Status */
    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.08);
    --error: #ef4444;

    /* Borders & Shadows */
    --border: #e2e8f0;
    --border-hover: #cbd5e1;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.1);
    --shadow-primary: 0 8px 30px rgba(99, 102, 241, 0.22);
    --shadow-float: 0 20px 50px rgba(99, 102, 241, 0.12);

    /* Radius */
    --r-sm: 10px;
    --r-md: 16px;
    --r-lg: 24px;
    --r-xl: 32px;
    --r-full: 9999px;
}

/* Reset */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg-body);
    color: var(--text-body);
    font-family: 'Cairo', 'Inter', sans-serif;
    min-height: 100vh;
    direction: rtl;
    overflow-x: hidden;
    position: relative;
}

/* ═══════════ ANIMATED BACKGROUND MESH ═══════════ */
body::before {
    content: '';
    position: fixed;
    top: -40%;
    right: -20%;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
    animation: blobFloat 20s ease-in-out infinite alternate;
    pointer-events: none;
}

body::after {
    content: '';
    position: fixed;
    bottom: -30%;
    left: -15%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(20, 184, 166, 0.07) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
    animation: blobFloat 25s ease-in-out infinite alternate-reverse;
    pointer-events: none;
}

@keyframes blobFloat {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(60px, -40px) scale(1.1);
    }

    100% {
        transform: translate(-30px, 30px) scale(0.95);
    }
}

/* Floating Particles (JS-generated) */
.particle {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    animation: floatParticle linear infinite;
}

@keyframes floatParticle {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.7;
    }

    90% {
        opacity: 0.7;
    }

    100% {
        transform: translateY(-15vh) rotate(360deg);
        opacity: 0;
    }
}

/* ═══════════ PAGE WRAPPER ═══════════ */
.page-wrapper {
    max-width: 960px;
    margin: 0 auto;
    padding: 2.5rem 2rem 4rem;
    position: relative;
    z-index: 1;
}

/* ═══════════ HERO HEADER ═══════════ */
.hero-header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.7s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo-strip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 14px 36px;
    margin-bottom: 1.4rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.4s ease;
}

.logo-strip:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.logo-strip img {
    height: 46px;
    width: auto;
    object-fit: contain;
}

.hero-header h1 {
    font-size: 2.1rem;
    font-weight: 900;
    color: var(--text-heading);
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
    line-height: 1.3;
}

.hero-header h1 .gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
    animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(0.7);
        opacity: 0.5;
    }
}

/* ═══════════ STATS ROW ═══════════ */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 1.4rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.stat-card:nth-child(1) {
    animation-delay: 0.1s;
}

.stat-card:nth-child(2) {
    animation-delay: 0.2s;
}

.stat-card:nth-child(3) {
    animation-delay: 0.3s;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: linear-gradient(90deg, var(--primary), var(--teal));
    opacity: 0;
    transition: opacity 0.35s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-hover);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-icon.indigo {
    background: var(--primary-bg);
}

.stat-icon.teal {
    background: var(--teal-bg);
}

.stat-icon.amber {
    background: var(--amber-bg);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-heading);
    line-height: 1.1;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 0.15rem;
}

/* ═══════════ MAIN CARD ═══════════ */
.main-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.15s both;
}

.main-card:hover {
    box-shadow: var(--shadow-float);
}

/* Top decorative bar */
.main-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--teal), var(--primary-light));
    background-size: 200% 100%;
    animation: gradientSlide 4s linear infinite;
}

@keyframes gradientSlide {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 200% 50%;
    }
}

.card-inner-header {
    padding: 1.8rem 2.2rem 1.4rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-inner-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.card-inner-header .tag {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.3rem 0.9rem;
    border-radius: var(--r-full);
    background: var(--primary-bg);
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.12);
}

.card-body {
    padding: 2rem 2.2rem 2.5rem;
}

/* ═══════════ UPLOAD ZONE ═══════════ */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--r-lg);
    padding: 3.5rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-subtle);
    position: relative;
    overflow: hidden;
}

.upload-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, var(--primary-bg), transparent 70%);
    opacity: 0;
    transition: opacity 0.5s;
}

.upload-zone:hover {
    border-color: var(--primary-light);
    background: var(--bg-tinted);
    box-shadow: inset 0 0 60px rgba(99, 102, 241, 0.03);
}

.upload-zone:hover::before {
    opacity: 1;
}

.upload-zone.drag-over {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.04);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.08), inset 0 0 40px rgba(99, 102, 241, 0.04);
    transform: scale(1.005);
}

.upload-icon {
    font-size: 3.8rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
    animation: gentleFloat 5s ease-in-out infinite;
    filter: drop-shadow(0 6px 12px rgba(99, 102, 241, 0.15));
}

@keyframes gentleFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.upload-zone h3 {
    font-size: 1.2rem;
    color: var(--text-heading);
    margin-bottom: 0.4rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.upload-zone p {
    color: var(--text-muted);
    font-size: 0.88rem;
    position: relative;
    z-index: 1;
}

/* ═══════════ FILE INFO ═══════════ */
.file-info {
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-subtle);
    padding: 1rem 1.4rem;
    border-radius: var(--r-md);
    border: 1px solid var(--border);
    animation: slideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-meta {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.f-icon {
    font-size: 1.5rem;
}

.f-name {
    font-weight: 700;
    color: var(--text-heading);
    font-size: 0.92rem;
}

/* ═══════════ ACTION BUTTON ═══════════ */
.action-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--text-white);
    border: none;
    padding: 0.85rem 2rem;
    border-radius: var(--r-md);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Cairo', sans-serif;
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-primary);
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transition: left 0.5s ease;
}

.action-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 14px 40px rgba(99, 102, 241, 0.3);
}

.action-btn:hover::before {
    left: 100%;
}

.action-btn:active {
    transform: translateY(-1px) scale(0.99);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ═══════════ TERMINAL CARD ═══════════ */
.terminal-card {
    margin-top: 2rem;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
    position: relative;
}

.terminal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--teal), var(--primary), var(--teal));
    background-size: 200% 100%;
    animation: gradientSlide 3s linear infinite;
}

.terminal-header {
    padding: 1.2rem 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-subtle);
}

.terminal-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-tag {
    font-size: 0.75rem;
    background: var(--primary-bg);
    color: var(--primary);
    padding: 0.35rem 1rem;
    border-radius: var(--r-full);
    font-weight: 600;
    border: 1px solid rgba(99, 102, 241, 0.1);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.status-tag::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    animation: livePulse 1.5s ease-in-out infinite;
}

/* Progress */
.progress-wrapper {
    padding: 0 2rem;
    margin: 1rem 0;
}

.progress-bar-bg {
    height: 6px;
    background: var(--bg-body);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--teal), var(--primary-light));
    background-size: 200% 100%;
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 12px var(--primary-glow);
    animation: shimmer 2.5s linear infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* Terminal Window */
.terminal-window {
    background: #0f172a;
    margin: 0 1.5rem 1.5rem;
    border-radius: var(--r-md);
    padding: 1.5rem 1.8rem;
    height: 340px;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.82rem;
    color: #4ade80;
    overflow-y: auto;
    line-height: 1.9;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

.terminal-window::before {
    content: '● ● ●';
    display: block;
    padding-bottom: 0.8rem;
    margin-bottom: 0.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: #475569;
    font-size: 0.65rem;
    letter-spacing: 5px;
}

.terminal-window::-webkit-scrollbar {
    width: 4px;
}

.terminal-window::-webkit-scrollbar-track {
    background: transparent;
}

.terminal-window::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.25);
    border-radius: 2px;
}

.terminal-line,
.log-entry {
    margin-bottom: 0.3rem;
    padding: 0.35rem 0.7rem;
    border-radius: 6px;
    display: flex;
    gap: 0.5rem;
    transition: background 0.2s;
    direction: ltr;
    text-align: left;
}

.terminal-line:hover,
.log-entry:hover {
    background: rgba(255, 255, 255, 0.03);
}

.terminal-line::before,
.log-entry::before {
    content: "❯";
    color: var(--primary-light);
    font-weight: bold;
    flex-shrink: 0;
}

.log-error {
    color: #f87171 !important;
    background: rgba(239, 68, 68, 0.06);
    border-right: 3px solid var(--error);
}

.log-error::before {
    content: "✗";
    color: var(--error);
}

/* ═══════════ FOOTER ═══════════ */
.page-footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.78rem;
    animation: fadeInUp 0.6s 0.5s both;
}

.page-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

/* ═══════════ ANIMATIONS ═══════════ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ripple Effect (JS) */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.25);
    transform: scale(0);
    animation: rippleEffect 0.6s ease-out;
    pointer-events: none;
}

@keyframes rippleEffect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ═══════════ UTILITY ═══════════ */
.hidden {
    display: none !important;
}

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 640px) {
    .page-wrapper {
        padding: 1.5rem 1rem;
    }

    .stats-row {
        grid-template-columns: 1fr;
    }

    .hero-header h1 {
        font-size: 1.5rem;
    }

    .card-body {
        padding: 1.5rem;
    }

    .file-info {
        flex-direction: column;
        gap: 1rem;
    }

    .terminal-window {
        height: 260px;
        margin: 0 1rem 1rem;
    }
}