/* Self-hosted Tajawal — Tizen TVs often can't decode WOFF2 and may not
   reach Google Fonts CDN. The system Arabic fallback renders ش with 2 dots
   instead of 3. TTF is listed first so older Tizen browsers pick a format
   they support; WOFF2 is the modern fallback. */
@font-face {
    font-family: 'Tajawal';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/Tajawal/Tajawal-Regular.ttf') format('truetype'),
         url('../fonts/Tajawal/Tajawal-400-arabic.woff2') format('woff2');
}
@font-face {
    font-family: 'Tajawal';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/Tajawal/Tajawal-Medium.ttf') format('truetype'),
         url('../fonts/Tajawal/Tajawal-500-arabic.woff2') format('woff2');
}
@font-face {
    font-family: 'Tajawal';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/Tajawal/Tajawal-Bold.ttf') format('truetype'),
         url('../fonts/Tajawal/Tajawal-700-arabic.woff2') format('woff2');
}
@font-face {
    font-family: 'Tajawal';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('../fonts/Tajawal/Tajawal-ExtraBold.ttf') format('truetype'),
         url('../fonts/Tajawal/Tajawal-800-arabic.woff2') format('woff2');
}
@font-face {
    font-family: 'Tajawal';
    font-style: normal;
    font-weight: 900;
    font-display: swap;
    src: url('../fonts/Tajawal/Tajawal-Black.ttf') format('truetype'),
         url('../fonts/Tajawal/Tajawal-900-arabic.woff2') format('woff2');
}

/* ng-cloak support */
[ng-cloak],
.ng-cloak {
    display: none !important;
}

/* Splash Screen */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, #ffffff 0%, #f0f9ff 100%);
    z-index: 9999;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1);
    transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* Subtle background accent to match theme */
.splash-screen::before,
.splash-screen::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    -webkit-filter: blur(80px);
    filter: blur(80px);
    opacity: 0.15;
    z-index: -1;
    -webkit-animation: splashAuraFloat 15s infinite alternate ease-in-out;
    animation: splashAuraFloat 15s infinite alternate ease-in-out;
}

.splash-screen::before {
    width: 60vw;
    height: 60vw;
    background: #24C2D6;
    background: var(--primary);
    top: -20%;
    left: -10%;
}

.splash-screen::after {
    width: 50vw;
    height: 50vw;
    background: #2CD4A2;
    bottom: -10%;
    right: -10%;
    animation-delay: -5s;
}

@-webkit-keyframes splashAuraFloat {
    from {
        -webkit-transform: translate(0, 0) scale(1);
        transform: translate(0, 0) scale(1);
    }

    to {
        -webkit-transform: translate(5%, 5%) scale(1.1);
        transform: translate(5%, 5%) scale(1.1);
    }
}

@keyframes splashAuraFloat {
    from {
        -webkit-transform: translate(0, 0) scale(1);
        transform: translate(0, 0) scale(1);
    }

    to {
        -webkit-transform: translate(5%, 5%) scale(1.1);
        transform: translate(5%, 5%) scale(1.1);
    }
}

.splash-logo {
    height: 200px;
    /* Slightly larger */
    -webkit-filter: drop-shadow(0 15px 40px rgba(36, 194, 214, 0.4));
    filter: drop-shadow(0 15px 40px rgba(36, 194, 214, 0.4));
    -webkit-filter: drop-shadow(0 15px 40px var(--primary-glow));
    filter: drop-shadow(0 15px 40px var(--primary-glow));
    -webkit-animation: commonPulse 3s infinite ease-in-out;
    animation: commonPulse 3s infinite ease-in-out;
    position: relative;
    z-index: 10;
}

@-webkit-keyframes commonPulse {

    0%,
    100% {
        -webkit-transform: scale(0.95);
        transform: scale(0.95);
        -webkit-filter: drop-shadow(0 10px 20px rgba(36, 194, 214, 0.4));
        filter: drop-shadow(0 10px 20px rgba(36, 194, 214, 0.4));
        -webkit-filter: drop-shadow(0 10px 20px var(--primary-glow));
        filter: drop-shadow(0 10px 20px var(--primary-glow));
    }

    50% {
        -webkit-transform: scale(1.05);
        transform: scale(1.05);
        -webkit-filter: drop-shadow(0 30px 60px rgba(36, 194, 214, 0.4));
        filter: drop-shadow(0 30px 60px rgba(36, 194, 214, 0.4));
        -webkit-filter: drop-shadow(0 30px 60px var(--primary-glow));
        filter: drop-shadow(0 30px 60px var(--primary-glow));
    }
}

@keyframes commonPulse {

    0%,
    100% {
        -webkit-transform: scale(0.95);
        transform: scale(0.95);
        -webkit-filter: drop-shadow(0 10px 20px rgba(36, 194, 214, 0.4));
        filter: drop-shadow(0 10px 20px rgba(36, 194, 214, 0.4));
        -webkit-filter: drop-shadow(0 10px 20px var(--primary-glow));
        filter: drop-shadow(0 10px 20px var(--primary-glow));
    }

    50% {
        -webkit-transform: scale(1.05);
        transform: scale(1.05);
        -webkit-filter: drop-shadow(0 30px 60px rgba(36, 194, 214, 0.4));
        filter: drop-shadow(0 30px 60px rgba(36, 194, 214, 0.4));
        -webkit-filter: drop-shadow(0 30px 60px var(--primary-glow));
        filter: drop-shadow(0 30px 60px var(--primary-glow));
    }
}

:root {
    --bg-light: #f8fafc;
    --bg-gradient: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);

    --primary: #24C2D6;
    --primary-glow: rgba(36, 194, 214, 0.4);
    --secondary: #1B1642;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-pill: rgba(255, 255, 255, 0.9);
    --text-main: #1B1642;
    --text-muted: #575A7B;
    --container-bg: rgba(248, 250, 252, 0.85);
}

/* Standard dark mode — brand-tinted dark teal background, elevated dark
   teal surfaces, white text. Brand teal preserved as accent for hero
   border, time, dividers. High contrast for readability under bright light.
   The .dark-mode class is applied to <html> (not body) because <body>
   has ng-class which overwrites its className on every Angular digest. */
