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

:root {
    /* Colors - Brand */
    --color-primary-light: #0080FF;
    --color-primary-dark: #003D6E;
    --color-primary-darker: #0060CC;

    /* Colors - Semantic */
    --color-white: #FFFFFF;
    --color-text-secondary: #B0B8C4;
    --color-bg-light: #FFF0F0;
    --color-error: #D32F2F;
    --color-success: #34a853;
    --color-warning: #FF6B35;
    --color-divider: #E1E6ED;
    --color-black: #000000;

    /* Colors - Gradients */
    --color-gradient-start: #0080FF;
    --color-gradient-end: #003D6E;

    /* Typography */
    --font-family: 'DM Sans', sans-serif;
    --font-size-title: 5vw;
    --font-size-heading: 4vw;
    --font-size-large: 2.5vw;
    --font-size-base: 2vw;
    --font-size-small: 1.5vw;
    --font-size-xs: 0.8vw;
    --font-weight-regular: 400;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-black: 800;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 20px;
    --space-xl: 40px;
    --space-2xl: 60px;

    /* Sizing */
    --container-max-width: 1440px;
    --container-padding: 1rem;
    --header-padding-block: 20px;
    --header-gap: 40px;
    --logo-size: 80px;
    --logo-font-size: 48px;
    --card-padding: 20px;
    --grid-gap: 20px;
    --border-radius-sm: 8px;
    --border-radius-md: 15px;

    /* Animation */
    --transition-fast: 0.2s;
    --transition-normal: 0.6s;
    --transition-slow: 1s;
    --easing-ease-out: ease-out;
    --easing-ease-in-out: ease-in-out;

    /* Z-Index Scale */
    --z-behind: -1;
    --z-base: 1;
    --z-header: 100;
    --z-urgent-bar: 200;
    --z-dropdown: 300;
    --z-modal: 400;
    --z-tooltip: 500;

    /* Blur Effects */
    --blur-normal: 10px;
}

body {
    font-family: var(--font-family);
    background-color: var(--color-primary-dark);
    color: var(--color-white);
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

body.cursor-hidden {
    cursor: none;
}

.container {
    width: 100%;
    margin: 0 auto;
    padding: var(--container-padding);
}

@media (min-width: 1024px) {
    :root {
        --container-padding: 3rem;
    }
}

/* ─── Header ──────────────────────────────────────────────── */

header {
    position: relative;
    z-index: var(--z-header);
    flex-shrink: 0;
}

header .container {
    position: relative;
    padding-block: var(--header-padding-block);
    z-index: 1;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.header-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, var(--color-gradient-start) 0%, var(--color-gradient-end) 100%);
    backdrop-filter: blur(var(--blur-normal));
    mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 50%, rgba(0,0,0,0) 100%);
    z-index: var(--z-behind);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--header-gap);
}

.logo {
    width: var(--logo-size);
    height: var(--logo-size);
    background-color: var(--color-primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--logo-font-size);
    font-weight: var(--font-weight-black);
    color: var(--color-white);
    flex-shrink: 0;
}

.logo-svg {
    width: 100%;
    height: 100%;
}

.logo-fill {
    fill: #003d6e;
}

.logo-text {
    fill: #fff;
}

.slide-title {
    font-size: var(--font-size-title);
    font-weight: var(--font-weight-bold);
    color: var(--color-white);
    letter-spacing: -0.5px;
    white-space: nowrap;
}

.header-right {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.clock {
    font-size: var(--font-size-heading);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-xs);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0;
    line-height: 1;
    white-space: nowrap;
}

.clock-colon {
    animation: blink 1s infinite;
    display: inline-block;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.clock-ampm {
    font-size: 24px;
    margin-left: 8px;
    font-weight: 600;
}

.date {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-regular);
    color: var(--color-text-secondary);
    white-space: nowrap;
}

/* ─── Urgent announcement bar ─────────────────────────────── */

.urgent-bar {
    position: sticky;
    top: 0;
    background-color: var(--color-bg-light);
    color: var(--color-error);
    padding: 2vh 5vw;
    text-align: center;
    z-index: var(--z-urgent-bar);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    line-height: 1.4;
    animation: slideDown var(--transition-normal) var(--easing-ease-out) forwards;
    max-height: 10vh;
    overflow: hidden;
}

.urgent-bar.hidden {
    display: none;
    animation: none;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ─── Main ────────────────────────────────────────────────── */

main {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

main .container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.content {
    position: relative;
    width: 100%;
    height: 100%;
    padding-block: 10vh 8vh;
}

/* ─── Slides ──────────────────────────────────────────────── */

.slide {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 10vh 5vw 8vh 5vw;
    z-index: 1;
}

.slide.active {
    opacity: 1;
    animation: slideBlurFade 0.8s ease-out;
}

@keyframes slideBlurFade {
    0% {
        opacity: 0;
        filter: blur(5px);
    }
    100% {
        opacity: 1;
        filter: blur(0);
    }
}

@keyframes slideUpBlurFade {
    0% {
        opacity: 0;
        filter: blur(4px);
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0);
    }
}

/* ─── Person cards (Birthdays / Anniversaries / New Hires) ── */

.person-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(35vw, 1fr));
    gap: 1.5vh 3vw;
    width: 100%;
    max-width: 100%;
    align-items: start;
}

