/*
 * IPTV Pro Web Rebuild Style - FULLY RESPONSIVE
 * Native Android Material dark theme with mobile optimization
 */

:root {
    --bg-app: #121b24;
    --bg-actionbar: #1e2a38;
    --bg-card: #192531;
    --bg-card-active: #203142;
    --bg-dialog: #1e2732;
    --bg-input: #151d27;
    
    --accent: #2196f3;
    --accent-rgb: 33, 150, 243;
    --text-primary: #ffffff;
    --text-secondary: #8b9daa;
    --border-color: #1a2530;
    --danger: #ff5252;
    
    --font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --elevation-1: 0 2px 5px rgba(0,0,0,0.3);
    --elevation-2: 0 4px 10px rgba(0,0,0,0.4);
    --elevation-3: 0 8px 24px rgba(0,0,0,0.5);
    
    --actionbar-height: 56px;
    --tabbar-height: 48px;
    --drawer-width: 280px;
}

/* Global resets */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-drag: none;
}

html, body {
    background-color: var(--bg-app);
    color: var(--text-primary);
    font-family: var(--font-family);
    width: 100%;
    height: 100%;
    overflow: hidden;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    position: fixed;
    top: 0;
    left: 0;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 2px;
}

/* Main Layout Wrapper */
.android-app {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* Native Android Action Bar */
.action-bar {
    height: var(--actionbar-height);
    min-height: var(--actionbar-height);
    background-color: var(--bg-actionbar);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    padding: 0 8px;
    position: relative;
    box-shadow: var(--elevation-1);
    z-index: 20;
    flex-shrink: 0;
}

.action-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}

.action-btn:active {
    background-color: rgba(255, 255, 255, 0.1);
}

.action-btn i {
    width: 22px;
    height: 22px;
}

