@font-face {
    font-family: "Golos Text";
    src:
        url("../assets/fonts/Golos_Text_Regular.woff2") format("woff2"),
        url("../assets/fonts/Golos_Text_Regular.woff") format("woff");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Golos Text";
    src:
        url("../assets/fonts/Golos_Text_Bold.woff2") format("woff2"),
        url("../assets/fonts/Golos_Text_Bold.woff") format("woff");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}
@keyframes pulse {
    0% {
        transform: scale(0.8);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(0.8);
        opacity: 0.6;
    }
}
:root {
    /* Светлая тема (по умолчанию) */
    --bg: #edebeb;
    --bg2: #e0e0e0;
    --ch: #ffffff;
    --ch2: #fefefe;
    --br: rgba(0, 0, 0, 0.15);
    --txt: #2b3642;
    --txt2: #5a6470;
    --notice: #8b93a7;
    --accent: linear-gradient(122.35deg, #dd313f, #e84a5f);
    --live: #e84a5f;
    --hbg: #f5f5f5;
    --foo: #6b7280;
}

::-webkit-selection {
    background-color: rgba(239, 84, 131, 0.1);
    color: #fff;
}

::-moz-selection {
    background-color: rgba(239, 84, 131, 0.1);
    color: #fff;
}

::-webkit-scrollbar {
    -webkit-appearance: none;
}

::-webkit-scrollbar:vertical {
    width: 6px;
}

::-webkit-scrollbar:horizontal {
    height: 6px;
}

::-webkit-scrollbar-thumb {
    background: rgba(239, 84, 131, 0.1);
    border-radius: 4px;
}

* {
    box-sizing: border-box;
    outline: none;
}

input:focus {
    outline: none;
}

html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: auto;
    font-smooth: always;
}

body {
    margin: 0;
    font-family: "Golos Text", Arial, Helvetica, sans-serif;
    color: var(--txt);
    background: linear-gradient(180deg, var(--bg), var(--bg2));
    background-repeat: no-repeat;
    background-attachment: scroll;
    background-size: 100% auto;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

a:hover,
a:active,
a:focus {
    outline: none;
    text-decoration: none;
}

.header {
    top: 0;
    z-index: 35;
}

.header-home {
    background: var(--ch2);
    border-bottom: 1px solid var(--br);
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
    -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
    -moz-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
}

.header__inner {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 12px 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.brand__logo {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--accent);
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(221, 49, 63, 0.35);
    -webkit-box-shadow: 0 4px 16px rgba(221, 49, 63, 0.35);
    -moz-box-shadow: 0 4px 16px rgba(221, 49, 63, 0.35);
}

.brand__title {
    color: var(--txt);
    font-weight: 700;
}

.brand:hover {
    opacity: 0.9;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0);
    color: var(--txt);
    font-size: 14px;
    border: none;
    cursor: pointer;
}

.dropdown-toggle span {
    font-size: 10px;
}

.dropdown-content {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    background-color: var(--ch);
    border: 1px solid var(--br);
    min-width: 180px;
    border-radius: 6px;
    z-index: 35;
    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;
}

.dropdown-content a {
    font-size: 14px;
    color: var(--txt);
    padding: 10px 14px;
    text-decoration: none;
    display: flex;
    align-items: center;
    border: 1px solid transparent;
}

.dropdown-content a svg {
    margin-right: 10px;
}

.dropdown-content a:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: var(--br);
    border-radius: 6px;
}

.dropdown:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
}

.dropdown:hover .dropdown-toggle {
    opacity: 0.9;
}

body.home .app {
    grid-template-columns: 1fr;
}

.app {
    max-width: 100%;
    margin: 0 auto;
    padding: 8px;
    display: grid;
    grid-template-columns: 340px 2fr;
    gap: 8px;
}

.channels {
    background: var(--ch);
    border: 1px solid var(--br);
    border-radius: 6px;
    overflow: hidden;
    max-height: 98vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 50px 0 rgba(0, 0, 0, 0.1);
}

.channels .search {
    padding: 10px;
    border-bottom: 1px solid var(--br);
    z-index: 33;
    box-shadow: 0 15px 8px -8px rgba(0, 0, 0, 0.15);
}