.dark-mode {
    --bg-light: #0a1f24;
    --bg-gradient: linear-gradient(135deg, #0a1f24 0%, #0d2a32 100%);
    --glass-bg: #14323a;
    --glass-pill: #14323a;
    --container-bg: transparent;
    --primary: #24C2D6;
    --primary-glow: rgba(36, 194, 214, 0.5);
    --secondary: #ffffff;
    --text-main: #ffffff;
    --text-muted: #d1d5db;
    --card-border: rgba(36, 194, 214, 0.2);
}

.dark-mode body {
    background-color: #0a1f24 !important;
    background-image: linear-gradient(135deg, #0a1f24 0%, #0d2a32 100%) !important;
    color: #ffffff !important;
}

.dark-mode .modern-container {
    background: transparent !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

.dark-mode .student-item {
    background: #14323a !important;
    border: 1px solid rgba(36, 194, 214, 0.18) !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    -webkit-animation: none !important;
    animation: none !important;
}

.dark-mode .hero-call-wrapper {
    background: #14323a !important;
    border: 1px solid rgba(36, 194, 214, 0.25) !important;
    border-bottom: 5px solid #24C2D6 !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    box-shadow: 0 0 30px rgba(36, 194, 214, 0.12) !important;
}

.dark-mode .list-name,
.dark-mode .hero-name {
    color: #ffffff !important;
    text-shadow: none !important;
}

.dark-mode .list-meta {
    background: rgba(255, 255, 255, 0.08) !important;
}

.dark-mode .meta-badge {
    color: #ffffff !important;
}

.dark-mode .list-meta .announce-time,
.dark-mode .hero-meta .announce-time {
    color: #24C2D6 !important;
}

.dark-mode .meta-divider {
    background: #24C2D6 !important;
}

.dark-mode .modern-footer {
    background: rgba(0, 0, 0, 0.35) !important;
    border-top: 1px solid rgba(36, 194, 214, 0.18) !important;
    color: #ffffff !important;
}

.dark-mode .modern-footer * {
    color: #ffffff !important;
}

.dark-mode .clock-text,
.dark-mode #clock {
    color: #ffffff !important;
}

.dark-mode .clock-date,
.dark-mode #date {
    color: #d1d5db !important;
}

.dark-mode .student-avatar,
.dark-mode .student-avatar-hero {
    border-color: rgba(36, 194, 214, 0.3) !important;
    background: #0a1f24 !important;
    box-shadow: 0 0 12px rgba(36, 194, 214, 0.15) !important;
}

.dark-mode .aura {
    opacity: 0.18 !important;
}

.dark-mode .splash-screen {
    background: radial-gradient(circle at center, #14323a 0%, #0a1f24 100%) !important;
}

.dark-mode .nav-logout-btn {
    background: rgba(36, 194, 214, 0.12) !important;
    border: 2px solid rgba(36, 194, 214, 0.4) !important;
    box-shadow: none !important;
    -webkit-filter: brightness(2.5) contrast(0.8);
    filter: brightness(2.5) contrast(0.8);
}

.dark-mode .student-item::after {
    background: #24C2D6 !important;
    opacity: 1 !important;
}

/* Theme toggle button — fixed bottom-right, small, unobtrusive */
.theme-toggle {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 99999;
    min-width: 56px;
    height: 30px;
    padding: 0 12px;
    border-radius: 15px;
    border: none;
    background: rgba(0, 0, 0, 0.35);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    -webkit-transition: background 0.2s, transform 0.2s;
    transition: background 0.2s, transform 0.2s;
    -webkit-user-select: none;
    user-select: none;
    opacity: 0.7;
}

.theme-toggle:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.6);
}

[dir="rtl"] .theme-toggle {
    right: auto;
    left: 12px;
}

.dark-mode .theme-toggle {
    background: rgba(36, 194, 214, 0.25);
    border: 1px solid rgba(36, 194, 214, 0.4);
}
    /* CallTech Gray */
    /* Slate 500 */

    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;

    --card-radius: 16px;
    --transition-speed: 0.3s;

    --font-primary: 'Outfit', sans-serif;
    --font-secondary: 'Tajawal', sans-serif;
}

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/*
 * Responsive base font-size for TV screens.
 * Old Tizen TVs (Chromium 47-56) ignore clamp() and use the fixed fallback.
 * This scales all rem units proportionally to the viewport.
 * - 1280x720 TV: ~14px base
 * - 1366x768 desktop: ~14px base
 * - 1920x1080 TV: ~16px base (browser default)
 */
html {
    font-size: 14px; /* Fixed fallback for old browsers */
    font-size: clamp(12px, 1.1vw, 16px); /* Scales with viewport width */
}

/* Force Tajawal on every element (strict) */
*,
*::before,
*::after {
    font-family: 'Tajawal', 'Noto Naskh Arabic', 'Tahoma', 'Arial', sans-serif !important;
}

/* Base styling */
body {
    margin: 0;
    padding: 0;
    font-family: 'Tajawal', 'Noto Naskh Arabic', 'Tahoma', 'Arial', sans-serif;
    background-color: #E6F4F7;
    color: #1B1642;
    color: var(--text-main);
    overflow: hidden !important;
    /* Force no scroll */
    height: 100vh !important;
    width: 100vw !important;
    position: relative;
}

/* Breathing Aura Background Elements */
.aura {
    position: fixed;
    width: 60vw;
    height: 60vw;
    border-radius: 50%;
    -webkit-filter: blur(100px);
    filter: blur(100px);
    z-index: 0;
    opacity: 0.25;
    pointer-events: none;
    -webkit-animation: auraFloat 20s infinite alternate ease-in-out;
    animation: auraFloat 20s infinite alternate ease-in-out;
}