.action-title-container {
    flex-grow: 1;
    margin-left: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.action-title {
    font-size: 17px;
    font-weight: 500;
    letter-spacing: 0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.action-subtitle {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0px;
}

.action-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

/* Overflow Menu */
.overflow-menu-container {
    position: relative;
}

.overflow-dropdown {
    position: absolute;
    top: 44px;
    right: 4px;
    background-color: var(--bg-dialog);
    min-width: 180px;
    border-radius: 4px;
    box-shadow: var(--elevation-2);
    padding: 8px 0;
    z-index: 30;
}

.dropdown-item {
    padding: 12px 16px;
    font-size: 15px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s;
}

.dropdown-item:active {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Inline Search Bar */
.search-bar-inline {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-actionbar);
    display: flex;
    align-items: center;
    padding: 0 8px;
    z-index: 25;
}

.search-bar-inline input {
    flex-grow: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 16px;
    font-family: var(--font-family);
    padding: 8px;
    margin-left: 4px;
    min-width: 0;
}

/* Tab Layout */
.tab-layout {
    height: var(--tabbar-height);
    min-height: var(--tabbar-height);
    background-color: var(--bg-actionbar);
    border-top: 1px solid var(--border-color);
    box-shadow: var(--elevation-1);
    z-index: 15;
    flex-shrink: 0;
    overflow: hidden;
}

.tabs-scroll {
    display: flex;
    height: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.tabs-scroll::-webkit-scrollbar {
    display: none;
}

.tab-item {
    padding: 0 14px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.tab-item.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent);
}

/* App Content */
.app-content {
    flex-grow: 1;
    position: relative;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Start screen */
.start-screen {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
}

.start-card {
    max-width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.start-icon-circle {
    width: 72px;
    height: 72px;
    background-color: rgba(33, 150, 243, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

.start-icon-circle i {
    width: 38px;
    height: 38px;
    stroke-width: 1.5;
}

.start-card h2 {
    font-size: 18px;
    font-weight: 500;
}

.start-card p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

.android-btn-primary {
    background-color: var(--accent);
    color: var(--text-primary);
    border: none;
    outline: none;
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 13px;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: var(--elevation-1);
    transition: var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.android-btn-primary:active {
    box-shadow: none;
    filter: brightness(0.9);
}

/* Channels Container */
.channel-list-wrapper {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 6px;
    -webkit-overflow-scrolling: touch;
}

.channels-container {
    display: grid;
    gap: 6px;
    width: 100%;
}

/* Grid View - Mobile optimized */
.channels-container.grid-view {
    grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
}

.channel-item-grid {
    background-color: var(--bg-card);
    border-radius: 4px;
    padding: 8px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    aspect-ratio: 1 / 1;
    cursor: pointer;
    text-align: center;
    position: relative;
    border: 1px solid transparent;
    transition: var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.channel-item-grid:active {
    background-color: var(--bg-card-active);
    border-color: var(--accent);
    transform: scale(0.96);
}

.channel-item-grid.active {
    border-color: var(--accent);
    background-color: var(--bg-card-active);
}

.channel-item-grid.is-locked::after {
    content: '';
    position: absolute;
    top: 3px;
    right: 3px;
    width: 12px;
    height: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b9daa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2' ry='2'%3E%3C/rect%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'%3E%3C/path%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.ch-logo-container {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

.ch-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ch-fallback-logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
}

.ch-name-grid {
    font-size: 11px;
    font-weight: 400;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    width: 100%;
    word-break: break-word;
}

/* List View */
.channels-container.list-view {
    grid-template-columns: 1fr;
    gap: 3px;
}

.channel-item-list {
    background-color: var(--bg-card);
    border-radius: 4px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    -webkit-tap-highlight-color: transparent;
    min-height: 52px;
}

.channel-item-list:active {
    background-color: var(--bg-card-active);
    border-color: var(--accent);
}

.channel-item-list.active {
    border-color: var(--accent);
    background-color: var(--bg-card-active);
}

.channel-item-list.is-locked::after {
    content: '';
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b9daa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2' ry='2'%3E%3C/rect%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'%3E%3C/path%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    margin-left: auto;
    flex-shrink: 0;
}

.list-ch-logo-container {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

.list-ch-texts {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-grow: 1;
    overflow: hidden;
    min-width: 0;
}

.ch-name-list {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ch-epg-list-desc {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-epg-progress {
    width: 50px;
    height: 2px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 1px;
    overflow: hidden;
    flex-shrink: 0;
}

.item-epg-progress-fill {
    height: 100%;
    background-color: var(--accent);
}

/* Navigation Drawer */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 95;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.drawer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.nav-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--drawer-width);
    max-width: 80%;
    height: 100%;
    background-color: var(--bg-app);
    box-shadow: var(--elevation-3);
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.nav-drawer.active {
    transform: translateX(0);
}

.drawer-header {
    background-color: var(--bg-actionbar);
    padding: 20px 16px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.drawer-logo {
    width: 44px;
    height: 44px;
    background-color: var(--accent);
    color: var(--text-primary);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--elevation-1);
}

.drawer-logo i {
    width: 24px;
    height: 24px;
}

.drawer-header-text .app-name {
    font-size: 16px;
    font-weight: 500;
}

.drawer-header-text .app-developer {
    font-size: 12px;
    color: var(--text-secondary);
}

.drawer-menu {
    padding: 8px 0;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow-y: auto;
}

.drawer-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    gap: 14px;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.drawer-item i {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.drawer-item:active {
    background-color: rgba(33, 150, 243, 0.1);
    color: var(--accent);
}

.drawer-item:active i {
    color: var(--accent);
}

.drawer-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 6px 0;
}

/* Dialogs */
.android-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.65);
    z-index: 150;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    padding: 16px;
}

.android-dialog-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.android-dialog {
    background-color: var(--bg-dialog);
    width: 100%;
    max-width: 360px;
    border-radius: 4px;
    box-shadow: var(--elevation-3);
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    max-height: 90vh;
}

.android-dialog-overlay.active .android-dialog {
    transform: scale(1);
}

.dialog-header {
    padding: 20px 20px 8px 20px;
}

.dialog-header h3 {
    font-size: 18px;
    font-weight: 500;
}

.dialog-subtext {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.4;
}

.dialog-body {
    padding: 0 20px 16px 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.dialog-footer {
    padding: 8px 12px 8px 8px;
    display: flex;
    justify-content: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.dialog-btn-text {
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font-family);
    font-size: 13px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.dialog-btn-text:active {
    background-color: rgba(255, 255, 255, 0.05);
}

.dialog-btn-text.text-cancel {
    color: var(--text-secondary);
}

.dialog-btn-text.text-ok {
    color: var(--accent);
}

/* Dialog Tabs */
.dialog-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 14px;
}

.dialog-tab-btn {
    flex-grow: 1;
    background: transparent;
    border: none;
    outline: none;
    padding: 8px 4px;
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 12px;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    text-transform: uppercase;
    -webkit-tap-highlight-color: transparent;
}

.dialog-tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.dialog-tab-content {
    display: none;
}

.dialog-tab-content.active {
    display: block;
}

/* Inputs */
.dialog-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.dialog-input-group label {
    font-size: 11px;
    color: var(--text-secondary);
}

.dialog-input-group input,
.dialog-input-group textarea {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-bottom: 2px solid #556778;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 14px;
    padding: 8px 10px;
    outline: none;
    border-radius: 2px;
    transition: var(--transition);
    width: 100%;
}

.dialog-input-group input:focus,
.dialog-input-group textarea:focus {
    border-bottom-color: var(--accent);
}

.dialog-input-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* File selector */
.dialog-file-selector {
    border: 2px dashed var(--border-color);
    background-color: var(--bg-input);
    padding: 20px;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    -webkit-tap-highlight-color: transparent;
}

.dialog-file-selector i {
    width: 28px;
    height: 28px;
    color: var(--accent);
}

.dialog-file-selector p {
    font-size: 12px;
    color: var(--text-secondary);
    word-break: break-all;
}

/* Settings */
.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
}

.settings-row-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.setting-title {
    font-size: 14px;
    font-weight: 500;
}

.setting-desc {
    font-size: 11px;
    color: var(--text-secondary);
}

.android-switch {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 18px;
    flex-shrink: 0;
}

.android-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-bar {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #4b5563;
    transition: .3s;
    border-radius: 9px;
}

.switch-bar:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

input:checked + .switch-bar {
    background-color: rgba(33, 150, 243, 0.5);
}

input:checked + .switch-bar:before {
    transform: translateX(16px);
    background-color: var(--accent);
}

.dialog-playlist-list {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    max-height: 150px;
    overflow-y: auto;
}

.dialog-playlist-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color);
}

.dialog-playlist-item:last-child {
    border-bottom: none;
}

/* Playlist row (drawer "Плейлисты" screen) */
.pl-row-texts {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-grow: 1;
    min-width: 0;
}

.pl-row-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: normal;
    word-break: break-word;
    line-height: 1.35;
}

.pl-row-sub {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: normal;
    word-break: break-all;
    line-height: 1.35;
}

.pl-row-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    margin-left: auto;
}

.btn-refresh-pl[disabled],
.btn-settings-refresh-pl[disabled] {
    opacity: 0.3;
    cursor: not-allowed;
}

.pl-name {
    font-size: 13px;
    white-space: normal;
    word-break: break-word;
    line-height: 1.35;
    flex-grow: 1;
    min-width: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.pl-name:active {
    color: var(--accent);
}

.pl-sub {
    font-size: 10px;
    color: var(--text-secondary);
    white-space: normal;
    word-break: break-all;
    line-height: 1.3;
    margin-top: 2px;
}

/* About */
.about-icon {
    width: 52px;
    height: 52px;
    background-color: var(--accent);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    margin: 0 auto 12px auto;
}

.about-icon i {
    width: 28px;
    height: 28px;
}

.about-version {
    font-size: 12px;
    color: var(--text-secondary);
}

.about-copyright {
    font-size: 10px;
    color: var(--text-secondary);
    margin: 12px 0 6px 0;
    line-height: 1.4;
}

.about-email {
    font-size: 11px;
}
.about-email a {
    color: var(--accent);
    text-decoration: none;
}

/* ========================================
   VIDEO PLAYER - YouTube Style
   ======================================== */
.video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000000;
    z-index: 200;
    display: flex;
    flex-direction: column;
}

.exoplayer-container {
    width: 100%;
    flex: 1;
    position: relative;
    background-color: #000;
    overflow: hidden;
    touch-action: pinch-zoom !important;
    cursor: default;
}

#web-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #000;
    touch-action: pinch-zoom !important;
}

/* Player HUD - YouTube Style */
.player-hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 210;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, transparent 40%, transparent 60%, rgba(0,0,0,0.4) 100%);
}

.exoplayer-container.hud-active .player-hud {
    opacity: 1;
    pointer-events: auto;
}

/* YouTube style top bar */
.hud-top {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.hud-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.2s;
    opacity: 0.9;
}

.hud-btn:hover {
    background: rgba(255,255,255,0.1);
}

.hud-btn:active {
    background: rgba(255,255,255,0.2);
    transform: scale(0.95);
}

.hud-btn i {
    width: 22px;
    height: 22px;
    stroke-width: 1.8;
}

.hud-channel-name {
    font-size: 16px;
    font-weight: 500;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
}

.hud-stream-type {
    background-color: rgba(255, 82, 82, 0.9);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 3px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    text-transform: uppercase;
}

/* YouTube style center play button */
.hud-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    flex: 1;
}

.hud-center-btn {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    width: 68px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    transform: scale(0.9);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.hud-center-btn:hover {
    transform: scale(1.05);
    background: rgba(255,255,255,0.25);
}

.hud-center-btn:active {
    transform: scale(0.85);
    background: rgba(255,255,255,0.1);
}

.hud-center-btn i {
    width: 32px;
    height: 32px;
    stroke-width: 2;
}

/* YouTube style bottom bar */
.hud-bottom {
    padding: 8px 16px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.hud-progress-container {
    width: 100%;
    padding: 4px 0;
    cursor: pointer;
    touch-action: none;
}

.hud-progress-bg {
    width: 100%;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
    transition: height 0.15s ease;
}

.hud-progress-bg:hover {
    height: 6px;
}

.hud-progress-fill {
    height: 100%;
    background-color: var(--accent);
    width: 0%;
    border-radius: 2px;
    transition: width 0.1s linear;
}

.hud-controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.hud-controls-left,
.hud-controls-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.hud-volume-slider {
    width: 60px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.25);
    height: 3px;
    border-radius: 2px;
    outline: none;
    transition: background 0.2s;
}

.hud-volume-slider:hover {
    background: rgba(255, 255, 255, 0.4);
}

.hud-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.hud-volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.hud-time {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
    font-variant-numeric: tabular-nums;
    min-width: 70px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
    font-weight: 400;
}

.hud-aspect-label {
    font-size: 9px;
    font-weight: 700;
    margin-left: 2px;
    color: rgba(255,255,255,0.8);
}

/* Spinner */
.player-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 205;
}

.android-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: exospin 0.8s infinite linear;
}