.channels input {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid var(--br);
    background: rgba(0, 0, 0, 0.04);
    color: var(--txt);
}

.channels input:hover {
    outline: 1px solid #dd313f;
}

.channels input:focus {
    outline: 1px solid #dd313f;
}

.list-channels {
    max-height: calc(100vh - 5px);
    overflow: auto;
    list-style: none;
    margin: 0;
    padding: 6px;
}

.list-channels li {
    border-radius: 6px;
}

.list-channels a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--txt);
    text-decoration: none;
    border: 1px solid transparent;
}

.list-channels a:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: var(--br);
    border-radius: 6px;
}

.list-channels li.active a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-right: 50px;
    box-sizing: border-box;
    background: var(--accent);
    color: #f5f5f5;
    border-color: var(--br);
    border-radius: 6px;
}

.list-channels li.active .bookmark-link {
    position: absolute;
    top: 53%;
    right: 15px;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #e1e1e1;
    z-index: 10;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
}

.list-channels li.active .bookmark-link:hover {
    color: gold;
}

.list-channels li.active .bookmark-added {
    color: gold;
}

.star-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    stroke: currentColor;
    stroke-width: 2px;
}

.bookmark-link .bookmark-tooltip-instance {
    position: absolute;
    left: -7px;
    top: 50%;
    transform: translateY(-50%) translateX(-100%);
    margin-right: 8px;
    opacity: 0;
    visibility: hidden;
    background-color: rgba(51, 51, 53, 0.95);
    color: #fff;
    text-align: center;
    padding: 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    pointer-events: none;
    transition:
        opacity 0.2s,
        transform 0.2s;
    z-index: 20;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    max-width: 220px;
}

.bookmark-link.show-tooltip .bookmark-tooltip-instance,
.bookmark-link:hover .bookmark-tooltip-instance {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(-100%);
}

.bookmark-link .bookmark-tooltip-instance::after {
    content: "";
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent transparent rgba(43, 54, 66, 0.95);
}

.channel-logo {
    width: 46px;
    height: 46px;
    border-radius: 6px;
    border: 1px solid var(--br);
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 700;
    overflow: hidden;
    flex-shrink: 0;
    background: #fff;
}

.channel-logo img {
    width: 85%;
    height: 85%;
    object-fit: cover;
    display: block;
}

.channel-name {
    font-size: 1rem;
    font-weight: 700;
}

.tv {
    background: var(--ch2);
    border: 1px solid var(--br);
    border-radius: 6px;
    padding: 4px;
    overflow: hidden;
    max-height: 98vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 50px 0 rgba(0, 0, 0, 0.1);
}

.catalog-tv {
    display: block;
}

.category-block {
    margin-bottom: 16px;
}

.category-tv {
    margin: 25px 15px 15px;
    font-weight: 700;
    background-image: linear-gradient(-45deg, #c447ff, #e84a5f);
    background-repeat: repeat;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.home {
    background: var(--ch2);
    border: 1px solid var(--br);
    border-radius: 6px;
    padding: 4px;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 98vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 50px 0 rgba(0, 0, 0, 0.1);
}

.collections {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 12px;
    padding: 0 12px 12px 12px;
}

.collection {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--br);
    border-radius: 6px;
    background: var(--ch);
    text-decoration: none;
    color: var(--txt);
    /* box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.1); */
    transition:
        transform 0.5s ease/* ,
        box-shadow 0.5s ease */;
}

.collection:hover {
    transform: scale(1.05);
	background: var(--accent);
	color: #fff;
    border-color: var(--br);
    box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.16);
}

.collection .channel-logo {
    width: 70px;
    height: 70px;
}

.collection-text {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    text-overflow: clip;
}

.collection-name {
    font-weight: 700;
    font-size: 16px;
}

.player {
    overflow: hidden;
    padding-top: 45.25%;
    position: relative;
    border-radius: 6px;
    background: #000;
    border: 1px solid var(--br);
    height: 0;
    width: 100%;
}

