/* =========================
   1. RESET GENERAL (Bază pagină)
========================= */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow-y: auto; /* Permite scroll pe verticală dacă conținutul depășește ecranul */
    background: #0b0b0b;
    font-family: Arial, sans-serif;
}


/* =========================
   2. CONTAINER PRINCIPAL (APP FRAME)
========================= */
.box {
    width: 100%;        /* Ocupă spațiul disponibil până la limita maximă */
    max-width: 500px;   /* Păstrează playerul compact la 500px */

    /* înălțime reală stabilă pe mobile + desktop */
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100); /* Formulă standard fără erori în editor */

    display: flex;
    flex-direction: column;

    background: #1a1a1a;
    box-sizing: border-box;

    padding: 10px;

    overflow: hidden; /* împiedică ieșirea conținutului */
    flex-shrink: 0;   /* Împiedică deformarea playerului când ecranul se micșorează */
}

/* =========================
   3. HEADER INTERN APP (TITLU ȘI STATUS LIVE)
   - NU se mișcă
   - NU se întinde
========================= */
.header {
    flex-shrink: 0;
}

/* TITLU */
h2 {
    text-align: center;
    color: #00d2d3;
    margin: 5px 0;
}

/* STATUS LIVE */
.status {
    text-align: center;
    color: #aaa;
    margin: 5px 0;
}

/* =========================
   4. IMAGINE RADIO (SAFE BLOCK)
========================= */
.radio-cover img {
    width: 100%;
    max-height: 150px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

/* =========================
   5. PLAYER AUDIO
========================= */
audio {
    width: 100%;
    margin-top: 8px;
}

/* =========================
   6. BUTON RADIO
========================= */
#radioBtn {
    width: 100%;
    padding: 12px;
    margin-top: 8px;

    background: #00d2d3;
    border: none;
    font-weight: bold;
    border-radius: 6px;
}

/* =========================
   7. DEDICAȚII (ANIM TEXT)
========================= */
.dedications {
    margin-top: 8px;
    color: #00d2d3;
    text-align: center;
    font-size: 14px;
    animation: pulseText 1.5s infinite;
}

/* =========================
   8. CHAT (SINGURA ZONĂ SCROLLABILĂ)
========================= */
.chat {
    flex: 1;            /* ocupă TOT spațiul rămas */
    min-height: 0;      /* FIX critic pentru flex pe mobil */

    overflow-y: auto;   /* scroll doar aici */

    background: #000;
    color: #00ff00;

    padding: 10px;

    /* IMPORTANT: spațiu pentru input (ca să nu fie acoperit ultimul mesaj) */
    padding-bottom: 80px;

    border-radius: 8px;
    font-family: monospace;

    -webkit-overflow-scrolling: touch;
}

/* =========================
   9. FORM FIX JOS (INPUT CHAT)
   - Modificat pentru a sta natural sub casetă, fără să mai fie blocat jos
========================= */
#form {
    position: relative;     /* CORECTURĂ: Schimbat din 'fixed' în 'relative' ca să stea fix sub casetă */
    left: auto;
    transform: none;
    bottom: auto;

    width: 100%;
    max-width: 500px;       
    height: auto;           /* CORECTURĂ: Permite înălțimii să se adapteze la padding-ul tău de 12px */

    display: flex;
    gap: 10px;

    background: transparent; /* Lasă fundalul negru general al site-ului să se vadă curat */
    border-top: none;

    padding: 0;             /* Elimină padding-ul vechi care muta elementele */
    box-sizing: border-box;

    z-index: 10;
}


/* INPUTURI */
#form input {
    flex: 1;
    min-width: 0;

    font-size: 16px;
    padding: 8px;

    background: #222;
    color: #fff;

    border: 1px solid #444;
}

/* BUTON SEND */
#form button {
    width: 65px;

    background: #00d2d3;
    border: none;
    font-weight: bold;
    color: #000;
}

/* =========================
   10. ANIMAȚII TEXT
========================= */
@keyframes pulseText {
    0%   { transform: scale(1); opacity: 1; }
    50%  { transform: scale(1.05); opacity: 0.6; }
    100% { transform: scale(1); opacity: 1; }
}


/* =========================
   11. STRUCTURĂ ȘI SIDEBARURI (ALINIERE NATURALĂ PE RÂND)
   - Forțează așezarea Stânga - Mijloc - Dreapta
   - Urcă și coboară natural la scroll, fără să plutească
========================= */

