/* CI Design Guidelines - Anima Morale */

/* Tenebras font for logo */
@font-face {
    font-family: 'Tenebras';
    src: url('/fonts/Tenebras-Regular.woff2') format('woff2'),
         url('/fonts/Tenebras-Regular.woff') format('woff'),
         url('/fonts/Tenebras-Regular.otf') format('opentype'),
         url('/fonts/Tenebras-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* Forma DJR Banner font */
@font-face {
    font-family: 'Forma DJR Banner';
    src: url('/fonts/FormaDJRBanner-Regular.woff2') format('woff2'),
         url('/fonts/FormaDJRBanner-Regular.woff') format('woff'),
         url('/fonts/FormaDJRBanner-Regular.otf') format('opentype'),
         url('/fonts/FormaDJRBanner-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Forma DJR Banner';
    src: url('/fonts/FormaDJRBanner-Bold.woff2') format('woff2'),
         url('/fonts/FormaDJRBanner-Bold.woff') format('woff'),
         url('/fonts/FormaDJRBanner-Bold.otf') format('opentype'),
         url('/fonts/FormaDJRBanner-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600&display=swap');

:root {
    /* CI Hauptfarben */
    --ci-primary: #4e6976;
    --ci-primary-alt: #567a7d;
    --ci-secondary: #909da4;
    --ci-secondary-alt: #a7a7bf;
    
    /* CI Highlightfarben */
    --ci-highlight-light: #dfd4ab;
    --ci-highlight-strong: #b55c34;
    --ci-highlight-secondary: #b27524;
    
    /* CI Schriftfarben */
    --ci-text-primary: #000000;
    --ci-text-alt: #d9bec1;
    
    /* Legacy colors (for gradual migration) */
    --bg: #04010a;
    --surface: rgba(33, 17, 8, 0.95);
    --accent: #facc6b;
    --accent-strong: #f59f0b;
    --text: #fff9f0;
    --muted: #eed7b7;
    
    /* CI Typography */
    --font-logo: 'Tenebras', 'Cinzel', serif; /* Fallback to Cinzel */
    --font-heading: 'Forma DJR Banner', 'Arial Black', 'Arial Bold', sans-serif; /* Fallback */
    --font-body: 'Forma DJR Banner', 'Arial', sans-serif; /* Fallback */
    
    font-family: var(--font-body);
}

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

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body {
    background-image: url('/background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--text);
    display: flex;
    flex-direction: column;
}

.app-shell {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
}

.top-bar {
    padding: 15px 40px;
    background: transparent;
    border-bottom: none;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    min-height: 60px;
}

.top-bar img.logo {
    margin: 0;
    height: clamp(4rem, 8vw, 6rem);
    width: auto;
    object-fit: contain;
    display: block;
}

.top-bar h1:not(.logo) {
    margin: 0;
    font-family: var(--font-heading);
    font-weight: 700; /* Bold */
    font-size: clamp(1.2rem, 2vw, 2.5rem);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ci-text-primary);
}

.main-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    min-height: 0;
}

.content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

/* When video is shown, arrange video and message side by side */
.main-panel:not(.no-video) .content-wrapper {
    flex-direction: row;
}

.countdown {
    margin: 0;
    padding: 6px 40px;
    background: linear-gradient(120deg, rgba(223, 212, 171, 0.2), rgba(223, 212, 171, 0.25));
    border-bottom: 2px solid rgba(223, 212, 171, 0.5);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
    width: 100%;
    backdrop-filter: blur(8px);
    flex-shrink: 0;
}

.countdown.hidden {
    display: none;
}

.countdown-label {
    font-size: clamp(0.6rem, 0.9vw, 0.8rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(0, 0, 0, 0.8);
    white-space: nowrap;
}

.countdown-time {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: clamp(0.9rem, 1.3vw, 1.2rem);
    font-weight: 600;
    color: rgba(0, 0, 0, 0.9);
    white-space: nowrap;
}

.countdown-track {
    position: relative;
    flex: 1;
    height: 4px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 999px;
    overflow: hidden;
    min-width: 100px;
}

.countdown-bar {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0%;
    background: linear-gradient(90deg, rgba(181, 92, 52, 0.9), rgba(178, 117, 36, 0.9));
    transition: width 0.3s ease;
}

.video-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    min-height: 0;
    position: relative;
    width: 100%;
}

/* When video is shown, video takes more space */
.main-panel:not(.no-video) .content-wrapper .video-section {
    flex: 2;
    width: auto;
}

.video-section.hidden {
    display: none;
}

.projection-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    display: block;
}

.projection-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.message-panel {
    padding: 20px 40px;
    background: transparent;
    border-top: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
    overflow-y: auto;
    min-height: 0;
    width: 100%;
}

/* When video is shown, message panel is on the side */
.main-panel:not(.no-video) .content-wrapper .message-panel {
    flex: 1;
    width: auto;
    border-top: none;
    border-left: none;
    max-height: none;
}

/* When video is hidden, message panel takes full space */
.main-panel.no-video .message-panel {
    flex: 1;
    max-height: none;
    justify-content: center;
    align-items: center;
    text-align: center;
}


.message-panel h2 {
    margin: 0;
    font-family: var(--font-heading);
    font-weight: 700; /* Bold */
    font-size: clamp(20pt, 3vw, 45pt);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ci-text-primary);
    line-height: 1.3;
    margin-bottom: 10px;
}

.message-panel p {
    margin: 0;
    font-family: var(--font-body);
    font-weight: 400; /* Regular */
    font-size: 14pt;
    line-height: 1.6;
    color: var(--ci-text-primary);
}

.message-panel .summary {
    font-family: var(--font-body);
    font-weight: 400; /* Regular */
    font-size: 14pt;
    line-height: 1.5;
    color: var(--ci-text-primary);
}

.message-panel .logline {
    font-family: var(--font-body);
    font-weight: 400; /* Regular */
    font-size: 14pt;
    color: var(--ci-highlight-strong);
}

.message-panel .episode-info {
    font-family: var(--font-body);
    font-weight: 400; /* Regular */
    font-size: 14pt;
    color: var(--ci-text-primary);
}

.message-panel .body-text {
    font-family: var(--font-body);
    font-weight: 400; /* Regular */
    font-size: 14pt;
    color: var(--ci-text-primary);
}

.message-panel .question {
    font-family: var(--font-heading);
    font-weight: 700; /* Bold */
    font-size: clamp(20pt, 3vw, 45pt);
    text-transform: uppercase;
    color: var(--ci-text-primary);
    margin-bottom: 10px;
}

.qrcode-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 40px 0;
    width: 100%;
}