.aura-1 {
    background: radial-gradient(circle, #24C2D6, transparent);
    background: radial-gradient(circle, var(--primary), transparent);
    top: -15vw;
    left: -15vw;
}

.aura-2 {
    background: radial-gradient(circle, #2CD4A2, transparent);
    bottom: -15vw;
    right: -15vw;
    -webkit-animation-delay: -10s;
    animation-delay: -10s;
}

@-webkit-keyframes auraFloat {
    0% {
        -webkit-transform: translate(0, 0) scale(1) rotate(0deg);
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 0.2;
    }

    50% {
        -webkit-transform: translate(5%, 5%) scale(1.1) rotate(10deg);
        transform: translate(5%, 5%) scale(1.1) rotate(10deg);
        opacity: 0.3;
    }

    100% {
        -webkit-transform: translate(0, 0) scale(1) rotate(0deg);
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 0.2;
    }
}

@keyframes auraFloat {
    0% {
        -webkit-transform: translate(0, 0) scale(1) rotate(0deg);
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 0.2;
    }

    50% {
        -webkit-transform: translate(5%, 5%) scale(1.1) rotate(10deg);
        transform: translate(5%, 5%) scale(1.1) rotate(10deg);
        opacity: 0.3;
    }

    100% {
        -webkit-transform: translate(0, 0) scale(1) rotate(0deg);
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 0.2;
    }
}

/* Breathing Idle for Cards */
@-webkit-keyframes cardFloat {
    0% {
        -webkit-transform: translateY(0);
        transform: translateY(0);
    }

    50% {
        -webkit-transform: translateY(-3px);
        transform: translateY(-3px);
    }

    100% {
        -webkit-transform: translateY(0);
        transform: translateY(0);
    }
}

@keyframes cardFloat {
    0% {
        -webkit-transform: translateY(0);
        transform: translateY(0);
    }

    50% {
        -webkit-transform: translateY(-3px);
        transform: translateY(-3px);
    }

    100% {
        -webkit-transform: translateY(0);
        transform: translateY(0);
    }
}

#sampleVideo {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    z-index: 100;
    opacity: 1 !important;
    background: #000;

    /* HD Optimizations */
    -webkit-filter: contrast(1.1) saturate(1.1) brightness(1.05) sharpen(0.5);
    filter: contrast(1.1) saturate(1.1) brightness(1.05);
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    /* Hardware acceleration */
}

.video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 101;
    overflow: hidden;
    display: none;
}

.video-active .video-container {
    display: block !important;
}

/* Hero Text Enhancement */
.video-active .hero-name {
    -webkit-filter: drop-shadow(0 0 15px rgba(36, 194, 214, 0.9));
    filter: drop-shadow(0 0 15px rgba(36, 194, 214, 0.9));
    -webkit-animation: heroGlow 1.5s infinite alternate ease-in-out, shimmer 12s infinite linear;
    animation: heroGlow 1.5s infinite alternate ease-in-out, shimmer 12s infinite linear;
}

@-webkit-keyframes heroGlow {
    from {
        -webkit-filter: drop-shadow(0 0 8px rgba(36, 194, 214, 0.6));
        filter: drop-shadow(0 0 8px rgba(36, 194, 214, 0.6));
    }

    to {
        -webkit-filter: drop-shadow(0 0 25px rgba(36, 194, 214, 1));
        filter: drop-shadow(0 0 25px rgba(36, 194, 214, 1));
    }
}

@keyframes heroGlow {
    from {
        -webkit-filter: drop-shadow(0 0 8px rgba(36, 194, 214, 0.6));
        filter: drop-shadow(0 0 8px rgba(36, 194, 214, 0.6));
    }

    to {
        -webkit-filter: drop-shadow(0 0 25px rgba(36, 194, 214, 1));
        filter: drop-shadow(0 0 25px rgba(36, 194, 214, 1));
    }
}



.modern-container {
    height: 100vh !important;
    max-height: 100vh !important;
    background: rgba(230, 244, 247, 0.95);
    background: rgba(230, 244, 247, 0.85);
    -webkit-backdrop-filter: blur(40px);
    backdrop-filter: blur(40px);
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
    padding: 1.5rem 1.5rem 52px;
    padding: clamp(1rem, 2vh, 2.5rem) 1.5rem 52px;
    position: relative;
    z-index: 10;
    overflow: hidden !important;
    /* Prevent any container scroll */
}

.video-active .modern-container {
    display: none !important;
}

.video-active .aura {
    display: none !important;
}

/* HERO CALL SECTION */
.hero-call-wrapper {
    background: rgba(255, 255, 255, 0.9);
    background: var(--glass-pill);
    -webkit-backdrop-filter: blur(25px);
    backdrop-filter: blur(25px);
    border-radius: 2.5rem;
    padding: 1rem 2rem !important;
    /* Slimmer vertical padding to prevent ballooning */
    margin-top: 0.5rem;
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.08),
        inset 0 0 0 1px rgba(255, 255, 255, 0.8);
    width: 95%;
    /* Fill more horizontal space */
    max-width: 1300px;
    /* Increased for better spread on wide screens */
    border-bottom: 5px solid #24C2D6;
    border-bottom: 5px solid var(--primary);
    position: relative;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    overflow: visible;
    z-index: 10;
}

.hero-call-wrapper>* {
    margin-bottom: 0.4rem;
}

.hero-call-wrapper>*:last-child {
    margin-bottom: 0;
}

.list-meta .badge-text {
    font-size: 0.8rem;
    color: #24C2D6;
    color: var(--primary);
    background: rgba(36, 194, 214, 0.12);
    padding: 0.15rem 0.6rem;
    border-radius: 6px;
    font-weight: 700;
    display: inline-block;
    border: 1px solid rgba(36, 194, 214, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.hero-banner {
    background: transparent;
    height: 180px;
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    padding: 0 4rem;
    /* Enforced horizontal gap for all resolutions */
    position: relative;
    z-index: 20;
}

.hero-banner>* {
    margin-left: 1.25rem;
    margin-right: 1.25rem;
}

.hero-banner>*:first-child {
    margin-left: 0;
}

.hero-banner>*:last-child {
    margin-right: 0;
}


.hero-call-wrapper.has-hero-pic {
    -webkit-flex-direction: row;
    flex-direction: row;
    padding: 1rem 2rem;
    padding: 1rem clamp(1rem, 2vw, 2rem);
    width: 80%;
    width: clamp(500px, 82%, 1500px);
    -webkit-align-items: center;
    align-items: center;
    border-bottom: 8px solid #24C2D6;
    border-bottom: 8px solid var(--primary);
    gap: 1rem;
    gap: clamp(0.5rem, 1.2vw, 1.4rem);
}

.hero-call-wrapper.has-hero-pic>* {
    margin-right: 0;
    margin-left: 0;
}

.student-avatar-hero {
    width: 130px;
    width: clamp(100px, 15vh, 160px);
    height: 130px;
    height: clamp(100px, 15vh, 160px);
    border-radius: 50%;
    border: 8px solid #fff;
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.15),
        0 0 30px rgba(36, 194, 214, 0.4);
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.15),
        0 0 30px var(--primary-glow);
    background: #fff;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
    overflow: hidden;
    -webkit-animation: cardFloat 6s infinite alternate ease-in-out;
    animation: cardFloat 6s infinite alternate ease-in-out;
}

