/* 1. Channel-filter to CSS dla lisbox */

/* WYKRYWANIE ORIENTACJI NA TELEFONIE ---------------------- */
/* Overlay */
#rotate-warning {
    position: fixed;
    inset: 0;
    background: #000;
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 9999;
    font-family: sans-serif;
}

/* Kontener animacji */
.phone-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* Telefon (prostokąt) */
.phone {
    width: 80px;
    height: 140px;
    border: 4px solid white;
    border-radius: 12px;
    position: relative;
    animation: rotatePhone 2.5s infinite ease-in-out;
}

/* Strzałka */
.arrow {
    width: 0;
    height: 0;
    border-left: 18px solid transparent;
    border-right: 18px solid transparent;
    border-top: 25px solid white;
    animation: arrowBounce 1.2s infinite ease-in-out;
}

/* Tekst */
#rotate-warning p {
    font-size: 1.4rem;
    margin: 0;
}

/* Animacja obracania telefonu */
@keyframes rotatePhone {
    0%   { transform: rotate(0deg); }
    40%  { transform: rotate(90deg); }
    60%  { transform: rotate(90deg); }
    100% { transform: rotate(0deg); }
}

/* Animacja strzałki */
@keyframes arrowBounce {
    0%   { transform: translateY(0); }
    50%  { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

/* Telefon pion — blokujemy stronę */
@media (orientation: portrait) and (max-width: 900px) {
    #rotate-warning { display: flex; }
    main { display: none; }
}

/* Telefon poziom + PC — normalne działanie */
@media (orientation: landscape), (min-width: 901px) {
    #rotate-warning { display: none; }
    main { display: block; }
}
/*-------------------------------------------------------------*/

body {
    margin: 24px;
    font-family: Arial, Helvetica, sans-serif;
    color: #202124;
    background: #ffffff;
}

.channel-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    column-gap: 101px;
}

.channel-filter,
.channel-filter-country,
.channel-filter-language {
    width: min(454px, 100%);    /* szerokość Listbox */
    margin: 20px 0 28px;
}

.channel-filter label,
.channel-filter-country label,
.channel-filter-language label {
    display: block;
    margin: 0;
    color: #1554c9;
    font-size: 36px;
    font-weight: 400;
    line-height: 1.1;
}

.channel-filter-select-wrapper,
.channel-filter-country-select-wrapper,
.channel-filter-language-select-wrapper {
    position: relative;
    width: 100%;
}

.channel-filter-select-wrapper::before,
.channel-filter-country-select-wrapper::before,
.channel-filter-language-select-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    z-index: 1;
    width: 42px;
    height: 42px;
    border-radius: 0 5px 5px 0;
    background: #1554c9;
    pointer-events: none;
}

.channel-filter-select-wrapper::after,
.channel-filter-country-select-wrapper::after,
.channel-filter-language-select-wrapper::after {
    content: '';
    position: absolute;
    top: 11px;                   /* pozycja strzałki */
    right: 13px;
    z-index: 2;
    width: 14px;
    height: 14px;
    border-right: 3px solid #ffffff;
    border-bottom: 3px solid #ffffff;
    transform: rotate(45deg);
    pointer-events: none;
}

#channel-filter-select,
#channel-filter-country-select,
#channel-filter-language-select {
    width: 100%;
    height: 42px;                 /* wysokość listbox */
    box-sizing: border-box;
    padding: 0 92px 0 14px;
    border: 1px solid #6f7888;
    border-radius: 6px;
    outline: 0;
    appearance: none;
    -webkit-appearance: none;
    background: linear-gradient(#ffffff, #f7f7f7);
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.16);
    color: #202124;
    font-family: "Courier New", Courier, monospace;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

#channel-filter-select:focus-visible,
#channel-filter-country-select:focus-visible,
#channel-filter-language-select:focus-visible {
    border-color: #1554c9;
    box-shadow: 0 0 0 3px rgba(21, 84, 201, 0.2);
}

#channel-filter-country-select option:hover,
#channel-filter-country-select option:checked,
#channel-filter-language-select option:hover,
#channel-filter-language-select option:checked {
    background: #1554c9;
    color: #ffffff;
}

#wynik {
    overflow-x: auto;
}

#wynik table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    table-layout: fixed;
}

#wynik th,
#wynik td {
    padding: 10px;
    border: 1px solid #dddddd;
    text-align: left;
    vertical-align: top;
}

#wynik th {
    background: #f4f4f4;
}

#wynik th:first-child,
#wynik td:first-child {
    width: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
    box-sizing: border-box;
}

/* Rozdzielczość avatara STANDARD */
#wynik td:first-child img {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

/* Rozdzielczość avatara PREMIUM */
#wynik td:first-child img.premium-avatar {
    width: 48px;
    height: 48px;
}

#wynik th:nth-child(3),
#wynik td:nth-child(3) {
    width: 30%;
}

.description-preview {
    display: block;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.description-more {
    margin-top: 7px;
    padding: 0;
    border: 0;
    background: none;
    color: #202124;
    font: inherit;
    font-weight: 400;
    cursor: pointer;
}

.description-more:hover,
.description-more:focus-visible {
    font-weight: 700;
}

.channel-link {
    color: #065fd4;
    font-weight: 600;
    text-decoration: none;
}

.channel-link:hover,
.channel-link:focus-visible {
    text-decoration: underline;
}

.description-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.72);
}

.description-modal.is-open {
    display: flex;
}

.description-modal-panel {
    position: relative;
    width: min(760px, 100%);
    max-height: calc(100vh - 48px);
    box-sizing: border-box;
    overflow-y: auto;
    padding: 34px 36px 40px;
    border-radius: 18px;
    background: #212121;
    color: #f1f1f1;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
}

.description-modal-title {
    /*margin: 0 64px 48px 0;*/
    margin: 0;
    font-size: 28px;
    line-height: 1.2;
}

.description-modal-heading {
    margin: 0 0 16px;
    font-size: 28px;
    line-height: 1.2;
}

.description-modal-text {
    margin: 0;
    font-size: 18px;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.description-modal-close {
    position: absolute;
    top: 20px;
    right: 24px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #f1f1f1;
    font-size: 38px;
    line-height: 40px;
    cursor: pointer;
}

.description-modal-close:hover,
.description-modal-close:focus-visible {
    background: #383838;
}

@media (max-width: 1100px) {
    .channel-filters {
        column-gap: 32px;
    }
}

@media (max-width: 700px) {
    body {
        margin: 12px;
    }

    .channel-filters {
        display: block;
    }

    .channel-filter label,
    .channel-filter-country label,
    .channel-filter-language label {
        margin-left: 8px;
        font-size: 30px;
    }

    #channel-filter-select,
    #channel-filter-country-select,
    #channel-filter-language-select {
        font-size: 24px;
    }

    .description-modal {
        padding: 12px;
    }

    .description-modal-panel {
        max-height: calc(100vh - 24px);
        padding: 28px 24px 32px;
        border-radius: 14px;
    }

    .description-modal-title {
        margin-bottom: 36px;
        font-size: 24px;
    }

    .description-modal-heading {
        font-size: 24px;
    }
}