@keyframes exospin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Aspect ratios */
.exoplayer-container.aspect-4-3 #web-player { 
    object-fit: fill; 
    aspect-ratio: 4/3; 
}
.exoplayer-container.aspect-fit #web-player { 
    object-fit: fill; 
}
.exoplayer-container.aspect-crop #web-player { 
    object-fit: cover; 
}

/* EPG Bar - Mobile hidden by default */
.player-epg-bar {
    display: none;
}

/* ========================================
   SWIPE CHANNEL LIST PANEL - Transparent
   ======================================== */
.player-channel-panel {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 78%;
    max-width: 320px;
    z-index: 220;
    background-color: rgba(18, 27, 36, 0.75);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    overscroll-behavior: contain;
}

.player-channel-panel.open {
    transform: translateX(0);
    pointer-events: auto;
}

.player-channel-panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 18px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    min-height: 56px;
}

.player-channel-panel-header i {
    width: 20px;
    height: 20px;
    color: var(--accent);
}

.close-panel-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: auto;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.2s;
}

.close-panel-btn:hover {
    background: rgba(255,255,255,0.05);
}

.close-panel-btn:active {
    background: rgba(255,255,255,0.1);
}

.close-panel-btn i {
    width: 18px;
    height: 18px;
}

.player-channel-panel-list {
    flex: 1;
    overflow-y: auto !important;
    overflow-x: hidden;
    padding: 8px 6px 20px 6px;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    overscroll-behavior: contain;
}