.player iframe {
    border: 0;
    height: 100%;
    left: 0;
    position: absolute;
    top: 0;
    width: 100%;
}

.sub-titles {
    position: absolute;
    right: 0;
    top: 0;
    display: flex;
    gap: 8px;
}

.sub-title {
    font-size: 12px;
    padding: 4px;
    border-radius: 6px;
}

.sub-title.share {
    display: flex;
    gap: 10px;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: #222;
    cursor: pointer;
    transition:
        transform 0.2s,
        background 0.2s;
}

.share-btn:hover {
    transform: scale(1.1);
    background: #333;
}

.vk-icon path {
    fill: #f5f5f5;
}

.ok-icon path {
    fill: #f5f5f5;
}

.sub-title.name {
    display: none;
}

button {
    padding: 0;
    border: none;
    background: none;
    font: inherit;
    color: inherit;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.days-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.day-tab {
    background: var(--ch);
    color: var(--txt2);
    font-size: 12px;
    border: 1px solid var(--br);
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 6px;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.day-tab:hover {
    background: var(--accent);
    color: #f5f5f5;
    transition: all 0.3s ease;
}

.day-tab.active {
    background: var(--accent);
    color: #f5f5f5;
}

.program-list {}

.program-item {
    border-bottom: 1px solid var(--br);
    display: flex;
    align-items: flex-start;
    gap: 15px;
    transition: all 0.3s ease;
    position: relative;
}

.program-item:last-child {
    border-bottom: none;
}

.program-item.past {
    opacity: 0.7;
}

.program-item.past .program-details h3,
.program-item.past .program-details p {
    opacity: 0.7;
}

.program-item.current-visible {}

.program-details h3 {
    color: var(--txt);
    font-weight: 700;
    font-size: 16px;
}

.program-details h3 time {
    font-size: 13px;
}

.program-details p {
    color: var(--txt2);
    font-size: 13px;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.program-item.current {
    position: relative;
}

.program-item.current::before {
    content: "В ЭФИРЕ";
    position: absolute;
    top: 0;
    right: 5px;
    color: var(--txt2);
    font-size: 11px;
}

.program-item.current::after {
    content: "";
    position: absolute;
    width: 7px;
    height: 7px;
    background-color: var(--live);
    border-radius: 50%;
    top: 3px;
    left: calc(100% - 65px);
    animation: pulse 1.5s infinite;
}

.progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--accent);
    border-radius: 3px 0 0 3px;
    transition: width 30s linear;
    display: none;
}

.program-item.current .progress-bar {
    display: block;
}

.ads {
    width: 100%;
    height: auto;
    max-height: 250px;
}

.ads-home {
    width: 100%;
    height: auto;
    margin: 15px 0;
    max-height: 250px;
}

.list-channels::-webkit-scrollbar,
.meta::-webkit-scrollbar,
.home::-webkit-scrollbar {
    width: 6px;
}

.list-channels::-webkit-scrollbar-thumb,
.meta::-webkit-scrollbar-thumb,
.home::-webkit-scrollbar-thumb {
    background: rgba(239, 84, 131, 0.4);
    border-radius: 4px;
}

.footer {
    margin-top: auto;
    padding: 20px;
    color: var(--foo);
    font-size: 12px;
}

.footer a {
    color: var(--foo);
    text-decoration: underline;
}

.footer-container {
    margin-top: auto;
    padding: 20px;
    color: var(--foo);
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-top: 1px solid var(--br);
}

.footer-container a {
    color: var(--foo);
    text-decoration: none;
}

.footer-container a:hover {
    text-decoration: underline;
}

h1 {
    margin: 0;
    padding: 15px 0 0 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--txt);
}

h2 {
    margin: 0;
    padding: 15px 0 0 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--txt);
}

.meta {
    display: flex;
    overflow: auto;
    flex-direction: column;
    justify-content: flex-start;
    padding: 12px;
    gap: 6px;
    opacity: 0;
    animation: fadeIn 1s linear forwards;
}

.meta .meta-title h1 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--txt);
}

.meta .meta-category,
.meta .meta-faq {
    display: none;
}

