/* --- ALAP BEÁLLÍTÁSOK (RESET) --- */
* {
    box-sizing: border-box; /* Ez fontos, hogy a padding ne növelje a méretet */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #0f0f0f;
    color: white;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100vh; /* Teljes képernyő magasság */
}

/* --- SZÍNEK ÉS VÁLTOZÓK --- */
:root {
    --primary-red: #cc0000;
    --dark-bg: #0f0f0f;
    --card-bg: #1e1e1e;
    --border-color: #333;
    --text-gray: #aaa;
}

/* --- FEJLÉC (HEADER) --- */
header {
    background: #202020;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

h1 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--primary-red);
    font-style: italic;
    letter-spacing: 1px;
}

/* Gombok stílusa */
.btn {
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    border: none;
    display: inline-block;
}

.btn-red { background: var(--primary-red); color: white; }
.btn-gray { background: #333; color: white; margin-right: 5px; }
.btn-blue { background: #3ea6ff; color: black; } 
.btn:hover { opacity: 0.9; }

/* --- FŐ ELRENDEZÉS (LAYOUT) --- */
.main-container {
    display: flex;
    flex: 1; /* Kitölti a maradék helyet */
    overflow: hidden; /* Hogy ne legyen dupla görgetősáv */
}

/* --- BAL OLDAL: VIDEÓK --- */
.video-section {
    flex: 3; /* Nagyobb helyet kap asztali gépen */
    padding: 15px;
    overflow-y: auto; /* Csak ez a rész görgethető */
}

/* Videó Rács (Grid) */
#video-grid-top, #video-grid-bottom { 
    display: grid;
    /* Mobilon 1 oszlop, gépen amennyi kifér */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
    gap: 15px;
}

/* Moments előnézeti rács (függőlegesebb, "shorts" jellegű) */
#moments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); /* Keskenyebb oszlopok */
    gap: 15px;
}

/* Videó Kártya */
.video-card {
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.video-card video { /* Ez valószínűleg már nem kell, mert iframe van */
    width: 100%;
    aspect-ratio: 16/9; /* Fix képarány */
    object-fit: cover;
    background: black;
    display: block;
}

.card-info {
    padding: 10px;
}

.video-title {
    font-weight: bold;
    font-size: 0.95rem;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Feltöltő doboz */
#upload-box {
    background: #252525;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    border: 1px solid var(--border-color);
    display: none; /* Alapból rejtett, JS hozza elő */
}

#upload-box input {
    max-width: 100%; /* Hogy mobilon ne lógjon ki */
    margin-bottom: 10px;
}

/* --- FŐ ELRENDEZÉS (Egymás alatt) --- */
.main-container {
    display: flex;
    flex-direction: column; /* Ez teszi egymás alá őket */
    min-height: 100vh;
}

/* --- BAL OLDAL: VIDEÓK --- */
.video-section {
    width: 100%;
    padding: 20px;
    background: #0f0f0f;
}

/* --- LENTI RÉSZ: CHAT / KOMMENTEK --- */
.chat-section {
    width: 100%;
    max-width: 800px; /* Hogy ne legyen túl széles a szöveg */
    margin: 0 auto; /* Középre igazítás */
    background: #0f0f0f;
    border-top: 1px solid #333; /* Választóvonal a videók és a chat között */
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 10px 0;
    background: transparent;
    border-bottom: none;
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    text-align: left;
}

/* Komment író rész (Input + Gomb) */
.chat-form {
    padding: 0;
    background: transparent;
    display: flex;
    gap: 10px;
    margin-bottom: 20px; /* Távolság az üzenetektől */
    border-bottom: 1px solid #333;
    padding-bottom: 20px;
}

.chat-form input {
    background: transparent;
    border: none;
    border-bottom: 1px solid #555;
    border-radius: 0;
    color: white;
    padding: 10px;
    font-size: 1rem;
}
.chat-form input:focus {
    border-bottom: 2px solid white;
}

.chat-form button {
    background: #3ea6ff; /* YouTube kék */
    color: black;
    border-radius: 20px;
    padding: 8px 16px;
    font-weight: bold;
}

/* Üzenetek listája */
#messages {
    list-style: none;
    padding: 0;
    margin: 0;
    height: auto; /* Hagyjuk nőni */
    max-height: 600px; /* De ha túl sok, lehessen görgetni */
    overflow-y: auto;
}