.student-avatar-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-call-wrapper.has-hero-pic .hero-content {
    -webkit-align-items: flex-start;
    align-items: flex-start;
    text-align: start;
    -webkit-flex: 1;
    flex: 1;
    min-width: 0;
}

.hero-call-wrapper.has-hero-pic .hero-name {
    font-size: 1.4rem;
    font-size: clamp(0.85rem, 1.3vw, 1.5rem);
    text-align: start;
}

body.tv-mode .hero-call-wrapper.has-hero-pic .hero-name {
    font-size: 2.2rem !important;
    font-size: clamp(1.4rem, 4vw, 3rem) !important;
}

.hero-content {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-align-items: center;
    align-items: center;
    text-align: center;
    width: 100%;
    padding-top: 0;
    overflow: hidden;
}

.hero-name-row {
    width: 100%;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    margin-bottom: 0.2rem;
}

.has-hero-pic .hero-name-row {
    -webkit-box-pack: start;
    -webkit-justify-content: flex-start;
    -ms-flex-pack: start;
    justify-content: flex-start;
}

.hero-call-wrapper::before {
    content: '';
    position: absolute;
    top: -30px;
    left: -30px;
    right: -30px;
    bottom: -30px;
    background: radial-gradient(circle, rgba(36, 194, 214, 0.4), transparent 70%);
    background: radial-gradient(circle, var(--primary-glow), transparent 70%);
    z-index: -1;
    opacity: 0.4;
    -webkit-animation: auraPulse 4s infinite ease-in-out;
    animation: auraPulse 4s infinite ease-in-out;
}

/* Impact Burst on Entrance */
.hero-call-wrapper.ng-enter::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 2.5rem;
    box-shadow: 0 0 100px 30px rgba(36, 194, 214, 0.4);
    box-shadow: 0 0 100px 30px var(--primary-glow);
    -webkit-animation: impactBurst 0.8s ease-out forwards;
    animation: impactBurst 0.8s ease-out forwards;
    z-index: -2;
}

@-webkit-keyframes impactBurst {
    0% {
        -webkit-transform: scale(0.8);
        transform: scale(0.8);
        opacity: 1;
    }

    100% {
        -webkit-transform: scale(1.5);
        transform: scale(1.5);
        opacity: 0;
    }
}

@keyframes impactBurst {
    0% {
        -webkit-transform: scale(0.8);
        transform: scale(0.8);
        opacity: 1;
    }

    100% {
        -webkit-transform: scale(1.5);
        transform: scale(1.5);
        opacity: 0;
    }
}

@-webkit-keyframes auraPulse {

    0%,
    100% {
        -webkit-transform: scale(1);
        transform: scale(1);
        opacity: 0.4;
    }

    50% {
        -webkit-transform: scale(1.1);
        transform: scale(1.1);
        opacity: 0.6;
    }
}

@keyframes auraPulse {

    0%,
    100% {
        -webkit-transform: scale(1);
        transform: scale(1);
        opacity: 0.4;
    }

    50% {
        -webkit-transform: scale(1.1);
        transform: scale(1.1);
        opacity: 0.6;
    }
}

.banner-left,
.banner-right {
    -webkit-flex: 0 0 auto;
    flex: 0 0 auto;
    /* Don't grow, don't shrink */
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    position: relative;
    z-index: 10;
    min-width: 180px;
}

.banner-left>*,
.banner-right>* {
    margin-left: 0.75rem;
    margin-right: 0.75rem;
}

.banner-left>*:first-child,
.banner-right>*:first-child {
    margin-left: 0;
}

.banner-left>*:last-child,
.banner-right>*:last-child {
    margin-right: 0;
}

.banner-right {
    -webkit-box-pack: end;
    -webkit-justify-content: flex-end;
    -ms-flex-pack: end;
    justify-content: flex-end;
}

.banner-left img,
.banner-right img {
    height: 45px;
    height: clamp(30px, 4vh, 60px);
    width: auto;
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
}

.banner-center {
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    -ms-flex: 1;
    flex: 1;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    text-align: center;
    min-width: 0;
    padding: 0;
}

/* Images */
.logo-container {
    -webkit-flex-shrink: 0;
    -ms-flex-negative: 0;
    flex-shrink: 0;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: end;
    -webkit-justify-content: flex-end;
    -ms-flex-pack: end;
    justify-content: flex-end;
}

.top-logo {
    height: 80px !important;
    width: auto !important;
    max-width: 250px !important;
    object-fit: contain !important;
}

.clock-text {
    /* Layout Container */
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-justify-content: center;
    justify-content: center;
    -webkit-align-items: center;
    align-items: center;
    position: relative;
    padding-left: 2rem;
    margin-left: 4rem;
    /* Mandatory safety gap to prevent overlap */
    border-left: 4px solid #24C2D6;
    border-left: 4px solid var(--primary);
}

#clock {
    font-size: 1.8rem;
    font-size: clamp(1.1rem, 1.6vw, 2.2rem);
    font-weight: 900;
    color: #1B1642;
    color: var(--secondary);
    letter-spacing: -1px;
    line-height: 0.9;
}

body.tv-mode #clock {
    font-size: 2.4rem;
    font-size: clamp(1.6rem, 2.4vw, 3rem);
    letter-spacing: -2px;
}

#date {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1B1642;
    color: var(--secondary);
    margin-top: 4px;
    opacity: 0.9;
    letter-spacing: 0;
}

/* LTR Fix: Move divider to right side for English */
[dir="ltr"] .clock-text {
    border-left: none;
    padding-left: 0;
    margin-left: 2rem;
    border-right: 4px solid #24C2D6;
    border-right: 4px solid var(--primary);
    padding-right: 2rem;
    margin-right: 4rem;
}

.banner-right div,
.banner-left div {
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    /* Removed max-width to prevent clock cropping */
}

/* Hero Master Motion: Cinematic Slide & Zoom */
.hero-name {
    font-size: 1.3rem !important;
    font-size: clamp(0.9rem, 1.4vw, 1.6rem) !important;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1.4;
    color: #1B1642;
    color: var(--secondary);
    text-shadow: none;
    margin: 0;
    padding: 0.15em 0;
    /* PC mode: single line — shrink to fit, ellipsis if still too long. */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    max-width: 95%;
    word-wrap: break-word;
    word-break: break-word;
    -webkit-transition: all 0.7s cubic-bezier(0.23, 1, 0.32, 1);
    transition: all 0.7s cubic-bezier(0.23, 1, 0.32, 1);
}

