/* ============================================================
   WIVENT SOCIALWALL — Projector Play Screen
   Two-Column Layout · Sidebar · Grid + Slideshow
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
    --bg: #050508;
    --bg-subtle: #0a0a10;
    --sidebar-bg: rgba(8, 8, 14, 0.92);
    --surface: rgba(255, 255, 255, 0.035);
    --surface-hover: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.06);
    --accent: #00f3ff;
    --accent-soft: rgba(0, 243, 255, 0.08);
    --accent-glow: rgba(0, 243, 255, 0.2);
    --magenta: #bd00ff;
    --error: #ff4466;
    --success: #00e676;
    --live-red: #ff3b3b;
    --text: #f0f0f0;
    --text-dim: #777;
    --text-muted: #3a3a3a;
    --radius: 14px;
    --radius-sm: 10px;
    --sidebar-width: 22%;
    --font-main: 'Outfit', system-ui, sans-serif;
    --font-mono: 'Fira Code', monospace;
    --transition: .3s cubic-bezier(.4, 0, .2, 1);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: var(--font-main);
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
}

.hidden {
    display: none !important;
}

/* ============================================================
   PLAY APP — Full viewport
   ============================================================ */
.play-app {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================================
   STATE SCREENS (Loading / Error)
   ============================================================ */
.state-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 1rem;
    padding: 3rem;
}

.state-icon {
    font-size: 3.5rem;
    color: var(--accent);
    opacity: .6;
}

.state-icon--error {
    color: var(--error);
}