@media (max-width: 768px) {
    .person-grid {
        grid-template-columns: 1fr;
        max-height: 70vh;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .person-grid::-webkit-scrollbar {
        width: 0;
    }
}

.person-card {
    animation: slideUpBlurFade 0.8s ease-in-out both;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5vw;
    width: 100%;
    min-width: 0;
    padding: 1.5vh 2vw;
    background-color: rgba(0, 128, 255, 0.1);
    border-left: var(--border-radius-sm) solid var(--color-primary-light);
    transition: all var(--transition-fast);
}

.person-card:nth-child(2) { animation-delay: 0.08s; }
.person-card:nth-child(3) { animation-delay: 0.16s; }
.person-card:nth-child(4) { animation-delay: 0.24s; }
.person-card:nth-child(5) { animation-delay: 0.32s; }
.person-card:nth-child(6) { animation-delay: 0.4s; }
.person-card:nth-child(7) { animation-delay: 0.48s; }
.person-card:nth-child(8) { animation-delay: 0.56s; }
.person-card:nth-child(9) { animation-delay: 0.64s; }
.person-card:nth-child(10) { animation-delay: 0.72s; }

.person-card:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.1);
}

.headshot-placeholder {
    font-size: 3vw;
    flex-shrink: 0;
}

.headshot-placeholder img {
    display: none;
}

.person-card-content {
    display: flex;
    align-items: center;
    gap: 2vw;
    flex: 1;
}

.person-name {
    font-size: 2vw;
    font-weight: 700;
    margin-bottom: 0;
    white-space: nowrap;
}

.person-detail {
    font-size: var(--font-size-base);
    color: var(--color-primary-light);
    font-weight: var(--font-weight-semibold);
    white-space: nowrap;
}

.birthday-date {
    font-size: var(--font-size-large) !important;
}

/* ─── Leaderboard ─────────────────────────────────────────── */

.leaderboard {
    width: 100%;
    max-width: var(--container-max-width);
}

.row-item {
    align-items: center;
    padding: 1.5vh 2vw;
    background-color: rgba(0, 128, 255, 0.1);
    transition: all var(--transition-fast);
}

.row-item:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.1);
}

.leaderboard-row {
    animation: slideUpBlurFade 0.8s ease-in-out both;
    display: grid;
    grid-template-columns: 150px 1fr 400px;
    align-items: center;
    padding: 1.5vh 2vw;
    margin-bottom: 1vh;
    background-color: rgba(0, 128, 255, 0.1);
    border-left: var(--border-radius-sm) solid var(--color-primary-light);
    transition: all var(--transition-fast);
}

.leaderboard-row:nth-child(1) { animation-delay: 0.08s; }
.leaderboard-row:nth-child(2) { animation-delay: 0.16s; }
.leaderboard-row:nth-child(3) { animation-delay: 0.24s; }
.leaderboard-row:nth-child(4) { animation-delay: 0.32s; }
.leaderboard-row:nth-child(5) { animation-delay: 0.4s; }
.leaderboard-row:nth-child(6) { animation-delay: 0.48s; }
.leaderboard-row:nth-child(7) { animation-delay: 0.56s; }
.leaderboard-row:nth-child(8) { animation-delay: 0.64s; }
.leaderboard-row:nth-child(9) { animation-delay: 0.72s; }
.leaderboard-row:nth-child(10) { animation-delay: 0.8s; }

.leaderboard-row:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.1);
}

.leaderboard-row.rank-1 {
    background: linear-gradient(90deg, var(--color-success), rgba(52, 168, 83, 0.1));
    border-left-color: var(--color-white);
    transform: scale(1.05);
}

.rank-number {
    font-size: 4vw;
    font-weight: 800;
    color: #0080FF;
    white-space: nowrap;
}

.leaderboard-row.rank-1 .rank-number {
    color: #FFFFFF;
}

.rank-name {
    font-size: 3vw;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
}

.rank-value {
    font-size: 3vw;
    font-weight: 800;
    text-align: right;
    color: #0080FF;
    white-space: nowrap;
}

.leaderboard-row.rank-1 .rank-value {
    color: #34a853;
}

/* ─── Stats ───────────────────────────────────────────────── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 50px;
    width: 100%;
    max-width: 1600px;
}

.stat-card {
    background: linear-gradient(135deg, rgba(0, 128, 255, 0.2), rgba(0, 61, 110, 0.3));
    border: 2px solid #0080FF;
    border-radius: 30px;
    padding: 60px 40px;
    text-align: center;
}

.stat-label {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-secondary);
    margin-bottom: 30px;
    white-space: nowrap;
}

.stat-value {
    font-size: var(--font-size-title);
    font-weight: var(--font-weight-black);
    color: var(--color-primary-light);
    margin-bottom: 15px;
    white-space: nowrap;
}

.stat-unit {
    font-size: var(--font-size-small);
    font-weight: var(--font-weight-regular);
    color: var(--color-primary-light);
    white-space: nowrap;
}

/* ─── Announcements (generic slide) ──────────────────────── */

