/**
 * Wer wird Millionär - Hauptstyles
 * Design angelehnt an das Original
 */

/* === CSS Variables === */
:root {
    /* WWM Farben */
    --wwm-dark-blue: #001f5c;
    --wwm-blue: #003399;
    --wwm-light-blue: #0055cc;
    --wwm-accent: #00aaff;
    --wwm-gold: #ffd700;
    --wwm-orange: #ff8c00;
    --wwm-green: #00cc66;
    --wwm-red: #ff3333;
    --wwm-purple: #9933ff;
    
    /* Hintergründe */
    --bg-gradient: linear-gradient(135deg, #000428 0%, #001f5c 50%, #004e92 100%);
    --bg-dark: rgba(0, 20, 60, 0.9);
    --bg-card: rgba(0, 40, 100, 0.7);
    
    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #aaccff;
    --text-muted: #6699cc;
    
    /* Schatten */
    --shadow-glow: 0 0 20px rgba(0, 170, 255, 0.5);
    --shadow-gold: 0 0 20px rgba(255, 215, 0, 0.5);
    
    /* Animationen */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

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

html, body {
    height: 100%;
    font-family: 'Segoe UI', 'Roboto', 'Arial', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-primary);
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* === Animated Background === */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.bg-animation::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 30% 30%, rgba(0, 170, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(153, 51, 255, 0.1) 0%, transparent 50%);
    animation: bgPulse 15s ease-in-out infinite;
}

@keyframes bgPulse {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(10deg); }
}

/* Diamond Pattern */
.diamond-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0L60 30L30 60L0 30Z' fill='%23ffffff'/%3E%3C/svg%3E");
    background-size: 60px 60px;
}

/* === Typography === */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: 0.02em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

/* === Layout === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.fullscreen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

/* === Cards === */
.card {
    background: var(--bg-card);
    border: 1px solid rgba(0, 170, 255, 0.3);
    border-radius: 15px;
    padding: 25px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-glow);
}

.card-header {
    border-bottom: 1px solid rgba(0, 170, 255, 0.2);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--wwm-blue) 0%, var(--wwm-light-blue) 100%);
    color: white;
    border: 1px solid var(--wwm-accent);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-gold {
    background: linear-gradient(135deg, var(--wwm-orange) 0%, var(--wwm-gold) 100%);
    color: var(--wwm-dark-blue);
}

.btn-gold:hover {
    box-shadow: var(--shadow-gold);
}