.state-title {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.state-sub {
    font-size: 1rem;
    color: var(--text-dim);
    max-width: 400px;
}

/* ============================================================
   LIVE LAYOUT — Two-Column (Main + Sidebar)
   ============================================================ */
.live-layout {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* ── Main Area (Left) ── */
.main-area {
    flex: 1;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;

    /* Subtle ambient glow */
    background-image:
        radial-gradient(ellipse at 30% 20%, rgba(0, 243, 255, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(189, 0, 255, 0.02) 0%, transparent 50%);
}

/* ── Sidebar (Right) ── */
.sidebar {
    width: var(--sidebar-width);
    min-width: 220px;
    max-width: 320px;
    height: 100vh;
    background: var(--sidebar-bg);
    border-left: 1px solid var(--glass-border);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-section {
    padding: 1.2rem 1.3rem;
    border-bottom: 1px solid var(--glass-border);
}

/* ── Sidebar: Event Header ── */
.sidebar-header {
    display: flex;
    flex-direction: column;
    gap: .7rem;
    padding-top: 1.5rem;
}

.live-badge {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: .4rem;
    padding: .3rem .7rem;
    background: rgba(255, 59, 59, 0.12);
    border: 1px solid rgba(255, 59, 59, 0.25);
    border-radius: 6px;
    font-size: .6rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--live-red);
}

.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--live-red);
    animation: pulse-dot 1.5s ease-in-out infinite;
    box-shadow: 0 0 6px var(--live-red);
}

@keyframes pulse-dot {

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

    50% {
        opacity: .4;
        transform: scale(.75);
    }
}

.sidebar-event-name {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: .3px;
    line-height: 1.3;
    background: linear-gradient(90deg, var(--accent), var(--magenta));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Sidebar: Controls ── */
.sidebar-controls {
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.control-label {
    font-size: .6rem;
    font-weight: 600;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: var(--text-dim);
}

.btn-mode {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    width: 100%;
    padding: .7rem;
    font-family: var(--font-main);
    font-size: .78rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--surface);
    border: 1px solid rgba(0, 243, 255, 0.15);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition),
        box-shadow var(--transition);
}

.btn-mode:hover {
    background: var(--accent-soft);
    border-color: rgba(0, 243, 255, 0.3);
    box-shadow: 0 0 12px rgba(0, 243, 255, 0.08);
}

.btn-mode.active {
    color: var(--bg);
    background: linear-gradient(135deg, var(--accent), #00c9d4);
    border-color: transparent;
    box-shadow: 0 4px 20px rgba(0, 243, 255, 0.25);
}

.select-speed {
    width: 100%;
    padding: .55rem .7rem;
    font-family: var(--font-mono);
    font-size: .72rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    outline: none;
    cursor: pointer;
    transition: border-color var(--transition);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23777'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .7rem center;
}

.select-speed option {
    background: #111;
    color: var(--text);
}

.select-speed:focus {
    border-color: rgba(0, 243, 255, 0.4);
}

/* ── Sidebar: QR Widget ── */
.sidebar-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .6rem;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

.qr-widget {
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-frame {
    padding: 6px;
    background: rgba(255, 255, 255, 0.93);
    border-radius: 10px;
    line-height: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.qr-code {
    display: block;
    width: 140px;
    height: 140px;
    border-radius: 6px;
}

.qr-cta {
    font-size: .65rem;
    font-weight: 600;
    letter-spacing: .5px;
    color: var(--accent);
    opacity: .75;
    text-align: center;
}

/* ── Sidebar: Counter ── */
.sidebar-counter {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-family: var(--font-mono);
    font-size: .72rem;
    color: var(--text-dim);
}

.sidebar-counter i {
    color: var(--accent);
    opacity: .5;
}

/* ── Sidebar: Branding ── */
.sidebar-brand {
    margin-top: auto;
    padding: 1rem 1.3rem;
    text-align: center;
    border-top: 1px solid var(--glass-border);
}

.sidebar-brand p {
    font-size: .55rem;
    color: var(--text-muted);
    letter-spacing: .5px;
}

.sidebar-brand strong {
    color: var(--text-dim);
}

/* ============================================================
   PHOTO WALL — Grid View
   ============================================================ */
.photo-wall {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    padding: 1.2rem;
    align-content: start;
    min-height: 100%;
}

/* ── Photo Card ── */
.photo-card {
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    overflow: hidden;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform var(--transition), box-shadow var(--transition);
    animation: card-enter .5s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes card-enter {
    from {
        opacity: 0;
        transform: scale(.88) translateY(15px);
    }

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

.photo-card.new-arrival {
    animation: card-enter .5s cubic-bezier(.22, 1, .36, 1) both,
        glow-pulse 2s ease-out .5s both;
}

@keyframes glow-pulse {
    0% {
        box-shadow: 0 0 20px rgba(0, 243, 255, 0.3), 0 0 40px rgba(0, 243, 255, 0.1);
    }

    100% {
        box-shadow: none;
    }
}

.photo-card:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.card-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    background: var(--bg-subtle);
}

.card-caption {
    padding: .6rem .8rem;
    display: flex;
    align-items: center;
    gap: .4rem;
    border-top: 1px solid var(--glass-border);
}

.card-caption-icon {
    font-size: .65rem;
    color: var(--accent);
    opacity: .6;
}

.card-guest-name {
    font-size: .72rem;
    font-weight: 500;
    color: var(--text);
    letter-spacing: .3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-time {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: .5rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ============================================================
   SLIDESHOW VIEW — Single photo, full area
   ============================================================ */
.slideshow-view {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    background: var(--bg);
}

.slide-img {
    max-width: 90%;
    max-height: 78vh;
    object-fit: contain;
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slide-in .6s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes slide-in {
    from {
        opacity: 0;
        transform: scale(.92);
    }

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

/* New photo interruption — extra emphasis */
.slide-img.interrupt {
    animation: interrupt-in .7s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes interrupt-in {
    0% {
        opacity: 0;
        transform: scale(.85);
        filter: brightness(2);
    }

    40% {
        filter: brightness(1.3);
    }

    100% {
        opacity: 1;
        transform: scale(1);
        filter: brightness(1);
    }
}

.slide-caption {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-top: 1.5rem;
    padding: .8rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: slide-in .5s .2s cubic-bezier(.22, 1, .36, 1) both;
}

.slide-icon {
    font-size: 1rem;
}

.slide-name {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: .3px;
    background: linear-gradient(90deg, var(--accent), var(--magenta));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translate(-50%, -50%);
    }

    50% {
        transform: translate(-50%, calc(-50% - 10px));
    }
}

.empty-icon {
    font-size: 3.5rem;
    color: var(--accent);
    opacity: .15;
    margin-bottom: .8rem;
}

.empty-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: .3rem;
}

.empty-sub {
    font-size: .8rem;
    color: var(--text-muted);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (min-width: 1600px) {
    .photo-wall {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 1.3rem;
        padding: 1.5rem;
    }

    .sidebar-event-name {
        font-size: 1.3rem;
    }

    .qr-code {
        width: 160px;
        height: 160px;
    }

    .slide-name {
        font-size: 1.4rem;
    }
}

@media (min-width: 2400px) {
    .photo-wall {
        grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
        gap: 1.8rem;
        padding: 2rem;
    }

    .sidebar-event-name {
        font-size: 1.6rem;
    }

    .qr-code {
        width: 200px;
        height: 200px;
    }

    .slide-name {
        font-size: 1.8rem;
    }

    .state-title {
        font-size: 3rem;
    }
}