/* ═══════════════════════════════════════════════
   Home Dashboard — CapPlayer Android Design
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

#home-dashboard {
    --gold: #E2B84B;
    --gold-soft: #D4A843;
    --gold-glow: rgba(226,184,75,0.25);
    --gold-tint: rgba(226,184,75,0.06);
    --bg-deep: #06060E;
    --bg-primary: #0F0F1A;
    --surface: rgba(255,255,255,0.03);
    --surface-hover: rgba(255,255,255,0.06);
    --surface-elevated: #1E1E30;
    --glass-border: rgba(255,255,255,0.06);
    --text-primary: #F0EDE6;
    --text-secondary: rgba(240,237,230,0.5);
    --text-tertiary: rgba(240,237,230,0.28);
    --focus-color: #E2B84B;
    --status-info: #2196F3;
    --status-success: #4CAF50;
    --status-warning: #FF8C00;
    --status-critical: #FF4444;

    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    display: flex;
    font-family: 'Inter', -apple-system, 'Segoe UI', Arial, sans-serif;
    color: var(--text-primary);
}

/* Background layers (violet bg + dark overlay) */
.hd-bg-image {
    position: absolute;
    inset: 0;
    background: url('../images/background_violet.png') center/cover no-repeat;
    z-index: 0;
}
.hd-bg-overlay {
    position: absolute;
    inset: 0;
    background: rgba(4,2,10,0.75);
    z-index: 1;
}

/* ─── Left Sidebar ─── */
.hd-sidebar {
    width: 78px;
    min-width: 78px;
    height: 100vh;
    background: linear-gradient(180deg, rgba(8,4,20,0.88) 0%, rgba(4,2,10,0.95) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0 10px;
    z-index: 10;
    transition: width 0.2s ease, min-width 0.2s ease;
    overflow: hidden;
    border-right: 1px solid var(--glass-border);
}
.hd-sidebar.expanded {
    width: 180px;
    min-width: 180px;
}
.hd-sidebar-logo {
    height: 36px;
    margin-bottom: 22px;
    flex-shrink: 0;
    padding: 0 10px;
    transition: height 0.2s;
    object-fit: contain;
}
.hd-sidebar.expanded .hd-sidebar-logo {
    height: 38px;
}
.hd-sidebar-menu {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
    padding: 0 6px;
}

/* Sidebar menu item */
.hd-menu-item {
    display: flex;
    align-items: center;
    height: 44px;
    min-height: 44px;
    cursor: pointer;
    transition: all 0.15s;
    border-left: 3px solid transparent;
    border-radius: 10px;
    justify-content: center;
    gap: 0;
    position: relative;
    margin-bottom: 1px;
}
.hd-sidebar.expanded .hd-menu-item {
    justify-content: flex-start;
    padding: 0 10px;
    gap: 10px;
}
.hd-menu-item-icon {
    font-size: 18px;
    color: var(--text-secondary);
    width: 22px;
    text-align: center;
    flex-shrink: 0;
    transition: color 0.15s;
}
.hd-menu-item-label {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 400;
    white-space: nowrap;
    display: none;
    transition: color 0.15s;
}
.hd-sidebar.expanded .hd-menu-item-label {
    display: block;
}
.hd-menu-item.active {
    background: var(--gold-tint);
    border-left-color: var(--gold);
}
.hd-menu-item.active .hd-menu-item-icon {
    color: var(--gold);
}
.hd-menu-item.active .hd-menu-item-label {
    color: var(--text-primary);
}
.hd-menu-item.focused {
    background: rgba(255,255,255,0.08);
    border-left-color: var(--focus-color);
}
.hd-menu-item.focused .hd-menu-item-icon,
.hd-menu-item.focused .hd-menu-item-label {
    color: #fff;
}

/* Sidebar separator */
.hd-menu-separator {
    height: 1px;
    background: var(--glass-border);
    margin: 6px 12px;
}

/* ─── Main Content Area ─── */
.hd-main {
    flex: 1;
    height: 100vh;
    position: relative;
    overflow: hidden;
    z-index: 2;
}

/* ─── Content scrollable ─── */
.hd-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    bottom: 0;
    overflow-y: hidden;
    padding: 0 0 20px 0;
}

/* ─── Header Row (Android TvHeaderView style) ─── */
.hd-header-row {
    display: flex;
    align-items: center;
    height: 44px;
    padding: 0 20px;
    border-bottom: 1px solid var(--glass-border);
    gap: 0;
    flex-shrink: 0;
}
.hd-header-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 12px;
}
.hd-header-label {
    font-size: 10px;
    color: var(--text-tertiary);
    text-decoration: underline;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.hd-header-value {
    font-size: 11px;
    color: var(--text-primary);
    font-family: 'Inter', monospace;
}
.hd-header-divider {
    width: 1px;
    height: 20px;
    background: var(--glass-border);
    flex-shrink: 0;
}
.hd-header-row .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--status-success);
    display: inline-block;
    flex-shrink: 0;
}
.hd-header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
    text-align: right;
}
.hd-header-clock {
    font-size: 20px;
    font-weight: 300;
    color: var(--text-primary);
}
.hd-header-date {
    font-size: 11px;
    color: var(--text-tertiary);
}