.meta .meta-text {
    margin-top: auto;
    font-size: 12px;
    color: var(--txt2);
    line-height: 1.4;
}

.meta-home {
    padding: 5px 5px 0 15px;
}

.meta-home h1 {
	margin-top: 7px;
    padding: 0 0 5px 0;
}

.meta-home h2 {
    padding: 0 0 5px 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--txt);
}

.meta-home .meta-home-text {
    margin-top: auto;
    font-size: 14px;
    color: var(--txt2);
    line-height: 1.2;
}

@media (prefers-color-scheme: dark) {
    :root {
        
        --bg: #202124;
        --bg2: #1e1e1e;
        --ch: #2c2c2e;
        --ch2: #252525;
        --br: rgba(255, 255, 255, 0.1);
        --txt: #e0e0e0;
        --txt2: #a0a0a5;
        --notice: #9a9fa8;
        --accent: linear-gradient(122.35deg, #dd313f, #e84a5f);
        --live: #e84a5f;
        --hbg: #1a1a1c;
        --foo: #686868;
    }

    .header-home {
        background: var(--ch);
        border-bottom-color: var(--br);
        box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.3);
        -webkit-box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.3);
        -moz-box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.3);
    }

    .dropdown-content a:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    .channels {
        box-shadow: 0 10px 50px 0 rgba(255, 255, 255, 0.1);
    }

    .channels .search {
        box-shadow: 0 15px 8px -8px rgba(0, 0, 0, 0.55);
    }

    .channels input {
        background: rgba(255, 255, 255, 0.04);
    }

    .list-channels a:hover {
        background: rgba(255, 255, 255, 0.08);
    }

    .channel-logo {
        background: #ffffff;
    }

    .tv,
	.home {
        box-shadow: 0 10px 50px 0 rgba(255, 255, 255, 0.1);
    }

    .collection {
        background: var(--ch);
        /* box-shadow: 0 4px 8px 0 rgba(255, 255, 255, 0.06); */
    }

    .collection:hover {
        box-shadow: 0 8px 16px 0 rgba(255, 255, 255, 0.1);
    }

    .player {
        border-color: var(--br);
    }

    .day-tab {
        background: var(--ch);
    }

    .day-tab:hover,
    .day-tab.active {
        background: var(--accent);
        color: var(--txt);
    }
	
	.footer, 
	.footer a { color: var(--foo);}

    .list-channels::-webkit-scrollbar-thumb,
    .meta::-webkit-scrollbar-thumb,
    .home::-webkit-scrollbar-thumb {
        background: rgba(239, 84, 131, 0.4);
    }

    .list-channels::-webkit-scrollbar-track,
    .meta::-webkit-scrollbar-track,
    .home::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.03);
    }
	
	::-webkit-scrollbar-thumb {
        background: rgba(239, 84, 131, 0.01);
    }
    ::-webkit-scrollbar-track {
        background: var(--bg2);
    }
	
}

@media (max-width: 1100px) {
    .app {
        grid-template-columns: 280px 2fr;
    }
}
@media (max-width: 820px) {
    .app {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    .tv {
        order: 1;
    }
    .channels {
        order: 2;
    }
    .meta {
        display: none;
    }
}
@media (max-width: 1100px) and (orientation: portrait) {
    .player {
        padding-top: 56.25%;
        max-height: calc(100vh - 40px);
        min-height: 200px;
    }
}
@media (max-width: 1100px) and (orientation: landscape) {
    .player {
        padding-top: 0;
        aspect-ratio: 16 / 9;
        max-height: calc(100vh - 40px);
        min-height: 300px;
    }
}
@media (max-width: 740px) {
    .ads {
        max-height: 160px;
    }
    .ads-home {
        max-height: 160px;
    }
}
@media (max-width: 540px) {
    .ads {
        max-height: 100px;
    }
    .ads-home {
        max-height: 100px;
    }
}
@media (max-width: 820px) {
    .app {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 0;
    }
    .channels,
    .tv {
        border-radius: 0;
        border: 1px solid var(--br);
        box-shadow: none;
        margin: 0;
    }
    .meta {
        padding: 10px;
    }
}