.announcement {
    max-width: 1400px;
    text-align: center;
}

.announcement-title {
    font-size: var(--font-size-title);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary-light);
    margin-bottom: 50px;
    line-height: 1.2;
}

.announcement-body {
    font-size: 3vw;
    font-weight: 400;
    line-height: 1.6;
    color: #E1E6ED;
}

/* ─── Announcement slide layout ───────────────────────────── */

.announcement-slide {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 4vh 5vw;
    gap: 6vw;
}

.announcement-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    gap: 3vh;
}

.announcement-heading {
    font-size: 4vw;
    font-weight: 800;
    color: #0080FF;
    letter-spacing: 0.5px;
}

.announcement-description {
    font-size: 2.2vw;
    color: #FFFFFF;
    line-height: 1.4;
    font-weight: 400;
}

.announcement-cta-text {
    font-size: 2.2vw;
    color: #0080FF;
    font-weight: 700;
}

.announcement-qr-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2vh;
}

.announcement-qr {
    background: white;
    padding: 30px;
    border-radius: 15px;
    width: 300px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.announcement-qr-label {
    font-size: 1.8vw;
    color: #FFFFFF;
    font-weight: 700;
    letter-spacing: 1px;
}

/* ─── Footer ──────────────────────────────────────────────── */

footer {
    flex-shrink: 0;
    position: relative;
    z-index: var(--z-header);
}

footer .container {
    position: relative;
    padding-block: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

/* ─── Progress bar ────────────────────────────────────────── */

.progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background-color: var(--color-primary-light);
    transition: width 0.1s linear;
}

/* ─── Empty state ─────────────────────────────────────────── */

.empty-message {
    font-size: 52px;
    color: var(--color-text-secondary);
}

/* ─── Controls ────────────────────────────────────────────── */

.controls-container {
    width: 100%;
    z-index: var(--z-tooltip);
    opacity: 0.25;
    position: relative;
    transition: opacity 0.3s ease;
    padding: 30px 20px;
    display: flex;
    justify-content: center;
}

.controls-container:hover {
    opacity: 1;
}

.controls-container.faded {
    opacity: 0;
    pointer-events: none;
}

.controls-container.faded:hover {
    opacity: 1;
    pointer-events: auto;
}

.controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3vw;
    backdrop-filter: blur(3px);
    border-radius: 50px;
}

/* ─── Nav / pause buttons ─────────────────────────────────── */

.nav-button,
.pause-button {
    width: 60px;
    height: 60px;
    background-color: #0080FF;
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: background-color 0.3s;
    padding: 0;
}

.nav-button:hover,
.pause-button:hover {
    background-color: #0060CC;
}

.nav-button svg,
.pause-button svg {
    width: 28px;
    height: 28px;
}

.pause-button.playing {
    background-color: #0080FF;
}

.pause-button.paused {
    background-color: #FF6B35;
}

.play-icon.hidden {
    display: none;
}

.pause-icon.hidden {
    display: none;
}

/* ─── Skeleton loading ────────────────────────────────────── */

.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.1) 100%);
    background-size: 200% 100%;
    animation: skeleton-load 3s ease-in-out infinite;
    border-radius: 4px;
}

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

.skeleton-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10vh 5vw;
    gap: 5vw;
}

.skeleton-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
}

.skeleton-title {
    width: 30vw;
    height: 5vw;
}

.skeleton-clock {
    text-align: right;
}

.skeleton-clock-time {
    width: 20vw;
    height: 4vw;
    margin-bottom: 1vh;
}

.skeleton-clock-date {
    width: 20vw;
    height: 2vw;
}

.skeleton-content {
    display: flex;
    flex-direction: column;
    gap: 1.5vh;
    padding: 0 5vw;
    width: 100%;
}

.skeleton-row {
    height: 6vh;
}

.skeleton-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3vw;
    padding: 3vh 5vw;
    margin-top: auto;
}

.skeleton-nav-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
}

/* ─── Loading screen ──────────────────────────────────────── */

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #003D6E;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-screen-body {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* ─── Content fade-in on load ─────────────────────────────── */

header .container,
main .container,
footer .container {
    opacity: 0;
    transition: opacity 0.5s ease-out;
}

header .container.loaded,
main .container.loaded,
footer .container.loaded {
    opacity: 1;
}

/* ─── Slide counter & last-updated ───────────────────────── */

.slide-counter {
    font-size: 0.8vw;
    color: #B0B8C4;
    position: fixed;
    bottom: 10px;
    left: 10px;
    z-index: 500;
}

.last-updated {
    font-size: 0.8vw;
    color: #B0B8C4;
    position: fixed;
    bottom: 10px;
    right: 10px;
    z-index: 500;
}