.btn-success {
    background: linear-gradient(135deg, #00994d 0%, var(--wwm-green) 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #cc0000 0%, var(--wwm-red) 100%);
    color: white;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.2rem;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* === Answer Buttons (WWM Style) === */
.answer-btn {
    position: relative;
    background: linear-gradient(180deg, #003366 0%, #001a33 100%);
    border: 2px solid var(--wwm-accent);
    border-radius: 30px;
    padding: 15px 25px;
    margin: 10px 0;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    width: 100%;
    text-align: left;
}

.answer-btn::before {
    content: attr(data-letter);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    background: var(--wwm-accent);
    color: var(--wwm-dark-blue);
    border-radius: 50%;
    font-weight: bold;
    margin-right: 15px;
    flex-shrink: 0;
}

.answer-btn:hover:not(.disabled):not(.locked) {
    transform: scale(1.02);
    border-color: var(--wwm-gold);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.answer-btn.selected {
    background: linear-gradient(180deg, #ff8c00 0%, #cc6600 100%);
    border-color: var(--wwm-gold);
    animation: pulse 1s infinite;
}

.answer-btn.correct {
    background: linear-gradient(180deg, #00cc66 0%, #009944 100%);
    border-color: #00ff88;
    animation: correctFlash 0.5s ease;
}

.answer-btn.incorrect {
    background: linear-gradient(180deg, #ff3333 0%, #cc0000 100%);
    border-color: #ff6666;
}

.answer-btn.eliminated {
    opacity: 0.3;
    pointer-events: none;
}

.answer-btn.disabled {
    pointer-events: none;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 140, 0, 0.5); }
    50% { box-shadow: 0 0 25px rgba(255, 140, 0, 0.8); }
}

@keyframes correctFlash {
    0%, 50%, 100% { opacity: 1; }
    25%, 75% { opacity: 0.6; }
}

/* === Question Display === */
.question-box {
    background: linear-gradient(180deg, rgba(0, 30, 80, 0.9) 0%, rgba(0, 20, 60, 0.95) 100%);
    border: 3px solid var(--wwm-accent);
    border-radius: 20px;
    padding: 30px;
    margin: 20px 0;
    text-align: center;
    box-shadow: 
        0 0 30px rgba(0, 170, 255, 0.3),
        inset 0 0 50px rgba(0, 100, 200, 0.1);
}

.question-text {
    font-size: 1.4rem;
    line-height: 1.6;
    color: white;
}

/* === Prize Ladder === */
.prize-ladder {
    background: var(--bg-card);
    border-radius: 15px;
    padding: 15px;
    max-width: 300px;
}

.prize-level {
    display: flex;
    justify-content: space-between;
    padding: 8px 15px;
    margin: 3px 0;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.prize-level .level-number {
    color: var(--text-muted);
    width: 30px;
}

.prize-level .level-amount {
    font-weight: 600;
}

.prize-level.safe {
    background: rgba(255, 140, 0, 0.2);
    border: 1px solid var(--wwm-orange);
}

.prize-level.safe .level-amount {
    color: var(--wwm-gold);
}

.prize-level.current {
    background: linear-gradient(90deg, var(--wwm-blue) 0%, var(--wwm-light-blue) 100%);
    border: 2px solid var(--wwm-accent);
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

.prize-level.passed {
    opacity: 0.5;
}

/* === Joker Icons === */
.joker-container {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.joker {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--wwm-blue) 0%, var(--wwm-purple) 100%);
    border: 3px solid var(--wwm-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
}

.joker:hover:not(.used) {
    transform: scale(1.1);
    box-shadow: var(--shadow-glow);
}

.joker.used {
    opacity: 0.4;
    cursor: not-allowed;
}

.joker.used::after {
    content: '✕';
    position: absolute;
    font-size: 3rem;
    color: var(--wwm-red);
    font-weight: bold;
}

.joker svg, .joker img {
    width: 40px;
    height: 40px;
    fill: white;
}

/* === Timer === */
.timer {
    font-size: 3rem;
    font-weight: bold;
    color: var(--wwm-gold);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    text-align: center;
}

.timer.warning {
    color: var(--wwm-orange);
    animation: timerPulse 0.5s infinite;
}

.timer.critical {
    color: var(--wwm-red);
    animation: timerPulse 0.3s infinite;
}

@keyframes timerPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* === QR Code Display === */
.qr-container {
    text-align: center;
    padding: 20px;
}

.qr-code {
    background: white;
    padding: 15px;
    border-radius: 15px;
    display: inline-block;
    margin: 10px;
}

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

.qr-label {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* === Forms === */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 30, 80, 0.5);
    border: 2px solid rgba(0, 170, 255, 0.3);
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--wwm-accent);
    box-shadow: 0 0 10px rgba(0, 170, 255, 0.3);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* === Chat === */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 400px;
    background: var(--bg-card);
    border-radius: 15px;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.chat-message {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.chat-message.user {
    align-items: flex-end;
}

.chat-message.assistant {
    align-items: flex-start;
}

.chat-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 15px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.chat-message.user .chat-bubble {
    background: var(--wwm-blue);
    border-bottom-right-radius: 5px;
}

.chat-message.assistant .chat-bubble {
    background: rgba(0, 50, 100, 0.8);
    border-bottom-left-radius: 5px;
}

.chat-input-container {
    display: flex;
    padding: 10px;
    background: rgba(0, 20, 60, 0.5);
    gap: 10px;
}

.chat-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid rgba(0, 170, 255, 0.3);
    border-radius: 20px;
    background: rgba(0, 30, 80, 0.5);
    color: white;
}

/* === Audience Results (Bar Chart) === */
.audience-results {
    padding: 20px;
}

.audience-bar {
    display: flex;
    align-items: center;
    margin: 10px 0;
    gap: 10px;
}

.audience-bar-label {
    width: 30px;
    font-weight: bold;
    color: var(--wwm-accent);
}

.audience-bar-track {
    flex: 1;
    height: 40px;
    background: rgba(0, 30, 80, 0.5);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.audience-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--wwm-blue) 0%, var(--wwm-accent) 100%);
    transition: width 1s ease-out;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
}

.audience-bar-percent {
    font-weight: bold;
    font-size: 1.1rem;
}

/* === Selection Question (Tap Order) === */
.selection-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 500px;
    margin: 0 auto;
}

.selection-option {
    background: linear-gradient(180deg, #003366 0%, #001a33 100%);
    border: 2px solid var(--wwm-accent);
    border-radius: 10px;
    padding: 15px 20px;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 15px;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.selection-option:active {
    transform: scale(0.98);
}

.selection-option:hover {
    border-color: var(--wwm-gold);
}

.selection-option.selected {
    background: linear-gradient(180deg, #004d00 0%, #002200 100%);
    border-color: var(--wwm-green);
}

.selection-option .order-number {
    width: 35px;
    height: 35px;
    min-width: 35px;
    background: var(--wwm-accent);
    color: var(--wwm-dark-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.selection-option.selected .order-number {
    background: var(--wwm-gold);
    color: #000;
}

.selection-option .option-text {
    flex: 1;
}

.selection-order-display {
    text-align: center;
    font-size: 1.1rem;
    color: var(--wwm-gold);
}

.selection-order-display #orderText {
    font-weight: bold;
}

#submitSelection:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* === TV Display === */
.tv-display {
    height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 30px 40px;
    overflow: hidden;
    box-sizing: border-box;
    background: linear-gradient(135deg, rgba(0, 10, 30, 0.5) 0%, rgba(0, 30, 80, 0.3) 100%);
}

.tv-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(0, 170, 255, 0.3);
    flex-shrink: 0;
}

.tv-logo {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--wwm-gold);
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.4);
    letter-spacing: 2px;
}

.tv-candidate {
    font-size: 1.6rem;
    color: var(--text-secondary);
    background: rgba(0, 40, 100, 0.5);
    padding: 12px 30px;
    border-radius: 30px;
    border: 1px solid rgba(0, 170, 255, 0.4);
}

.tv-main {
    flex: 1;
    display: flex;
    gap: 40px;
    min-height: 0;
    overflow: hidden;
}

.tv-question-area {
    flex: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
}

.tv-question-area .question-box {
    flex-shrink: 0;
    padding: 35px 50px;
    margin-bottom: 25px;
    box-shadow: 0 0 40px rgba(0, 170, 255, 0.2), inset 0 0 60px rgba(0, 100, 200, 0.1);
}

.tv-question-area .question-text {
    font-size: 1.8rem;
    line-height: 1.5;
}

.tv-question-area .answers-grid {
    flex-shrink: 0;
}

.tv-question-area .answers-grid .answer-btn {
    padding: 22px 30px;
    padding-left: 75px;
    font-size: 1.3rem;
    border-radius: 40px;
}

.tv-question-area .answers-grid .answer-btn::before {
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
    left: 18px;
}

.tv-side-panel {
    flex: 0 0 350px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 0;
    overflow: hidden;
}

.tv-side-panel .card {
    flex-shrink: 0;
    padding: 20px 25px;
}

.tv-side-panel .card h3 {
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--wwm-gold);
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.tv-side-panel .joker-container {
    gap: 15px;
}

.tv-side-panel .joker {
    width: 65px;
    height: 65px;
    font-size: 1.1rem;
}

.tv-side-panel .prize-ladder {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 15px 20px;
}

.tv-side-panel .prize-ladder .prize-level {
    padding: 10px 15px;
    font-size: 1rem;
    margin-bottom: 3px;
}

.tv-side-panel .prize-ladder .prize-level.current {
    background: rgba(0, 170, 255, 0.25);
    border: 1px solid var(--wwm-accent);
    border-radius: 8px;
}

.tv-side-panel .prize-ladder .prize-level.safe {
    background: rgba(255, 215, 0, 0.1);
    border-radius: 8px;
}

.tv-side-panel .prize-ladder::-webkit-scrollbar {
    width: 6px;
}

.tv-side-panel .prize-ladder::-webkit-scrollbar-thumb {
    background: var(--wwm-accent);
    border-radius: 3px;
}

/* TV Audience Results */
.tv-question-area .audience-results {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 30px;
    height: 200px;
    padding: 20px;
}

.tv-question-area .audience-bar-container {
    text-align: center;
}

.tv-question-area .audience-bar {
    width: 60px;
    background: linear-gradient(0deg, var(--wwm-accent) 0%, var(--wwm-blue) 100%);
    border-radius: 8px 8px 0 0;
    margin-bottom: 10px;
    box-shadow: 0 0 20px rgba(0, 170, 255, 0.4);
}

.tv-question-area .audience-label {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--wwm-gold);
}

.tv-question-area .audience-percent {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 5px;
}

/* === Animations === */
.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in-left {
    animation: slideInLeft 0.5s ease;
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 1; transform: translateX(0); }
}

.scale-in {
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* === Responsive === */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
    
    .question-text {
        font-size: 1.1rem;
    }
    
    .answer-btn {
        padding: 12px 15px;
        font-size: 1rem;
    }
    
    .answer-btn::before {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }
    
    .joker {
        width: 55px;
        height: 55px;
    }
    
    .tv-main {
        flex-direction: column;
    }
    
    .prize-ladder {
        max-width: 100%;
    }
}

/* === Login Page === */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 400px;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo h1 {
    color: var(--wwm-gold);
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.login-logo .subtitle {
    color: var(--text-secondary);
    margin-top: 10px;
}

/* === Utility Classes === */
.text-center { text-align: center; }
.text-gold { color: var(--wwm-gold); }
.text-accent { color: var(--wwm-accent); }
.text-muted { color: var(--text-muted); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }

.hidden { display: none !important; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* === Loading Spinner === */
.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 170, 255, 0.2);
    border-top-color: var(--wwm-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === Modal === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border: 2px solid var(--wwm-accent);
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    transform: scale(0.9);
    transition: all var(--transition-normal);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-close:hover {
    color: white;
}
