/* Import Google Fonts pentru un aspect modern, curat și lizibil */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&family=Roboto:wght@300;400;700&family=Roboto+Mono&display=swap');

:root {
    --tv-black: #1a1a1a;
    --tv-grey: #333;
    --tv-light-grey: #555;
    --tv-green: #00ff00; /* Neon green pentru accente */
    --tv-blue: #007bff; /* Culoare buton */
    --tv-screen-bg: #0d1a0d; /* Verde închis pentru ecran */
    --text-color: #e0e0e0;
    --border-radius: 10px;
    --shadow: 0 0 15px rgba(0, 255, 0, 0.5); /* Strălucire neon */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', sans-serif; /* Font principal pentru conținut: curat și lizibil */
    background-color: #0d0d0d;
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    overflow-x: hidden;
    background-image: radial-gradient(circle at center, #1a1a1a, #000000);
}

.tv-container {
    background-color: var(--tv-black);
    border: 5px solid var(--tv-grey);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    padding: 20px;
}

/* Efect ecran TV - linii de scanare și distorsiune CRT */
.tv-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.1) 0px,
        rgba(0, 0, 0, 0.1) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 10;
    animation: scanlines 8s linear infinite;
    opacity: 0.3;
}

@keyframes scanlines {
    to {
        background-position: 0 100%;
    }
}


/* Antet */
.tv-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 2px dashed var(--tv-light-grey);
    margin-bottom: 20px;
    position: relative; /* Adăugat pentru poziționarea selectorului de limbă */
}

.tv-logo {
    text-align: center;
    margin-bottom: 15px;
    flex-grow: 1; /* Permite logo-ului să ocupe mai mult spațiu pe ecrane mai mici */
}

.tv-logo h1 {
    font-family: 'Montserrat', sans-serif; /* Mai stilizat pentru logo */
    font-size: 2.5em;
    color: var(--tv-green);
    text-shadow: 0 0 8px var(--tv-green);
    letter-spacing: 2px;
}

.tv-logo p {
    font-size: 0.9em;
    color: var(--tv-green);
    opacity: 0.7;
}

.tv-nav {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    flex-grow: 2; /* Permite navigației să ocupe mai mult spațiu */
}

.nav-button {
    background-color: var(--tv-blue);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
    border: 2px solid var(--tv-light-grey);
    box-shadow: 0 0 5px var(--tv-blue);
}

.nav-button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 0 10px var(--tv-green);
}

/* Selectorul de Limbă */
.language-selector {
    margin-left: auto; /* Împinge selectorul la dreapta */
    margin-top: 10px; /* Spațiu de deasupra pe mobil */
    width: 100%; /* Ocupă lățimea completă pe mobil */
    text-align: center;
}

#lang-select {
    background-color: var(--tv-grey);
    color: var(--text-color);
    border: 1px solid var(--tv-light-grey);
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 0.9em;
    cursor: pointer;
    appearance: none; /* Ascunde săgeata implicită a browserului */
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23e0e0e0%22%20d%3D%22M287%2C114.3L153.2%2C248.1c-2.3%2C2.3-5.2%2C3.6-8.1%2C3.6s-5.8-1.3-8.1-3.6L5.4%2C114.3c-4.6-4.6-4.6-12%2C0-16.6l16.6-16.6c4.6-4.6%2C12-4.6%2C16.6%2C0l110.2%2C110.2L254.1%2C81.1c4.6-4.6%2C12-4.6%2C16.6%2C0l16.6%2C16.6C291.6%2C102.3%2C291.6%2C109.7%2C287%2C114.3z%22%2F%3E%3C%2Fsvg%3E'); /* Săgeată personalizată */
    background-repeat: no-repeat;
    background-position: right 8px top 50%;
    background-size: 12px auto;
}

#lang-select:focus {
    outline: none;
    border-color: var(--tv-green);
    box-shadow: 0 0 5px var(--tv-green);
}

.sr-only { /* Stil pentru textul ascuns vizual, dar accesibil cititoarelor de ecran */
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


/* Conținutul principal al ecranului TV */
.tv-screen {
    background-color: var(--tv-screen-bg);
    border: 3px inset var(--tv-light-grey);
    border-radius: 5px;
    padding: 20px;
    min-height: 300px;
    display: flex; /* Folosește flex pentru a gestiona panourile */
    position: relative;
    overflow: hidden; /* Ascunde panourile care depășesc */
}

.content-panel {
    width: 100%;
    position: absolute; /* Poziționează panourile absolut pentru a permite estomparea */
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease-in-out;
    background-color: rgba(0, 0, 0, 0.2); /* Suprapunere ușoară pentru conținut */
    padding: 20px;
    border-radius: 5px;
    overflow-y: auto; /* Permite defilarea pentru conținut lung */
}

.content-panel.active {
    opacity: 1;
    pointer-events: all;
    position: static; /* Ocupă spațiu când este activ */
}

.panel-title {
    font-family: 'Montserrat', sans-serif; /* Păstrează consistența cu logo-ul, dar lizibil */
    color: var(--tv-green);
    font-size: 1.8em;
    margin-bottom: 15px;
    text-shadow: 0 0 5px var(--tv-green);
    border-bottom: 1px dotted var(--tv-light-grey);
    padding-bottom: 10px;
}

.content-panel p {
    margin-bottom: 10px;
    line-height: 1.6;
}

.download-link {
    color: var(--tv-green);
    text-decoration: underline;
    font-weight: bold;
    transition: color 0.3s ease;
}

.download-link:hover {
    color: #ccffcc;
}

.access-code {
    background-color: var(--tv-grey);
    padding: 8px 15px;
    border-radius: 5px;
    display: inline-block;
    margin-top: 10px;
    font-family: 'Roboto Mono', monospace; /* Monospace pentru text de tip cod */
    font-size: 0.9em;
    color: var(--tv-green);
    border: 1px solid var(--tv-light-grey);
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.3);
}