/* Aliniază cele 3 elemente mari exact pe același rând orizontal */
.zona-radio-layout {
    display: flex !important;
    justify-content: center !important;
    align-items: flex-start !important;
    gap: 30px !important;               /* Spațiul gol dintre reclame și player */
    max-width: 1200px !important;
    margin: 30px auto !important;       /* Distanța față de elementele de sus și jos */
    padding: 0 15px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Containerul fix pentru player și formular */
.box-wrapper {
    max-width: 500px !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    flex-shrink: 0 !important;
}

/* Forțează ambele sidebar-uri să aibă dimensiuni identice și să nu se deformeze */
.sidebar-reclame {
    position: relative !important;     /* Modul static: merg odată cu scroll-ul paginii */
    width: 320px !important;
    max-width: 320px !important;
    min-width: 320px !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
}

/* BLOCUL INTERN DE RECLAMĂ */
.sidebar {
    background: #1a1a1a;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #333;
}

/* TITLUL DIN SIDEBAR */
.sidebar-title {
    text-align: center;
    color: #00d2d3;
    font-weight: bold;
    font-size: 14px;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

/* =======================================================
   12. RESPONSIVITATE DIRECTĂ (PROPRIETĂȚILE TALE ORIGINALE)
======================================================= */

/* PE DESKTOP: Lăsăm site-ul exact cum l-ai gândit tu, cu ambele margini active */
@media screen and (min-width: 1251px) {
    .zona-radio-layout {
        display: flex !important;
        justify-content: space-between !important;
        align-items: flex-start !important;
    }
    /* Ambele sidebar-uri stau la locul lor pe laptop */
    .sidebar-stanga,
    .sidebar-reclame {
        display: block !important;
    }
}

/* PE MOBIL ȘI TELEFOANE (Sub 1250px) */
@media screen and (max-width: 1250px) {
    /* Transformăm rândul orizontal în listă verticală */
    .zona-radio-layout {
        display: block !important;
        padding: 10px !important;
        margin: 0 auto !important;
    }
    
    /* Playerul rămâne primul sus pe ecranul telefonului */
    .box-wrapper {
        max-width: 100% !important;
        width: 100% !important;
        margin-bottom: 20px !important;
    }
    
    .box {
        max-width: 100% !important;
    }
    
    /* În loc de display: none, le lăsăm să curgă jos, sub player */
    .sidebar-stanga,
    .sidebar-reclame {
        display: block !important;
        width: 100% !important;
        max-width: 320px !important; /* Le ține centrate, fără să lățească ecranul */
        margin: 0 auto 25px auto !important;
        float: none !important;
        clear: both !important;
    }
    
    .sidebar {
        width: 100% !important;
        max-width: 320px !important;
        margin: 0 auto !important;
    }
}

/* =========================
   13. BUTOANE SOCIALE FACEBOOK (HTML CUSTOM)
   - Poziționat natural sub formularul de mesaje
   - Dimensiuni perfecte adaptate pentru mobil și desktop
========================= */
.fb-buttons-container {
    display: flex !important;
    justify-content: space-between !important;
    gap: 10px !important;
    margin-top: 15px !important;       
    margin-bottom: 5px !important;
    width: 100% !important;            
    box-sizing: border-box !important;
}

/* Stilul general al butoanelor */
.fb-btn {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 12px !important;
    border-radius: 4px !important;     
    font-weight: bold !important;
    font-size: 14px !important;
    color: #ffffff !important;
    text-decoration: none !important;
    transition: background 0.2s ease, transform 0.1s ease;
    cursor: pointer !important;
    text-align: center !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
}

/* Culoarea oficială Facebook pentru butonul Îmi Place */
.fb-like-btn {
    background: #1877f2 !important;
}
.fb-like-btn:hover {
    background: #166fe5 !important;
    transform: scale(1.02);
}

/* Culoarea pentru butonul de Distribuie */
.fb-share-btn {
    background: #42b72a !important;    
}
.fb-share-btn:hover {
    background: #36a420 !important;
    transform: scale(1.02);
}

/* Adaptare pe telefoane foarte mici */
@media (max-width: 360px) {
    .fb-buttons-container {
        flex-direction: column !important;
        gap: 10px !important;
    }
}
