/* Alapvető beállítások */
:root {
    --bg-color: #111111;
    --panel-bg: #131313;
    --border-color: rgba(255, 255, 255, 0.1);
    --accent-blue: #ff0000;
    --text-color: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

@font-face {
    font-family: 'StreamZoneLogoFont';
    src: url('../assets/fonts/Braaap_S2.otf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

body {
    background: radial-gradient(circle at 50% 50%, #131313 0%, var(--bg-color) 80%);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
}

/* Navigáció */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: rgb(15, 15, 15);
    backdrop-filter: blur(5px);
    border-bottom: 1px solid #ff0000;
    box-shadow: 0 4px 20px rgba(255, 0, 0, 0.4);
    z-index: 9999; /* Legfelül marad! */
    position: relative;
}

.logo { 
    font-size: 1.8rem;
    font-weight: bold; 
    color: #ff0000;
    font-family: 'StreamZoneLogoFont', sans-serif;
    letter-spacing: 1px;
    margin-left: 15px;
}

.desktop-nav {
    display: flex;
    align-items: center;
}

.desktop-nav a { color: #ccc; text-decoration: none; margin: 0 15px; font-size: 1rem; transition: 0.3s; }
.desktop-nav a:hover, .desktop-nav a.active { color: var(--accent-blue); }

.hamburger { display: none; font-size: 1.5rem; cursor: pointer; }

/* Fő elrendezés */
.main-container {
    display: flex;
    flex: 1;
    padding: 20px;
    gap: 20px;
    height: calc(100vh - 200px);
    /* Ez akadályozza meg az egész oldal elnyúlását */
    min-height: 0;
    overflow: hidden; 
}

/* Stream Szekció */
.stream-section {
    flex: 3;
    position: relative;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #ff0000;
    box-shadow: 0 4px 6px rgba(255, 0, 0, 0.4);
    z-index: 50;
}

.stream-wrapper {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    display: grid;
    gap: 2px;
    background: #222;
}

.stream-wrapper.grid-1 { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.stream-wrapper.grid-2 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; }
.stream-wrapper.grid-3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.stream-wrapper.grid-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }

.stream-container { background: #111; position: relative; width: 100%; height: 100%;  }

.placeholder-stream {
    display: flex; align-items: center; justify-content: center;
    height: 100%; font-size: 1.5rem; color: #555; font-style: italic;
}

/* Info gomb és kártya */
.info-btn {
    position: absolute; top: 15px; left: 15px; width: 30px; height: 30px;
    border-radius: 50%; background: rgba(0,0,0,0.6); color: white;
    border: 1px solid var(--border-color); cursor: pointer; z-index: 10; transition: 0.3s;
}
.info-btn:hover { background: var(--accent-blue); }

.info-card {
    position: absolute; top: 55px; left: 15px; background: var(--panel-bg);
    backdrop-filter: blur(10px); border: 1px solid var(--border-color);
    padding: 10px; border-radius: 8px; display: flex; align-items: center;
    gap: 10px; opacity: 0; pointer-events: none; transition: 0.3s ease; z-index: 10;
}
.info-card.show { opacity: 1; pointer-events: auto; }
.info-card img { width: 30px; height: 30px; border-radius: 5px; }

/* JAVÍTOTT Offline Képernyő */
.offline-screen {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: #000; display: flex; flex-direction: column;
    align-items: center; justify-content: center; z-index: 5; text-align: center;
    overflow: hidden;
}
.offline-screen img {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover; z-index: 1; opacity: 0.5; margin: 0; border-radius: 0; box-shadow: none;
}
.offline-screen h2, .offline-screen p { position: relative; z-index: 2; text-shadow: 0 4px 10px rgba(0, 0, 0, 0.9); }
.offline-screen h2 { color: var(--text-color); font-size: 1.8rem; margin-bottom: 10px; margin-top: -160px; text-shadow: 0 0 10px rgba(0, 0, 0, 1), 0 0 20px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 0, 0, 0.6), 0 4px 10px rgba(0, 0, 0, 0.9);}
.offline-screen p { color: #ccc; font-size: 1.2rem; }

/* Chat és Vezérlő Szekció */
.sidebar-section { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    gap: 15px; 
    min-width: 300px;
    min-height: 0; /* Ez meggátolja az oldalsáv túlzott elnyúlását */
}

.top-icons {
    display: flex; justify-content: space-between; padding: 10px;
    background: var(--panel-bg); border-radius: 10px; border: 1px solid #ff0000;
    box-shadow: 0 4px 6px rgba(255, 0, 0, 0.4);
    z-index: 50;
    position: relative;
}

/* Profilképek */
.profile-icon {
    width: 45px; height: 45px; border-radius: 50%; border: 3px solid transparent;
    cursor: pointer; transition: all 0.3s ease; object-fit: cover; 
}
.profile-icon.online { border-color: #00ff00; box-shadow: 0 0 10px rgba(0, 255, 0, 0.5); }
.profile-icon.offline { border-color: #ff0000; opacity: 0.5; filter: grayscale(80%); }

.multi-stream-btn {
    width: 45px; height: 45px; border-radius: 50%; border: 2px solid transparent;
    cursor: pointer; transition: 0.3s; background: #2a3142; color: white;
    font-size: 1.2rem; display: flex; align-items: center; justify-content: center;
}
.multi-stream-btn:hover { background: var(--accent-blue); }

.chat-container {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--panel-bg);
    border-radius: 10px;
    border: 1px solid #ff0000;
    box-shadow: 0 4px 6px rgba(255, 0, 0, 0.4);
    z-index: 50;
    position: relative;
    overflow: hidden;
}

.chat-messages {
    flex: 1; /* Kitölti a chat doboz belsejét */
    min-height: 0;
    padding: 15px;
    overflow-y: auto; /* Ez teszi görgethetővé a belső tartalmat */
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: flex-start; 
}

/* Szebb görgetősáv a chatnek */
.chat-messages::-webkit-scrollbar {
    width: 5px;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: #ff0000;
    border-radius: 10px;
}
.chat-messages p { word-wrap: break-word; }
.chat-messages img.chat-avatar { width: 20px; height: 20px; border-radius: 50%; vertical-align: middle; margin-right: 5px; }

.chat-input-area { display: flex; padding: 10px; background: rgba(0,0,0,0.3); border-top: 1px solid var(--border-color); }
.chat-input-area input { flex: 1; background: transparent; border: none; color: white; padding: 8px; outline: none; }
.chat-input-area button { background: transparent; border: none; color: white; cursor: pointer; font-size: 1.2rem; padding: 0 10px; transition: color 0.3s; }

/* Kártya Lapozó */
.carousel-section {
    display: flex; 
    align-items: center; 
    padding: 20px; 
    gap: 15px;
    background: rgb(15, 15, 15);
    border-top: 1px solid #ff0000; 
    box-shadow: 0 -4px 20px rgba(255, 0, 0, 0.4);
    position: relative;
    z-index: 50;
}
.carousel-track-container {
    flex: 1; overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}
.carousel-track {
    display: flex; gap: 15px; width: max-content;
    animation: scrollCards 100s linear infinite;
    padding-top: 25px; 
    margin-top: -15px;
}

.game-card {
    min-width: 200px;
    height: 112px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    border: 2px solid transparent; 
    transition: all 0.3s ease; 
    cursor: pointer;
    background: #2a3142;
    flex-shrink: 0; 
}

.game-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.game-card .game-name {
    position: absolute;
    bottom: 0; left: 0; width: 100%;
    padding: 10px 5px 5px 5px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: bold;
    text-align: center;
    pointer-events: none; 
}

.game-card:hover {
    transform: translateY(-10px); 
    border-color: #ff0000; 
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5); 
    z-index: 10;
}

.carousel-btn { background: transparent; border: none; color: white; font-size: 1.5rem; cursor: pointer; }

@keyframes scrollCards {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-50% - 7.5px)); }
}

/* Modals */
.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; opacity: 0; pointer-events: none; transition: 0.3s; z-index: 10000;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal-content { background: #1e2532; padding: 30px; border-radius: 10px; border: 1px solid var(--accent-blue); width: 350px; display: flex; flex-direction: column; }
.streamer-select-list { display: flex; flex-direction: column; gap: 10px; margin: 20px 0; }
.modal-actions { display: flex; justify-content: space-between; gap: 10px;}
.btn-primary, .btn-secondary { padding: 8px 15px; border: none; border-radius: 5px; cursor: pointer; font-weight: bold; }
.btn-primary { background: var(--accent-blue); color: black; }
.btn-secondary { background: #555; color: white; }

.nav-login-btn {
    background-color: transparent; border: 1px solid var(--accent-blue); color: var(--accent-blue);
    padding: 8px 15px; border-radius: 5px; font-weight: bold; cursor: pointer; transition: 0.3s ease; margin-left: 15px;
}
.nav-login-btn:hover { background-color: var(--accent-blue); color: #000; }

.nav-user-info { display: flex; align-items: center; gap: 10px; margin-left: 15px; }
.nav-user-avatar { width: 35px; height: 35px; border-radius: 50%; border: 2px solid var(--accent-blue); object-fit: cover;}
.nav-user-name { color: var(--text-color); font-weight: bold; font-size: 0.9rem; }
.nav-logout-btn { background: transparent; border: none; color: #ff4c4c; cursor: pointer; font-size: 1.2rem; padding: 5px; transition: 0.3s; }
.nav-logout-btn:hover { color: #ff0000; }

#chat-input:disabled { cursor: not-allowed; opacity: 0.5; }
#chat-send-btn:disabled { cursor: not-allowed; opacity: 0.5; color: #555; }
.google-signin-container { display: flex; justify-content: center; align-items: center; margin-top: 10px; }

/* --- STREAM VEZÉRLŐK (MINDEN NÉZETBEN LÁTSZANAK) ÉS OVERLAY CHAT --- */
.mobile-controls {
    display: flex;
    position: absolute;
    bottom: 15px;
    right: 15px;
    gap: 10px;
    z-index: 60;
}
.mobile-controls button {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #ff0000;
    color: white;
    width: 40px; height: 40px;
    border-radius: 5px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: 0.3s;
}
.mobile-controls button:hover {
    background: #ff0000;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

.sidebar-section.mobile-chat-active {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(17, 17, 17, 0.98); 
    z-index: 2000;
    padding: 20px;
    display: flex !important;
    flex-direction: column;
}
.sidebar-section.mobile-chat-active::before {
    content: "✕ Chat Bezárása";
    color: #ff0000; font-weight: bold; font-size: 1.2rem;
    text-align: right; padding-bottom: 10px; cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 10px;
}

/* =========================================================
   MOBIL ÉS FEKVŐ NÉZET (TABLET / LANDSCAPE PHONE)
   ========================================================= */
@media (max-width: 992px) {
    .main-container { flex-direction: column; height: auto; min-height: unset; padding: 10px; gap: 10px; }
    
    .stream-section { height: 50vh; min-height: 250px; border: none; box-shadow: none; border-radius: 0; }
    .stream-wrapper { border-radius: 0; }

    .sidebar-section { width: 100%; }
    
    .hamburger { display: block; z-index: 10000; position: relative; color: #ff0000; }
    
    .desktop-nav {
        display: flex !important;
        position: fixed;
        top: 0;
        left: auto; 
        right: -100%; 
        width: 250px; 
        height: 100vh;
        background: #111111;
        border-left: 1px solid #ff0000; 
        border-right: none;
        box-shadow: -4px 0 20px rgba(255, 0, 0, 0.2); 
        flex-direction: column;
        align-items: flex-start;
        padding: 80px 20px 20px 20px;
        transition: right 0.3s ease; 
        z-index: 9999;
    }
    .desktop-nav.mobile-active { right: 0; }
    
    .desktop-nav a, .desktop-nav .nav-login-btn, .desktop-nav .nav-user-info { margin: 15px 0; width: 100%; text-align: left;}

    .game-card { min-width: 140px; height: 78px; }
}

.stream-section.fullscreen-mode {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 999999 !important;
    border-radius: 0 !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    background: #000 !important;
}
.stream-section.fullscreen-mode .stream-wrapper {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0 !important;
}

/* Fogaskerék gomb stílusa */
.nav-settings-btn {
    background: transparent;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 1.1rem;
    transition: 0.3s;
    margin-left: 10px;
}
.nav-settings-btn:hover { color: #ff0000; transform: rotate(90deg); }

/* Névváltó input stílusa */
#new-username-input {
    width: 100%;
    padding: 10px;
    margin: 15px 0;
    background: #111;
    border: 1px solid #ff0000;
    color: white;
    border-radius: 5px;
}

/* ==========================================
   CHAT RANGOK, JELVÉNYEK ÉS MENÜK
   ========================================== */

/* Rangok színei */
.role-streamer { color: #ff4c4c !important; font-weight: bold; text-shadow: 0 0 5px rgba(255, 76, 76, 0.5); }
.role-mod { color: #00a8ff !important; font-weight: bold; }
.role-vip { color: #ffd700 !important; font-weight: bold; }
.role-user { color: #ffffff !important; font-weight: bold; }

/* Jelvények (Korona, Pajzs) */
.chat-badge { margin-right: 5px; font-size: 0.9rem; }
.badge-mod { color: #00a8ff; }
.badge-vip { color: #ffd700; }

/* Mozgó / Egyedi Emojik a chatben */
.chat-emoji { height: 24px; vertical-align: middle; display: inline-block; }

/* Emoji Gomb */
#emoji-btn { background: transparent; border: none; color: #ff0000; font-size: 1.4rem; cursor: pointer; padding-right: 10px; transition: 0.3s; }
#emoji-btn:hover { color: #ffd700; transform: scale(1.1); }

/* Emoji Választó Ablak */
.emoji-picker { 
    position: absolute; 
    bottom: 60px; /* Pontosan az input sáv fölé emeli! */
    left: 10px; /* A chat doboz bal széléhez igazítja */
    width: 250px; 
    background: #1e2532; 
    border: 1px solid #ff0000; 
    border-radius: 10px; 
    padding: 10px; 
    box-shadow: 0 -4px 15px rgba(0,0,0,0.8); 
    z-index: 1000; 
}
.emoji-list { display: flex; flex-wrap: wrap; gap: 10px; max-height: 150px; overflow-y: auto; }
.emoji-item { font-size: 1.5rem; cursor: pointer; transition: 0.2s; }
.emoji-item:hover { transform: scale(1.3); }
.emoji-item img { height: 28px; width: 28px; } /* Egyedi képek mérete a listában */

/* Moderátori Kontextus Menü */
.context-menu { position: absolute; background: #111; border: 1px solid #444; border-radius: 5px; box-shadow: 0 5px 15px rgba(0,0,0,0.9); width: 220px; z-index: 9999; overflow: hidden; }
.context-header { background: #222; padding: 10px; text-align: center; color: #fff; border-bottom: 1px solid #ff0000; font-size: 0.9rem; }
.context-btn { display: block; width: 100%; padding: 10px; text-align: left; background: none; border: none; color: #ccc; cursor: pointer; transition: 0.2s; font-size: 0.9rem; }
.context-btn:hover { background: #333; color: #fff; }
.context-btn.danger { color: #ff4c4c; }
.context-btn.danger:hover { background: #ff4c4c; color: #000; }
.context-btn.warning { color: #ffaa00; }
.context-btn.warning:hover { background: #ffaa00; color: #000; }
.context-divider { height: 1px; background: #444; margin: 2px 0; }

.chat-username { cursor: pointer; transition: 0.2s; }
.chat-username:hover { text-decoration: underline; }