.access-code span {
    color: #ffc107; /* Evidențiază codul de acces */
    text-shadow: 0 0 3px #ffc107;
}

/* Subsol */
.tv-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 20px;
    border-top: 2px dashed var(--tv-light-grey);
    margin-top: 20px;
}

/* Stil pentru adresa de contact din footer */
.footer-contact {
    margin-bottom: 10px;
    font-size: 0.9em;
}

.footer-contact a {
    color: var(--tv-green);
    text-decoration: underline;
}

.channel-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.channel-btn {
    background-color: var(--tv-light-grey);
    color: var(--tv-black);
    border: 2px solid var(--tv-grey);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
}

.channel-btn:hover {
    background-color: var(--tv-green);
    box-shadow: 0 0 15px var(--tv-green);
    color: var(--tv-black);
}

.channel-btn.active {
    background-color: var(--tv-green);
    box-shadow: 0 0 15px var(--tv-green);
    color: var(--tv-black);
    border-color: var(--tv-green);
}

/* Stiluri pentru animația măgărușului */
.donkey-animation-container {
    width: 100%;
    overflow: hidden; /* Ascunde măgărușul când este în afara containerului */
    position: relative; /* Necesar pentru poziționarea absolută a măgărușului */
    min-height: 100px; /* CRESCUT: Asigură spațiu pentru măgărușul mărit */
    margin-top: 20px;
    margin-bottom: 20px;
}

.moving-donkey {
    position: absolute;
    height: 90px; /* CRESCUT: Ajustează înălțimea măgărușului */
    width: auto;
    left: -120px; /* Ajustat pentru dimensiunea mai mare */
    animation: moveDonkey 10s linear infinite; /* Animație: 10 secunde, liniar, infinit */
    transform: scaleX(1); /* Măgărușul se mișcă normal */
}

@keyframes moveDonkey {
    0% {
        left: -120px; /* Start din stânga, în afara vizualului */
        transform: scaleX(1); /* Măgărușul este orientat spre dreapta */
    }
    49% {
        left: calc(100% - 30px); /* Aproape de capătul din dreapta (ajustat) */
        transform: scaleX(1);
    }
    50% {
        left: calc(100% - 30px); /* La capătul din dreapta (ajustat) */
        transform: scaleX(-1); /* Întoarce măgărușul orizontal */
    }
    99% {
        left: -120px; /* Măgărușul se întoarce la stânga, în afara vizualului */
        transform: scaleX(-1);
    }
    100% {
        left: -120px; /* Reset la stânga pentru o nouă buclă */
        transform: scaleX(1); /* Întoarce măgărușul la orientarea inițială pentru ciclul următor */
    }
}


/* Ajustări responsive */
@media (min-width: 769px) { /* Selectorul de limbă pe desktop */
    .language-selector {
        position: absolute;
        top: 20px;
        right: 20px;
        width: auto;
        margin-top: 0;
    }
}

@media (max-width: 768px) {
    .tv-container {
        padding: 15px;
    }

    .tv-header {
        flex-direction: column;
        text-align: center;
    }

    .tv-logo {
        margin-bottom: 10px; /* Ajustare spațiu */
    }

    .tv-nav {
        margin-top: 15px;
        order: 2; /* Pune navigația sub logo pe mobil */
    }

    .nav-button {
        padding: 8px 15px;
        font-size: 0.8em;
    }

    .language-selector {
        order: 1; /* Pune selectorul de limbă deasupra navigației pe mobil */
        margin-bottom: 15px;
    }

    .panel-title {
        font-size: 1.5em;
    }

    .access-code {
        font-size: 0.8em;
        padding: 6px 12px;
    }

    .channel-btn {
        width: 40px;
        height: 40px;
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    .tv-container {
        border-radius: 5px;
        padding: 10px;
    }

    .tv-logo h1 {
        font-size: 1.8em;
    }

    .tv-nav {
        flex-direction: column;
        gap: 10px;
    }

    .nav-button {
        width: 80%;
        margin: 0 auto;
    }

    .tv-screen {
        min-height: 250px;
        padding: 15px;
    }

    .content-panel {
        padding: 15px;
    }

    .panel-title {
        font-size: 1.3em;
        margin-bottom: 10px;
    }

    .content-panel p {
        font-size: 0.9em;
    }

    .channel-btn {
        width: 35px;
        height: 35px;
        font-size: 0.9em;
    }

    /* Ajustări pentru măgăruș pe mobil */
    .moving-donkey {
        height: 70px; /* Măgăruș mai mare pe mobil */
        left: -80px; /* Ajustare start poziție pentru mobil */
    }

    @keyframes moveDonkey {
        0% {
            left: -80px;
            transform: scaleX(1);
        }
        49% {
            left: calc(100% - 25px); /* Ajustat pentru mobil */
            transform: scaleX(1);
        }
        50% {
            left: calc(100% - 25px); /* Ajustat pentru mobil */
            transform: scaleX(-1);
        }
        99% {
            left: -80px;
            transform: scaleX(-1);
        }
        100% {
            left: -80px;
            transform: scaleX(1);
        }
    }
}