@media screen and (max-width: 1400px) {

    .banner-left,
    .banner-right {
        flex: 0 0 auto !important;
        min-width: 180px !important;
        z-index: 100;
    }

    /* Fixed clock cropping (exempt from ellipsis) */
    .banner-left div.clock-text,
    .banner-right div.clock-text {
        max-width: none !important;
        overflow: visible !important;
        text-overflow: clip !important;
        white-space: nowrap !important;
        display: block !important;
        min-width: 150px !important;
    }

    .megaphone-icon {
        max-width: 80px !important;
        height: auto !important;
    }

    #clock {
        font-size: 1.8rem !important;
    }

    .hero-name {
        font-size: 2rem !important;
        font-size: clamp(1.4rem, 4vw, 2.5rem) !important;
        padding: 0.2em 0 !important;
        line-height: 1.4 !important;
        max-height: none !important;
    }

    .modern-footer {
        padding: 0 4rem !important;
        height: 56px !important;
    }

    .stats-container > * {
        margin-left: 1.1rem !important;
        margin-right: 1.1rem !important;
    }
}

@media screen and (max-width: 1024px) {

    .banner-left,
    .banner-right {
        flex: 0 0 240px !important;
        min-width: 240px !important;
    }

    #clock {
        font-size: 1.6rem !important;
    }

    .hero-name {
        font-size: 1.4rem !important;
        /* Smaller for shorter screens */
        padding: 0.2em 0 !important;
        line-height: 1.4 !important;
        margin-top: 0.8rem !important;
        /* Increased for top clearance on short screens */
    }

    .hero-call-wrapper {
        padding: 1.5rem 1rem !important;
        min-height: 140px !important;
    }
}

/* Specific scaling for "short" screens (low height) */
@media screen and (max-height: 850px) {
    .hero-call-wrapper {
        padding-top: 1.8rem !important;
        padding-bottom: 1.2rem !important;
        min-height: 150px !important;
    }

    .hero-name {
        font-size: 1.6rem !important;
        font-size: clamp(1.2rem, 3vw, 2.1rem) !important;
        margin-top: 1.2rem !important;
        /* Better top clearance */
    }

    .hero-banner {
        margin-bottom: 1rem !important;
    }
}

@media screen and (max-height: 720px) {
    .hero-call-wrapper {
        padding-top: 1.5rem !important;
        padding-bottom: 1rem !important;
        min-height: 130px !important;
    }

    .hero-name {
        font-size: 1.3rem !important;
        margin-top: 1rem !important;
    }

    .modern-container {
        padding: 0.2rem 0.5rem 50px !important;
    }
}


/* Entrance: Zoom & Slide up from bottom */
@media screen and (max-width: 1400px) {
    #audioUnlockOverlay>div {
        right: 15vw !important;
        /* Shift left to avoid clock overlap */
    }
}

.hero-name.ng-enter {
    opacity: 0;
    -webkit-transform: translateY(40px) scale(0.9);
    transform: translateY(40px) scale(0.9);
}

.hero-name.ng-enter-active {
    opacity: 1;
    -webkit-transform: translateY(0) scale(1);
    transform: translateY(0) scale(1);
}

/* Exit: Slide up and out to top */
.hero-name.ng-leave {
    opacity: 1;
    -webkit-transform: translateY(0) scale(1);
    transform: translateY(0) scale(1);
    position: absolute;
    width: 100%;
    left: 0;
    text-align: center;
}

.hero-name.ng-leave-active {
    opacity: 0;
    -webkit-transform: translateY(-50px) scale(1.1);
    transform: translateY(-50px) scale(1.1);
}

@-webkit-keyframes shimmer {
    to {
        background-position: 200% center;
    }
}

@keyframes shimmer {
    to {
        background-position: 200% center;
    }
}

.hero-meta {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    background: rgba(27, 22, 66, 0.03) !important;
    padding: 0.4rem 1.2rem !important;
    -webkit-flex-wrap: nowrap !important;
    -ms-flex-wrap: nowrap !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    border-radius: 2rem;
    margin-top: 0.5rem;
    opacity: 1;
    -webkit-transform: translateY(0);
    transform: translateY(0);
    -webkit-transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1) 0.15s;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1) 0.15s;
    width: auto;
    max-width: 100%;
    overflow: visible;
}

.hero-meta > * {
    margin-left: 0.15rem;
    margin-right: 0.15rem;
    -webkit-flex-shrink: 0 !important;
    flex-shrink: 0 !important;
}

.has-hero-pic .hero-meta {
    -webkit-justify-content: flex-start;
    justify-content: flex-start;
    padding-left: 0.5rem !important;
}

/* Staggered Metadata Effect */
.hero-name.ng-enter+.hero-meta {
    opacity: 0;
    -webkit-transform: translateY(20px);
    transform: translateY(20px);
}

.hero-name.ng-enter-active+.hero-meta {
    opacity: 1;
    -webkit-transform: translateY(0);
    transform: translateY(0);
}