/* ─── Info/Demo Banner (below header, like Android) ─── */
.hd-info-banner {
    display: none;
    margin: 10px 16px 4px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(33,150,243,0.08);
    border: 1px solid rgba(33,150,243,0.15);
}
.hd-info-banner.visible {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.hd-banner-left {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.hd-banner-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--status-info);
    margin-bottom: 2px;
}
.hd-banner-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
}
.hd-info-banner.demo {
    background: rgba(33,150,243,0.08);
    border-color: rgba(33,150,243,0.15);
}
.hd-info-banner.demo .hd-banner-title { color: var(--status-info); }
.hd-info-banner.expired {
    background: rgba(255,68,68,0.08);
    border-color: rgba(255,68,68,0.15);
}
.hd-info-banner.expired .hd-banner-title { color: var(--status-critical); }
.hd-info-banner.warning {
    background: rgba(255,140,0,0.08);
    border-color: rgba(255,140,0,0.15);
}
.hd-info-banner.warning .hd-banner-title { color: var(--status-warning); }

/* ─── Section ─── */
.hd-section {
    margin-bottom: 16px;
    padding-left: 24px;
    padding-bottom: 4px;
}
.hd-section-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    gap: 8px;
}
.hd-section-title {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}
/* Section tabs (replaces See All) */
.hd-section-tabs {
    display: flex;
    gap: 6px;
    margin-left: 12px;
    overflow: visible;
    flex: 1;
    padding: 4px 0;
}
.hd-section-tab {
    padding: 8px 20px;
    font-size: 13px;
    color: rgba(240,237,230,0.5);
    background: rgba(255,255,255,0.04);
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
    flex-shrink: 0;
}
.hd-section-tab.active {
    color: var(--gold);
    background: rgba(226,184,75,0.12);
    font-weight: 700;
}
.hd-section-tab.focused {
    color: var(--gold);
    background: rgba(226,184,75,0.18);
    font-weight: 700;
    transform: scale(1.06);
    border: 2px solid var(--gold);
    box-shadow: 0 0 8px rgba(226,184,75,0.3);
}

/* ─── Rail ─── */
.hd-rail-wrap {
    overflow: clip visible;
    padding: 0 24px 0 0;
}
.hd-rail {
    display: flex;
    gap: 16px;
    padding: 14px 14px 14px 6px;
    transition: transform 0.25s ease-out;
}

/* ─── Card base ─── */
.hd-card {
    flex-shrink: 0;
    overflow: visible;
    border: 2.5px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}
.hd-card.active {
    border-color: var(--focus-color);
    transform: scale(1.08);
    z-index: 5;
    box-shadow: 0 6px 25px rgba(0,0,0,0.5), 0 0 12px rgba(226,184,75,0.15);
}

/* ─── Channel card (circular logo, like Android) ─── */
.hd-card-channel {
    width: 95px;
    background: transparent;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 4px 4px;
}
.hd-card-channel .hd-card-img-wrap {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.hd-card-channel .hd-card-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}
.hd-card-channel .hd-card-name {
    color: rgba(255,255,255,0.7);
    font-size: 11px;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    width: 100%;
}
.hd-card-channel.active {
    background: rgba(255,255,255,0.06);
}
.hd-card-channel.active .hd-card-name {
    color: #fff;
    font-weight: 600;
}

/* ─── Movie card (poster) ─── */
.hd-card-movie {
    width: 125px;
    height: 210px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--glass-border);
}
.hd-card-movie .hd-card-img {
    width: 100%;
    height: 178px;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
}
.hd-card-movie .hd-card-name {
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}
.hd-card-movie .hd-card-rating {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0,0,0,0.66);
    color: #FFD700;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 2px;
}
.hd-card-movie.active {
    border-color: var(--focus-color);
}

/* ─── Series card ─── */
.hd-card-series {
    width: 125px;
    height: 210px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--glass-border);
}
.hd-card-series .hd-card-img {
    width: 100%;
    height: 178px;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
}
.hd-card-series .hd-card-name {
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}
.hd-card-series.active {
    border-color: var(--focus-color);
}

/* ─── Replay card (circular like channel) ─── */
.hd-card-replay {
    width: 95px;
    background: transparent;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 4px 4px;
}
.hd-card-replay .hd-card-img-wrap {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}
.hd-card-replay .hd-card-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}
.hd-card-replay .hd-card-name {
    color: rgba(255,255,255,0.7);
    font-size: 11px;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    width: 100%;
}
.hd-card-replay .hd-card-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: var(--status-success);
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hd-card-replay.active {
    background: rgba(255,255,255,0.06);
}
.hd-card-replay.active .hd-card-name {
    color: #fff;
}

/* ─── Watch Progress Bar ─── */
.hd-card-progress {
    position: absolute;
    bottom: 22px;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255,255,255,0.15);
}
.hd-card-progress-bar {
    height: 100%;
    background: #E2B84B;
    border-radius: 0 2px 2px 0;
    transition: width 0.3s;
}
.hd-card-continue {
    position: absolute;
    bottom: 26px;
    left: 5px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(226,184,75,0.9);
    color: #06060E;
    font-size: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ─── Placeholders ─── */
.hd-card-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, rgba(30,30,60,0.6), rgba(20,20,45,0.6));
    color: rgba(255,255,255,0.08);
    font-size: 24px;
}
.hd-card-channel .hd-card-img-placeholder,
.hd-card-replay .hd-card-img-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}
.hd-card-movie .hd-card-img-placeholder,
.hd-card-series .hd-card-img-placeholder {
    width: 100%;
    height: 178px;
    border-radius: 8px 8px 0 0;
}

/* ─── Embedded Content Page (beta mode sidebar persistence) ─── */
#cp-content-page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    overflow: hidden;
}
