/* style.css - Eigenständiges Yabba-Design (Vollständige Final Version) */

/* --- Eigene Marke: Farben, Schrift & Formen --- */
:root {
    --yabba-primary: #4CAF50;
    --yabba-primary-hover: #388E3C;
    --yabba-secondary: #4A5568;
    --yabba-accent: #ECC94B;
    --yabba-success: #38A169;
    --yabba-background: #f2f4f7;
    --yabba-card-background: #FFFFFF;
    --yabba-primary-text: #2D3748;
    --yabba-secondary-text: #718096;
    --yabba-border: #EDF2F7;
    --yabba-input-background: #E2E8F0;
    --header-height: 60px;
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 20px;
    --font-family: 'Inter', sans-serif;

    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
}

/* --- Globale Regeln --- */
html { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }

body {
    font-family: var(--font-family);
    background-color: var(--yabba-background);
    color: var(--yabba-primary-text);
    line-height: 1.5;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Body-Fix nur für Live-Modus */
body.live-mode {
    height: 100%;
    overflow: hidden;
    position: fixed;
    width: 100%;
}

a { color: var(--yabba-primary); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--yabba-primary-hover); text-decoration: underline; }
img { max-width: 100%; display: block; height: auto; }

/* --- Layout --- */
.app-layout {
    display: flex;
    justify-content: center;
    width: 100%;
    flex: 1;
    padding-top: var(--header-height);
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.app-right-sidebar {
    width: 300px;
    flex-shrink: 0;
    position: sticky;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    padding: var(--spacing-lg);
    overflow-y: auto;
    background-color: var(--yabba-background);
}

.app-main-content {
    flex-grow: 1;
    max-width: 760px;
    min-width: 320px;
    padding: var(--spacing-lg) 0;
    margin: 0 auto;
}

/* --- Header --- */
.app-header {
    background-color: var(--yabba-card-background);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 var(--spacing-lg);
    height: var(--header-height);
    border-bottom: 1px solid var(--yabba-border);
    position: fixed;
    top: 0; width: 100%; z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

body.hide-header-on-auth .app-header { display: none; }
body.hide-header-on-auth { padding-top: 0; justify-content: center; align-items: center; min-height: 100vh; }

.app-header-center { display: flex; align-items: center; gap: var(--spacing-md); position: relative; }

.icon-wrapper, .profile-pic-small {
    width: 40px; height: 40px; border-radius: 50%;
    display: grid; place-items: center; flex-shrink: 0; overflow: hidden;
}

.icon-wrapper { background-color: var(--yabba-input-background); color: var(--yabba-secondary-text); cursor: pointer; }

/* --- Komponenten --- */
.card {
    background-color: var(--yabba-card-background);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    border: 1px solid var(--yabba-border);
}

.btn {
    border: none; border-radius: var(--border-radius-lg);
    font-weight: 700; padding: 0.8rem 1.8rem;
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    gap: var(--spacing-sm); white-space: nowrap; transition: 0.2s;
}

.btn-primary { background-color: var(--yabba-primary); color: white; }
.btn-primary:hover { background-color: var(--yabba-primary-hover); transform: translateY(-1px); }

/* --- Formulare --- */
.form-group input, textarea {
    width: 100%; padding: 0.8rem;
    border: 1px solid var(--yabba-border); border-radius: var(--border-radius-lg);
    background-color: var(--yabba-input-background); color: var(--yabba-primary-text);
    font-family: inherit; outline: none;
}

.form-group input:focus, textarea:focus { border-color: var(--yabba-primary); }

/* --- Benachrichtigungen (Modal Fix) --- */
.notification-modal-overlay {
    display: none; position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.5); z-index: 9999;
    align-items: center; justify-content: center;
}

.notification-modal-overlay.is-visible { display: flex !important; }

.notification-modal-content {
    background-color: var(--yabba-card-background);
    border-radius: var(--border-radius-md);
    width: 90%; max-width: 400px; max-height: 80vh;
    display: flex; flex-direction: column;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2); overflow: hidden;
}