.player-channel-panel-list::-webkit-scrollbar {
    width: 3px;
}

.player-channel-panel-list::-webkit-scrollbar-track {
    background: transparent;
}

.player-channel-panel-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.player-channel-panel-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s;
    background: rgba(255, 255, 255, 0.03);
    margin-bottom: 2px;
    border: 1px solid transparent;
}

.player-channel-panel-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.player-channel-panel-item:active {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(0.98);
}

.player-channel-panel-item.active {
    background-color: rgba(var(--accent-rgb), 0.2);
    border-color: rgba(var(--accent-rgb), 0.3);
}

.player-channel-panel-item.active .pcp-name {
    color: var(--accent);
}

.pcp-logo-container {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

.pcp-logo-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pcp-logo-fallback {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
}

.pcp-name {
    font-size: 14px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 400;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.player-channel-panel-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 215;
    background: transparent;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.player-channel-panel-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

/* ========================================
   ADD PLAYLIST - URL ROW
   ======================================== */
.url-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.url-input-row input {
    flex: 1;
    min-width: 0;
}

.url-download-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-input);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.url-download-btn:active {
    background-color: var(--bg-card-active);
}

.url-download-btn i {
    width: 18px;
    height: 18px;
}

.input-hint {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-top: 2px;
}

.tab-count {
    opacity: 0.65;
    font-size: 0.92em;
    margin-left: 2px;
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

/* Tablets and larger phones */
@media (min-width: 480px) {
    .channels-container.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .ch-name-grid {
        font-size: 12px;
    }
    
    .ch-logo-container {
        width: 50px;
        height: 50px;
    }
}

/* Desktops - show EPG bar */
@media (min-width: 768px) and (hover: hover) and (pointer: fine) {
    .video-overlay {
        flex-direction: row;
    }
    
    .exoplayer-container {
        flex: 1;
    }
    
    .player-epg-bar {
        display: flex;
        flex-direction: column;
        width: 280px;
        height: 100%;
        background-color: var(--bg-card);
        border-left: 1px solid var(--border-color);
        padding: 12px 14px;
        flex-shrink: 0;
    }
    
    .player-epg-header h3 {
        font-size: 13px;
        text-transform: uppercase;
        color: var(--accent);
        margin-bottom: 8px;
    }
    
    .player-epg-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
        overflow-y: auto;
        flex: 1;
        -webkit-overflow-scrolling: touch;
    }
    
    .epg-bar-item {
        background-color: rgba(255,255,255,0.02);
        border: 1px solid var(--border-color);
        padding: 8px 10px;
        border-radius: 4px;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }
    
    .epg-bar-item.active {
        background-color: rgba(33, 150, 243, 0.05);
        border-color: var(--accent);
    }
    
    .epg-bar-time {
        font-size: 11px;
        font-weight: 500;
        color: var(--accent);
    }
    
    .epg-bar-title {
        font-size: 12px;
        font-weight: 500;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .epg-bar-desc {
        font-size: 10px;
        color: var(--text-secondary);
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .channels-container.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

/* Large screens */
@media (min-width: 1024px) {
    .channels-container.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    
    .android-dialog {
        max-width: 400px;
    }
}

/* Safe area for notched phones */
@supports (padding: max(0px)) {
    .action-bar {
        padding-top: max(0px, env(safe-area-inset-top));
    }
    
    .video-overlay {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Mobile optimization for player */
@media (max-width: 480px) {
    .hud-center-btn {
        width: 60px;
        height: 60px;
    }
    .hud-center-btn i {
        width: 28px;
        height: 28px;
    }
    .hud-channel-name {
        font-size: 13px;
    }
    .hud-btn {
        width: 36px;
        height: 36px;
    }
    .hud-btn i {
        width: 18px;
        height: 18px;
    }
    .hud-volume-slider {
        width: 40px;
    }
    .hud-time {
        font-size: 10px;
        min-width: 60px;
    }
    
    /* Channel panel mobile */
    .player-channel-panel {
        width: 85%;
        max-width: 280px;
    }
    .player-channel-panel-item {
        padding: 8px 10px;
    }
    .pcp-name {
        font-size: 13px;
    }
    .pcp-logo-container {
        width: 30px;
        height: 30px;
    }
}

/* Utilities */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.hidden-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

/* ============================================
   MONETIZATION: Banner Ad + Premium dialog
   ============================================ */
.banner-ad-container {
    flex-shrink: 0;
    width: 100%;
    height: 50px;
    background: #121b24;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 50;
}

.banner-ad-container.hidden {
    display: none !important;
}

.banner-ad-label {
    color: var(--text-secondary);
    font-size: 11px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.premium-price {
    color: var(--accent);
    font-size: 28px;
    font-weight: 700;
    margin-top: 8px;
}