.qrcode-image {
    max-width: 280px;
    width: 280px;
    height: 280px;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    display: block;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
}

.qrcode-container.qrcode-small .qrcode-image {
    max-width: 200px;
    width: 200px;
    height: 200px;
    padding: 12px;
}

.qrcode-container.qrcode-small {
    margin: 0;
    gap: 15px;
    flex-shrink: 0;
}

.qrcode-hint {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 18pt;
    color: var(--ci-text-primary);
    text-align: center;
    margin: 0;
}

.qrcode-container.qrcode-small .qrcode-hint {
    font-size: 14pt;
}

.avatar-info,
.scenario-info {
    font-size: clamp(0.85rem, 1.3vw, 1.1rem);
    color: var(--muted);
    margin-top: 8px;
}

.vote-options-info {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
}

.vote-option-tag {
    padding: 12px 24px;
    background: rgba(250, 204, 107, 0.2);
    border: 1px solid rgba(250, 204, 107, 0.4);
    border-radius: 8px;
    font-size: clamp(1.1rem, 2.2vw, 1.6rem);
    color: var(--accent);
}

.vote-and-qrcode-wrapper {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 60px;
    margin-top: 30px;
    width: 100%;
    padding: 0 40px;
}

.qrcode-container.qrcode-small {
    margin: 0;
    gap: 15px;
    flex-shrink: 0;
    align-self: flex-start;
}

.vote-options-projection {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    min-width: 0;
    justify-self: center;
}

.vote-option-projection {
    padding: 20px 40px;
    background: rgba(250, 204, 107, 0.1);
    backdrop-filter: blur(8px);
    border: 2px solid rgba(250, 204, 107, 0.6);
    border-radius: 12px;
    font-size: clamp(14pt, 2vw, 18pt);
    color: rgba(0, 0, 0, 0.8);
    font-weight: 600;
    text-align: center;
    min-width: 300px;
    max-width: 80%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.moderator-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 15px 30px;
    background: rgba(14, 165, 233, 0.9);
    border: 2px solid rgba(14, 165, 233, 1);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    max-width: 80%;
    z-index: 1000;
    font-size: clamp(0.9rem, 1.5vw, 1.3rem);
    color: #fff;
    text-align: center;
    font-style: italic;
    animation: slideUp 0.3s ease;
}

.moderator-panel.hidden {
    display: none;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) translateY(0);
    }
}

.pause-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 40px 80px;
    background: rgba(249, 115, 22, 0.95);
    border: 4px solid rgba(249, 115, 22, 1);
    border-radius: 16px;
    font-size: 4rem;
    font-weight: bold;
    color: #fff;
    text-align: center;
    z-index: 2000;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.7);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.05);
    }
}

.hidden {
    display: none !important;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .message-panel {
        padding: 30px 40px;
    }
    
    .moderator-panel {
        top: 50%;
        transform: translate(-50%, -50%);
        padding: 15px 30px;
        max-width: 90%;
    }
}

@media (max-width: 768px) {
    .top-bar {
        padding: 15px 20px;
    }
    
    .message-panel {
        padding: 20px 30px;
        max-height: 35vh;
    }
    
    .vote-and-qrcode-wrapper {
        flex-direction: column;
        gap: 30px;
    }
    
    .qrcode-container.qrcode-small .qrcode-image {
        max-width: 150px;
        width: 150px;
        height: 150px;
    }
    
    .moderator-panel {
        top: 50%;
        transform: translate(-50%, -50%);
        padding: 12px 20px;
        max-width: 95%;
    }
    
    .pause-indicator {
        padding: 30px 60px;
        font-size: 3rem;
    }
}