.hero-meta .meta-badge {
    font-size: 1rem;
    opacity: 0.85;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Announce time should be 2X larger */
.hero-meta .announce-time {
    font-size: 1.5rem;
}

.hero-meta .meta-divider {
    width: 6px;
    height: 6px;
}

.meta-badge {
    font-size: 0.9rem;
    font-size: clamp(0.6rem, 1.2vw, 1.05rem);
    /* Adaptive scaling - vw-based like old UI */
    color: #575A7B;
    color: var(--text-muted);
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
}

.meta-divider {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #24C2D6;
    background: var(--primary);
    border-radius: 50%;
    opacity: 1;
    margin: 0 0.4rem;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
    vertical-align: middle;
    -webkit-align-self: center;
    align-self: center;
}

/* === CONTENT GRID === */
.content-area {
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    -ms-flex: 1;
    flex: 1;
    padding: 0.5rem 3rem 0.5rem;
    overflow: hidden !important;
    /* NO SCROLL */
}

.content-area::-webkit-scrollbar {
    display: none;
}

/* Flexbox fallback for old browsers that don't support CSS Grid */
.student-grid {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-align-content: flex-start;
    -ms-flex-line-pack: start;
    align-content: flex-start;
    margin: 0 -0.5rem;
    /* Negative margin to offset child padding (acts as horizontal gap) */
}

.student-grid > * {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    width: 33.333%;
    padding: 0 0.5rem;
    margin-bottom: 1rem;
}

/* CSS Grid enhancement (overrides flexbox when supported).
   Older Tizen browsers ignore modern `gap` on grid — keep legacy
   grid-gap + column-gap/row-gap so cards always have visible spacing. */
@supports (display: grid) {
    .student-grid {
        display: -ms-grid;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-gap: 1rem;
        column-gap: 1rem;
        row-gap: 1rem;
        gap: 1rem;
        margin: 0;
    }

    .student-grid > * {
        width: auto;
        padding: 0;
        margin-bottom: 0;
    }
}

/* Responsive columns */
@media screen and (max-width: 1200px) {
    .student-grid > * {
        width: 50%;
    }

    @supports (display: grid) {
        .student-grid {
            grid-template-columns: repeat(2, 1fr);
        }

        .student-grid > * {
            width: auto;
        }
    }
}

@media screen and (max-width: 800px) {
    .student-grid > * {
        width: 100%;
    }

    @supports (display: grid) {
        .student-grid {
            grid-template-columns: 1fr;
        }

        .student-grid > * {
            width: auto;
        }
    }
}

/* More breathing room for TextPic mode */
.text-pic-mode .content-area {
    padding-top: 1.5rem;
    padding-bottom: 0.5rem;
}

.text-pic-mode .student-grid > * {
    margin-bottom: 0.8rem;
}

@supports (display: grid) {
    .text-pic-mode .student-grid {
        gap: 0.8rem;
    }

    .text-pic-mode .student-grid > * {
        margin-bottom: 0;
    }
}

/* Student Cards (Sleek 2.0 with Idle) */
.student-item {
    background: rgba(255, 255, 255, 0.7);
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 16px;
    border-radius: 1.2rem;
    padding: 1.2rem 2rem;
    box-shadow:
        0 10px 20px rgba(0, 0, 0, 0.04),
        inset 0 0 0 1px rgba(255, 255, 255, 0.6);
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    -webkit-transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    -webkit-animation: cardFloat 6s infinite ease-in-out;
    animation: cardFloat 6s infinite ease-in-out;
}

.student-item.has-pic {
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -webkit-flex-direction: row;
    -ms-flex-direction: row;
    flex-direction: row;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    padding: 0.6rem 0.8rem;
    padding: clamp(0.5rem, 1.2vh, 1rem) clamp(0.6rem, 1vw, 1rem);
    min-height: 90px;
    min-height: clamp(90px, 11vh, 130px);
}

.student-item.has-pic {
    gap: 1.2rem;
}

.student-item.has-pic>* {
    margin-right: 0;
    margin-left: 0;
}

.student-avatar {
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
    width: 80px;
    width: clamp(55px, 8vw, 100px);
    height: 80px;
    height: clamp(55px, 8vw, 100px);
    border-radius: 50%;
    overflow: hidden;
    background: #fff;
    border: 3px solid #fff;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.student-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Initial letter avatar fallback when no photo */
.avatar-initial {
    width: 100%;
    height: 100%;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    font-weight: 800;
    font-size: 1.8rem;
    font-size: clamp(1.2rem, 3.5vw, 2.2rem);
    text-transform: uppercase;
    letter-spacing: 0;
    line-height: 1;
    text-align: center;
    padding-top: 0.05em;
    -webkit-user-select: none;
    user-select: none;
}

/* Hero avatar initial - larger */
.avatar-initial-hero {
    font-size: 3rem;
    font-size: clamp(2rem, 6vh, 4rem);
}

.list-info {
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    -ms-flex: 1;
    flex: 1;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    min-width: 0;
    /* Critical for flex-shrink text truncation */
    overflow: hidden;
}

.student-item.has-pic .list-info {
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    -ms-flex: 1;
    flex: 1;
    min-width: 0;
}

.student-item.has-pic .list-name {
    font-size: 1.1rem;
    font-size: clamp(0.85rem, 1.3vw, 1.5rem);
    margin-bottom: 0.2rem;
    /* 2-line limit - with fallback for old browsers */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    max-height: 2.4em;
    /* Fallback: 2 lines × 1.2 line-height = 2.4em */
    word-wrap: break-word;
    word-break: break-word;
}



.student-item:nth-child(even) {
    animation-delay: -3s;
}

/* Smart Accent Bar */
.student-item::after {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 6px;
    background: #24C2D6;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
    opacity: 0.8;
}

[dir="rtl"] .student-item::after {
    left: auto;
    right: 0;
    border-radius: 4px 0 0 4px;
}

/* TV-mode upgrade: big readable-from-distance fonts on Tizen/WebOS/
   smart-TV browsers (tagged via JS user-agent sniffing). Default sizing
   below stays compact for PCs/laptops/browser test windows so long
   Arabic names fit on one line. */
body.tv-mode .student-item.has-pic .list-name {
    font-size: 2.4rem;
    font-size: clamp(0.95rem, 1.9vw, 4rem);
}

body.tv-mode .list-name {
    font-size: 2.6rem;
    font-size: clamp(0.9rem, 2.3vw, 4.5rem);
}

body.tv-mode .hero-name {
    font-size: 2.5rem !important;
    font-size: clamp(1.4rem, 3.5vw, 2.8rem) !important;
    line-height: 1.4;
    /* TV: allow up to 2 lines (readable from distance, no ellipsis). */
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    max-height: 3em;
}

.list-meta {
    display: -webkit-inline-box !important;
    display: -webkit-inline-flex !important;
    display: -ms-inline-flexbox !important;
    display: inline-flex !important;
    -webkit-box-align: center !important;
    -webkit-align-items: center !important;
    -ms-flex-align: center !important;
    align-items: center !important;
    -webkit-flex-wrap: nowrap !important;
    -ms-flex-wrap: nowrap !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    background: rgba(27, 22, 66, 0.03) !important;
    padding: 0.4rem 0.5rem !important;
    border-radius: 2rem !important;
    margin-top: 0.1rem !important;
    max-width: 100%;
    overflow: hidden;
    width: -webkit-fit-content;
    width: -moz-fit-content;
    width: fit-content;
    -webkit-align-self: flex-start;
    -ms-flex-item-align: start;
    align-self: flex-start;
}

.list-meta>* {
    margin-right: 0.1rem;
}

.list-meta>*:last-child {
    margin-right: 0;
}

.list-meta > * {
    -webkit-flex-shrink: 0 !important;
    flex-shrink: 0 !important;
}

.list-meta .meta-badge {
    font-size: 0.8rem;
    font-size: clamp(0.55rem, 0.85vw, 0.9rem);
    font-weight: 700;
    white-space: nowrap;
    line-height: 1;
}

/* Announce time slightly larger for readability */
.list-meta .announce-time {
    font-size: 1.1rem;
    font-size: clamp(0.8rem, 1.1vw, 1.15rem);
    white-space: nowrap;
    line-height: 1;
}

.list-meta .meta-divider {
    width: 5px;
    height: 5px;
    -webkit-align-self: center;
    align-self: center;
    margin: 0 0.15rem;
    position: relative;
    top: -1px;
}

/* ngAnimate Transitions */
.student-item.ng-enter {
    opacity: 0;
    -webkit-transform: translateY(30px) scale(0.95);
    transform: translateY(30px) scale(0.95);
}

.student-item.ng-enter-active {
    opacity: 1;
    -webkit-transform: translateY(0) scale(1);
    transform: translateY(0) scale(1);
}

.student-item.ng-leave {
    opacity: 1;
    -webkit-transform: scale(1);
    transform: scale(1);
}

.student-item.ng-leave-active {
    opacity: 0;
    -webkit-transform: scale(0.8) translateY(-20px);
    transform: scale(0.8) translateY(-20px);
}

.student-item.ng-move {
    -webkit-transition: all 0.5s ease;
    transition: all 0.5s ease;
}

/* Staggered entry for grid items */
.student-item.ng-enter-stagger {
    -webkit-animation-delay: 50ms;
    animation-delay: 50ms;
    -webkit-transition-delay: 50ms;
    transition-delay: 50ms;
}

/* Removed Hover Effects for TV/Large Screens */

@-webkit-keyframes cardEntrance {
    from {
        opacity: 0;
        -webkit-transform: translateY(30px) scale(0.9);
        transform: translateY(30px) scale(0.9);
    }

    to {
        opacity: 1;
        -webkit-transform: translateY(0) scale(1);
        transform: translateY(0) scale(1);
    }
}

@keyframes cardEntrance {
    from {
        opacity: 0;
        -webkit-transform: translateY(30px) scale(0.9);
        transform: translateY(30px) scale(0.9);
    }

    to {
        opacity: 1;
        -webkit-transform: translateY(0) scale(1);
        transform: translateY(0) scale(1);
    }
}

/* Staggered animation for grid items */
.student-item:nth-child(1) {
    animation-delay: 0.1s;
}

.student-item:nth-child(2) {
    animation-delay: 0.15s;
}

.student-item:nth-child(3) {
    animation-delay: 0.2s;
}

.student-item:nth-child(4) {
    animation-delay: 0.25s;
}

.student-item:nth-child(5) {
    animation-delay: 0.3s;
}

.student-item:nth-child(6) {
    animation-delay: 0.35s;
}

.student-item:nth-child(7) {
    animation-delay: 0.4s;
}

.student-item:nth-child(8) {
    animation-delay: 0.45s;
}

.student-item:nth-child(9) {
    animation-delay: 0.5s;
}

.student-item:nth-child(10) {
    animation-delay: 0.55s;
}

/* Removed student-item hover */

/* Status Colors */
.student-item.urgent {
    border-left: 6px solid #ef4444;
    border-left: 6px solid var(--danger);
    background: #fef2f2;
}

.student-item.subscribed {
    border-left: 6px solid #1B1642;
    border-left: 6px solid var(--secondary);
    background: #eef2ff;
}

.student-item.new-entry {
    border-left: 6px solid #10b981;
    border-left: 6px solid var(--success);
}

.student-item.exit-no-announce {
    border-left: 6px solid #f59e0b;
    border-left: 6px solid var(--warning);
    background: #fffbeb;
}

.list-name {
    font-size: 1.2rem;
    font-size: clamp(0.85rem, 1.5vw, 1.7rem);
    font-weight: 700;
    color: #1B1642;
    color: var(--text-main);
    /* 2-line limit with responsive font scaling */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
    max-height: 2.5em;
    /* Fallback: 2 lines × 1.25 line-height = 2.5em */
    width: 100%;
    word-wrap: break-word;
    word-break: break-word;
}



/* === FOOTER === */
.modern-footer {
    height: 46px;
    /* Slimmer footer — reduced from 60px to give cards more vertical room.
       Keep .modern-container padding-bottom in sync (currently 52px). */
    background: rgba(230, 244, 247, 0.85);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(36, 194, 214, 0.25);
    box-shadow: 0 -2px 12px rgba(27, 22, 66, 0.06);
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    padding: 0 2rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.stats-container {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    -webkit-flex: 1;
    flex: 1;
    overflow: hidden;
    -webkit-flex-wrap: nowrap !important;
    flex-wrap: nowrap !important;
    /* Single line stats as well */
}

.stats-container>* {
    margin-left: 1.5rem;
    margin-right: 1.5rem;
}

.stats-container>*:first-child {
    margin-left: 0;
}

.stats-container>*:last-child {
    margin-right: 0;
}

.stat-item {
    display: -webkit-inline-flex;
    display: inline-flex;
    -webkit-align-items: center;
    align-items: center;
    white-space: nowrap;
    font-weight: 600;
    font-size: 1rem;
    color: #575A7B;
    color: var(--text-muted);
}

.stat-item>* {
    margin-right: 0.5rem;
}

.stat-item>*:last-child {
    margin-right: 0;
}

.footer-screen-info {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    max-width: 500px;
    line-height: 1.2;
    opacity: 0.6;
    text-align: inherit;
    margin-left: 1rem;
    margin-right: 1rem;
}

.screen-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1B1642;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.screen-custom {
    font-size: 0.75rem;
    font-weight: 500;
    color: #24C2D6;
    color: var(--primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-item b {
    color: #24C2D6;
    color: var(--primary);
    font-size: 1.2rem;
}

.nav-logout-btn {
    box-sizing: border-box !important;
    height: 34px !important;
    width: 34px !important;
    cursor: pointer !important;
    opacity: 1 !important;
    padding: 8px !important;
    background: #e2e8f0 !important;
    /* Clearly visible light blue-grey */
    border: 2px solid #cbd5e1 !important;
    border-radius: 50% !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    -webkit-transition: all 0.3s ease !important;
    transition: all 0.3s ease !important;
}

/* Removed logout-btn hover */

@-webkit-keyframes zoomIn {
    from {
        opacity: 0;
        -webkit-transform: scale(0.8);
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        -webkit-transform: scale(1);
        transform: scale(1);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        -webkit-transform: scale(0.8);
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        -webkit-transform: scale(1);
        transform: scale(1);
    }
}

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

    to {
        opacity: 1;
        -webkit-transform: translateY(0);
        transform: translateY(0);
    }
}

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

    to {
        opacity: 1;
        -webkit-transform: translateY(0);
        transform: translateY(0);
    }
}

/* Responsive */
/* Already handled in consolidated section above */

/* === Large Screen / TV / Whiteboard Responsiveness === */

@media screen and (max-width: 1600px) {
    .clock-text {
        font-size: 3rem;
        margin-left: 2rem;
    }

    .hero-name {
        font-size: 1.5rem !important;
        font-size: clamp(1.2rem, 3vw, 2.2rem) !important;
    }
}

@media screen and (max-width: 1366px) {
    .modern-container {
        padding: 0.5rem 0.5rem 52px;
    }

    .content-area {
        padding: 0.5rem 1rem;
    }

    .hero-banner {
        padding: 0 1.5rem;
        height: 120px;
        min-height: auto;
    }

    .hero-banner > * {
        margin-left: 0.5rem;
        margin-right: 0.5rem;
    }

    .banner-left,
    .banner-right {
        min-width: 140px;
    }

    .banner-left > *,
    .banner-right > * {
        margin-left: 0.4rem;
        margin-right: 0.4rem;
    }

    .clock-text {
        font-size: 2.2rem;
        margin-left: 1rem;
        padding-left: 0.8rem;
    }

    .hero-call-wrapper {
        padding: 0.8rem 1.5rem !important;
    }

    .hero-call-wrapper > * {
        margin-bottom: 0.3rem;
    }

    .hero-name {
        font-size: 2rem !important;
        font-size: clamp(1.2rem, 2.5vw, 2rem) !important;
    }

    .hero-meta {
        margin-top: 0.3rem;
        padding: 0.3rem 0.8rem !important;
    }

    .hero-meta > * {
        margin-left: 0.1rem;
        margin-right: 0.1rem;
    }

    .hero-meta .meta-badge {
        font-size: 0.8rem;
    }

    .hero-meta .announce-time {
        font-size: 1.1rem;
    }

    .list-meta .meta-badge {
        font-size: 0.6rem;
    }

    .list-meta .announce-time {
        font-size: 0.85rem;
    }

    .meta-divider {
        width: 4px;
        height: 4px;
        margin: 0 0.15rem;
    }

    .student-item.has-pic {
        gap: 0.6rem;
        padding: 0.4rem 0.5rem;
        min-height: 90px;
    }

    .student-item.has-pic .student-avatar {
        width: 65px;
        height: 65px;
    }

    .text-pic-mode .content-area {
        padding-top: 0.5rem;
        padding-bottom: 0.2rem;
    }

    .modern-footer {
        height: 50px;
        padding: 0 1.5rem;
    }

    .stats-container > * {
        margin-left: 0.6rem;
        margin-right: 0.6rem;
    }

    .top-logo {
        height: 55px !important;
    }
}

@media screen and (max-width: 1024px) {

    /* Small PC / Whiteboard / Landscape Tablet */
    .modern-container {
        padding: 0.5rem 0.8rem 50px;
    }

    .hero-banner {
        padding: 0 1rem;
        height: 130px;
    }

    .hero-banner > * {
        margin-left: 0.4rem;
        margin-right: 0.4rem;
    }

    .banner-left,
    .banner-right {
        min-width: 100px !important;
    }

    .banner-left > *,
    .banner-right > * {
        margin-left: 0.5rem;
        margin-right: 0.5rem;
    }

    .hero-name {
        font-size: 1.2rem !important;
        font-size: clamp(1rem, 2.2vw, 1.5rem) !important;
    }

    .top-logo {
        height: 35px !important;
    }

    .clock-text {
        font-size: 1.6rem;
        margin-left: 0.8rem;
        padding-left: 0.5rem;
    }

    .hero-call-wrapper {
        padding: 0.5rem 1rem !important;
    }

    .hero-call-wrapper > * {
        margin-bottom: 0.2rem;
    }

    .hero-meta {
        padding: 0.2rem 0.6rem !important;
        margin-top: 0.2rem;
    }

    .hero-meta > * {
        margin-left: 0.075rem;
        margin-right: 0.075rem;
    }

    .hero-meta .meta-badge {
        font-size: 0.65rem;
    }

    .hero-meta .announce-time {
        font-size: 0.9rem;
    }

    .meta-badge {
        font-size: 0.6rem;
    }

    .meta-divider {
        width: 3px;
        height: 3px;
        margin: 0 0.15rem;
    }

    .list-name {
        font-size: 0.85rem;
    }

    .list-meta .meta-badge {
        font-size: 0.55rem;
    }

    .list-meta .announce-time {
        font-size: 0.8rem;
    }

    .list-meta .meta-divider {
        width: 3px;
        height: 3px;
        margin: 0 0.1rem;
    }

    .content-area {
        padding: 0.5rem 1rem;
    }

    .student-item {
        padding: 0.8rem 1.2rem;
        border-radius: 0.8rem;
    }

    .stats-container > * {
        margin-left: 0.3rem;
        margin-right: 0.3rem;
    }

    .stat-item {
        font-size: 0.7rem;
    }

    .footer-screen-info {
        display: none;
        /* More space for stats */
    }

    .modern-footer {
        height: 45px;
        padding: 0 1rem;
    }

    .text-pic-mode .content-area {
        padding-top: 0.5rem;
        padding-bottom: 0.3rem;
    }
}

/* More aggressive scaling for very narrow desktop/laptop windows */
@media screen and (max-width: 900px) {
    .modern-container {
        padding: 0.3rem 0.5rem 50px;
    }

    .hero-banner {
        padding: 0 0.5rem;
        height: 110px;
    }

    .hero-name {
        font-size: 1rem !important;
    }

    .hero-meta .meta-badge {
        font-size: 0.55rem;
    }

    .hero-meta .announce-time {
        font-size: 0.75rem;
    }

    .student-grid > * {
        margin-bottom: 0.6rem;
    }
}

/* RTL Support for Icons */
/* Only flip directional icons, not logos */
[dir="rtl"] .megaphone-icon,
[dir="rtl"] .nav-logout-btn {
    -webkit-transform: scaleX(-1);
    transform: scaleX(-1);
}

/* Ensure profile images and logos don't get flipped */
[dir="rtl"] .list-avatar {
    -webkit-transform: none;
    transform: none;
}