.notification-item {
    display: flex; align-items: center; padding: var(--spacing-md);
    border-bottom: 1px solid var(--yabba-border); gap: 10px;
    color: var(--yabba-primary-text); transition: 0.2s;
}

.notification-badge {
    position: absolute; top: 5px; right: -10px;
    background-color: var(--yabba-success); color: white;
    font-size: 11px; font-weight: 700; padding: 2px 6px;
    border-radius: 12px; z-index: 2; border: 1px solid white;
}

/* --- LIVE STREAMING OVERLAY SYSTEM (KORRIGIERT) --- */
.live-wrapper {
    position: relative; width: 100%; height: 100dvh;
    background: #000; overflow: hidden; display: flex; flex-direction: column;
}

.video-background {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1; background-color: #000;
}

#liveVideoPlayer, #remoteVideo, #localVideoVorschau { 
    width: 100%; height: 100%; object-fit: cover; 
}

.ui-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 10; display: flex; flex-direction: column; pointer-events: none;
}

.viewer-count-badge, .viewer-count-display {
    position: absolute; top: 25px; left: 20px;
    background: rgba(0, 0, 0, 0.6); color: white;
    padding: 6px 12px; border-radius: 20px; font-weight: bold;
    font-size: 0.85rem; z-index: 1000; display: flex; align-items: center; gap: 6px;
}

/* Chat-Verlauf Logik - REPARIERT FÜR SICHTBARKEIT */
#liveChat, #liveChatBox {
    z-index: 1000 !important; 
    pointer-events: auto; 
    display: flex; 
    flex-direction: column; 
    justify-content: flex-end; 
    padding: 10px 20px; 
    flex: 1; 
    max-height: 250px; 
    overflow-y: auto; 
    gap: 10px;
    background: transparent;
    scrollbar-width: none; /* Firefox: Scrollbar verstecken */
}
#liveChat::-webkit-scrollbar, #liveChatBox::-webkit-scrollbar { display: none; } /* Chrome: Scrollbar verstecken */

/* Die Chat-Nachrichten Style */
.chat-msg {
    background: rgba(0, 0, 0, 0.5) !important;
    color: #ffffff !important;
    padding: 8px 15px; 
    border-radius: 18px; 
    font-size: 0.9rem;
    align-self: flex-start; 
    max-width: 85%; 
    word-wrap: break-word;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    border: 0.5px solid rgba(255,255,255,0.2);
    animation: fadeIn 0.3s ease;
}

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

.chat-msg strong { color: var(--yabba-primary); margin-right: 5px; }

/* Eingabebereich im Live-Modus */
.chat-input-area, .viewer-input-area {
    position: absolute; bottom: 80px; left: 0; width: 100%;
    z-index: 1001;
    padding: 15px 20px;
    display: flex; align-items: center; gap: 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    pointer-events: auto;
}

.chat-input-area input, .viewer-input-area input {
    flex: 1; background: rgba(255, 255, 255, 0.9) !important;
    border: none; border-radius: 25px; padding: 12px 20px; color: #000 !important; outline: none;
}

/* --- Footer Styling --- */
.app-footer {
    background-color: var(--yabba-background);
    border-top: 1px solid var(--yabba-border);
    padding: var(--spacing-xl) 0;
    text-align: center; width: 100%; margin-top: auto;
    display: flex; justify-content: center;
}

.footer-container {
    background-color: var(--yabba-card-background);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--yabba-border);
    max-width: 760px; width: 100%; padding: var(--spacing-lg);
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .app-main-content { padding: var(--spacing-lg) 0.75rem; }
    .app-right-sidebar { display: none; }
}

@media (max-width: 480px) {
    .app-header-center { gap: 0.5rem; padding: 0 0.75rem; }
}