#messages li {
    padding: 15px 0;
    border-bottom: none; /* YouTube-on nincs vonal az üzenetek között */
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Mobil nézet finomítás */
@media (max-width: 768px) {
    .chat-section {
        border-left: none;
        margin-top: 0;
        height: auto;
    }
}
/* --- ÚJ: Feltöltő neve stílus --- */
.uploader-info {
    font-size: 0.85rem;
    color: #aaa; /* Szürke szín */
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.uploader-name {
    color: #ffcc00; /* Aranyszín a névnek */
    font-weight: bold;
}

/* --- PROFIL GOMBOK --- */
.profile-actions {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.btn-follow {
    background-color: #cc0000; /* Piros */
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    font-weight: bold;
}
.btn-follow.following {
    background-color: #333; /* Szürke, ha már követed */
    border: 1px solid #555;
}

.btn-friend {
    background-color: #0066cc; /* Kék */
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    font-weight: bold;
}
.btn-friend.disabled {
    background-color: #222;
    color: #666;
    cursor: default;
}

.stats-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
    color: #aaa;
    font-size: 0.9rem;
}
.stat-box strong {
    color: white;
    font-size: 1.1rem;
}

/* --- ÉLŐ ADÁS GOMB --- */
.btn-live {
    background-color: #ff0000; /* Piros */
    color: white;
    font-weight: bold;
    text-transform: uppercase;
    padding: 8px 15px;
    border-radius: 20px; /* Kerekített */
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: 20px; /* Távolság a címtől */
    margin-right: auto; /* Ez tolja jobbra a Belépés gombokat */
    
    /* Pulzáló animáció */
    animation: pulse 2s infinite;
}

.btn-live:hover {
    background-color: #cc0000;
}

/* Animáció definíciója */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 0, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0);
    }
}

/* Mobilon legyen kicsit kisebb és ne tolja szét a fejlécet */
@media (max-width: 600px) {
    .btn-live {
        font-size: 0.8rem;
        padding: 5px 10px;
        margin-left: 10px;
    }
    .btn-live span {
        display: none; /* Mobilon csak a piros pötty látszik, a szöveg nem (ha túl hosszú) */
    }
    .btn-live::after {
        content: "LIVE"; /* Mobilon rövidebb szöveg */
    }
}

/* ÚJ: Moments előnézeti kártyák */
.moment-card-preview {
    aspect-ratio: 9/16; /* Függőleges arány, mint a shorts */
    height: 250px; /* Fix magasság */
    position: relative;
    overflow: hidden;
}
.moment-card-preview img {
    object-fit: cover !important; /* Fontos, hogy kitöltse a területet */
}

/* Új stílusok a like/dislike gomboknak a Moments előnézeten */
.moment-card-preview .like-count,
.moment-card-preview .dislike-count {
    font-size: 0.9rem;
    position: absolute;
    bottom: 5px; /* Helyezzük el fentebb a szöveghez képest */
    color: white;
    text-shadow: 0 0 3px black;
    background: rgba(0,0,0,0.5); /* Kis háttér, hogy jobban látszódjon */
    padding: 2px 5px;
    border-radius: 3px;
}
.moment-card-preview .like-count {
    left: 5px;
}
.moment-card-preview .dislike-count {
    right: 5px;
}





/* --- Hamburger ikon alaphelyzetben rejtve --- */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 26px;
    height: 20px;
    cursor: pointer;
    z-index: 1001;
    transition: transform 0.3s ease;
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Asztali elrendezés igazítása */
.nav-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* --- Mobil nézet (768px szélesség alatt) --- */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex; /* Megjelenik a gomb mobilról */
    }

    /* A menü konténer átalakul teljes képernyős felugró ablakká */
    .nav-container {
        display: none; 
        flex-direction: column;
        position: fixed;
        top: 0;
        right: -100%; /* Képernyőn kívülről indul */
        width: 280px; /* Oldalról csúszó szélesség */
        height: 100vh;
        background: #141414;
        border-left: 1px solid #333;
        padding: 80px 20px 20px 20px;
        box-shadow: -5px 0 15px rgba(0,0,0,0.5);
        z-index: 1000;
        gap: 20px;
        transition: right 0.3s ease;
    }

    /* Ha aktív, becsúszik a képernyőre */
    .nav-container.aktiv {
        display: flex;
        right: 0;
    }

    .nav-container .btn, 
    .nav-container .btn-live, 
    .nav-container #auth-panel {
        width: 100%;
        text-align: center;
        justify-content: center;
        margin: 0 !important; /* Felülírja az inline margókat */
    }
    
    #auth-panel {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-top: auto; /* Alulra rendezi a belépést */
    }

    /* Hamburger ikon animációja X formává */
    .menu-toggle.aktiv span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .menu-toggle.aktiv span:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle.aktiv span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }
}
















/* Csak a normál videók elrendezése PC-n */
#video-grid {
display: grid;
grid-template-columns: 1fr;
gap: 15px;
}

/* Tablet */
@media (min-width: 768px) {
#video-grid {
grid-template-columns: repeat(2, 1fr);
}
}

/* PC */
@media (min-width: 1200px) {
#video-grid {
grid-template-columns: repeat(3, 1fr);
}
}

/* Nagy monitor */
@media (min-width: 1600px) {
#video-grid {
grid-template-columns: repeat(4, 1fr);
}
}
