/* =============================================================
   helloAnime — components.css
   Extra component styles supplementing style.css
   ============================================================= */

/* Player  */
.player-section {
    background: #000;
    position: sticky;
    top: 0;
    z-index: 50;
}

.player-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 72vh;
    background: #000;
    overflow: hidden;
}

.player-container iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.server-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    min-height: 48px;
}

.server-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.server-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.server-tab:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.server-tab.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
}

.ep-nav-controls {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-sm {
    padding: 5px 14px;
    font-size: 0.82rem;
}

/* Episode info Bar */
.episode-info-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.ep-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    flex-wrap: wrap;
}

.ep-breadcrumb a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
}

.ep-breadcrumb a:hover {
    text-decoration: underline;
}

.ep-breadcrumb .sep {
    color: var(--border);
}

.badge-filler {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
    border: 1px solid rgba(234, 179, 8, 0.3);
    font-size: 0.5rem;
    font-weight: 700;
    padding: 2px 4px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-recap {
    background: rgba(100, 116, 139, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(100, 116, 139, 0.3);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Download Section */
.download-section {
    border-top: 1px solid var(--border);
    background: var(--bg-surface);
}

.download-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    cursor: pointer;
    user-select: none;
    font-size: 0.9rem;
    transition: background 0.15s;
}

.download-header:hover {
    background: var(--bg-elevated);
}

.download-body {
    padding: 4px 24px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-elevated);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.15s;
}

.download-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(var(--accent-rgb), 0.08);
}

.download-quality {
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--accent-primary);
}

.download-size {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: auto;
}

/* Anime Detail */
.anime-detail-container {
    padding: 32px 24px;
}

.anime-detail-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 8px;
    align-items: start;
}

.anime-poster-col {
    position: sticky;
    top: 80px;
}

.anime-detail-poster {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: 12px;
    display: block;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.anime-quick-stats {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 14px;
    font-size: 0.82rem;
    border-bottom: 1px solid var(--border);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    color: var(--text-muted);
}

.stat-value {
    font-weight: 600;
    text-align: right;
    max-width: 60%;
}

.anime-info-col {}

.anime-detail-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 8px;
}

.anime-detail-title .native-title {
    display: block;
    font-size: 1rem;
    font-family: 'DM Sans', sans-serif;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 4px;
}

.genre-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}

.genre-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid var(--border);
    font-size: 0.78rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.15s;
}

.genre-pill:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(var(--accent-rgb), 0.08);
}

.anime-synopsis {
    font-size: 0.9rem;
    line-height: 1.75;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.anime-synopsis.collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.synopsis-toggle {
    background: none;
    border: none;
    color: var(--accent-primary);
    cursor: pointer;
    font-size: 0.875rem;
    padding: 0;
    font-weight: 600;
}

.synopsis-toggle:hover {
    text-decoration: underline;
}

.trailer-embed-wrap {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #000;
    aspect-ratio: 16/9;
    position: relative;
    cursor: pointer;
}

.trailer-embed-wrap .trailer-thumb {
    position: absolute;
    inset: 0;
    object-fit: cover;
    width: 100%;
    height: 100%;
}

.trailer-embed-wrap .play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    transition: background 0.2s;
}

.trailer-embed-wrap:hover .play-overlay {
    background: rgba(0, 0, 0, 0.25);
}

.play-icon {
    width: 64px;
    height: 64px;
    background: var(--accent-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 24px rgba(var(--accent-rgb), 0.5);
}

.trailer-embed-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Episode List */
.episodes-section {
    padding: 0 24px 32px;
}

.episodes-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 24px 0 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.ep-filter-tabs {
    display: flex;
    gap: 4px;
}

.ep-filter-tab {
    padding: 6px 16px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s;
}

.ep-filter-tab.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
}

.ep-filter-tab:hover:not(.active) {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.ep-search {
    padding: 7px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-size: 0.875rem;
    width: 220px;
    outline: none;
    transition: border-color 0.15s;
}

.ep-search:focus {
    border-color: var(--accent-primary);
}

.ep-search::placeholder {
    color: var(--text-muted);
}

.episodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.ep-load-more-wrap {
    text-align: center;
    padding: 24px 0 8px;
}

/* Archive Header */
.archive-header {
    padding: 40px 24px 24px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.08) 0%, transparent 100%);
}

.archive-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.archive-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    max-width: 600px;
    line-height: 1.6;
}

.browse-sort-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
    gap: 12px;
    flex-wrap: wrap;
}

/* Card */
.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.card:hover {
    border-color: rgba(var(--accent-rgb), 0.4);
}

/* Search Results */
.search-results-header {
    padding: 32px 24px 16px;
    border-bottom: 1px solid var(--border);
}

.search-results-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
}

.search-results-count {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Related Section */
.related-section {
    padding: 0 24px 32px;
    border-top: 1px solid var(--border);
}

/* Score Badge colours */
.score-badge-great {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.3);
}

.score-badge-good {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.3);
}

.score-badge-ok {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
    border-color: rgba(234, 179, 8, 0.3);
}

.score-badge-bad {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.score-badge-none {
    background: var(--bg-elevated);
    color: var(--text-muted);
    border-color: var(--border);
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 80px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 260px;
    max-width: 360px;
    padding: 12px 18px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-size: 0.875rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: slideInRight 0.25s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.toast-success {
    border-color: rgba(34, 197, 94, 0.4);
}

.toast.toast-error {
    border-color: rgba(239, 68, 68, 0.4);
}

.toast.toast-info {
    border-color: rgba(59, 130, 246, 0.4);
}

.toast.fading-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(40px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Utilities */
.mono {
    font-family: 'JetBrains Mono', monospace;
}

.text-muted {
    color: var(--text-muted);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
}

.view-all {
    font-size: 0.82rem;
    color: var(--accent-primary);
    text-decoration: none;
}

.view-all:hover {
    text-decoration: underline;
}

.form-select {
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    outline: none;
}

.form-select:focus {
    border-color: var(--accent-primary);
}

/* Social Sharing Modal */
.ha-share-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ha-share-overlay.is-active {
    display: flex;
    opacity: 1;
}

.ha-share-modal-container {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
    padding: 32px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.ha-share-overlay.is-active .ha-share-modal-container {
    transform: translateY(0);
}

.ha-share-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.ha-share-close:hover {
    color: var(--text-primary);
    border-color: var(--accent-primary);
    background: var(--bg-surface);
}

.ha-share-header {
    text-align: center;
    margin-bottom: 24px;
}

.ha-share-icon-main {
    width: 64px;
    height: 64px;
    background: rgba(var(--accent-rgb), 0.1);
    color: var(--accent-primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.ha-share-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.ha-share-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.ha-share-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.ha-share-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s;
}

.ha-share-btn:hover {
    color: var(--text-primary);
    transform: translateY(-2px);
}

.ha-share-btn-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.ha-share-btn:hover .ha-share-btn-icon {
    border-color: var(--accent-primary);
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.2);
}

/* Provider Colors */
.ha-share-btn-icon.facebook {
    color: #1877F2;
}

.ha-share-btn-icon.twitter {
    color: #1DA1F2;
}

.ha-share-btn-icon.reddit {
    color: #FF4500;
}

.ha-share-btn-icon.whatsapp {
    color: #25D366;
}

.ha-share-btn-icon.telegram {
    color: #0088cc;
}

.ha-share-btn-icon.copy {
    color: var(--accent-primary);
}

.ha-share-footer {
    border-top: 1px solid var(--border);
    padding-top: 24px;
}

.ha-share-link-box {
    display: flex;
    gap: 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 4px;
}

.ha-share-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    padding: 8px 12px;
    font-size: 0.85rem;
    outline: none;
    width: 100%;
}

.ha-share-copy-action {
    background: var(--accent-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0 16px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.ha-share-copy-action:hover {
    opacity: 0.9;
}

/* Share Trigger Button */
.btn-share {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-share:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: var(--bg-surface);
}

/* Watch Party */
.btn-watch-party {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    background: rgba(var(--accent-rgb), 0.1);
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-watch-party:hover {
    background: var(--accent-primary);
    color: #fff;
}

.watch-party-status-bar {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 20px;
    margin: 10px;
    box-shadow: var(--shadow-card);
}

.party-status-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

@media (max-width: 576px) {
    .watch-party-status-bar {
        padding: 12px 16px;
    }

    .party-status-inner {
        gap: 10px;
    }

    #party-info-text {
        width: 100%;
        order: 3;
        font-size: 0.85rem;
        margin-top: 4px;
    }
}

.party-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
    transition: var(--transition);
}

.party-badge-active {
    background: var(--bg-success);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.party-badge-scheduled {
    background: #f59e0b;
    /* Amber */
}

.party-badge-expired {
    background: var(--danger);
}

.role-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-right: 4px;
}

.role-badge-host {
    background: rgba(var(--accent-rgb), 0.15);
    color: var(--accent-primary);
    border: 1px solid rgba(var(--accent-rgb), 0.3);
}

.role-badge-guest {
    background: rgba(var(--text-muted-rgb), 0.1);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.party-user-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.party-user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
}

.party-user-icon {
    color: var(--text-muted);
    opacity: 0.7;
}

.party-host-star {
    color: var(--accent-primary);
    margin-left: 4px;
    font-size: 0.9em;
}

.party-user-name {
    font-weight: 700;
    color: var(--text-primary);
}

#party-info-text {
    font-size: 0.9rem;
    color: var(--text-primary);
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-leave-party {
    background: rgba(var(--danger-rgb), 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-leave-party:hover {
    background: var(--danger);
    color: #fff;
}

/* Scheduling Overlay */
.ep-wp-lock {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    border-radius: var(--radius-md);
}

.ep-wp-lock-inner {
    max-width: 320px;
    padding: 20px;
}

.ep-wp-lock-icon {
    margin-bottom: 20px;
    color: var(--accent-primary);
    animation: pulse 2s infinite;
}

.ep-wp-lock-title {
    font-size: 1.5rem;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    margin-bottom: 10px;
}

.ep-wp-lock-line {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 15px;
}

.ep-wp-lock-countdown {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--accent-primary);
    letter-spacing: -1px;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Generic Modal System */
.ha-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ha-modal.is-active {
    display: flex;
}

.ha-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

.ha-modal-container {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 10;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: modal-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ha-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ha-modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    font-family: 'Rajdhani', sans-serif;
    color: var(--text-primary);
    margin: 0;
}

.ha-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.ha-modal-close:hover {
    color: var(--danger);
}

.ha-modal-body {
    padding: 24px;
}

/* Watch Party Chat */
.wp-chat-sidebar {
    position: fixed;
    right: -350px;
    top: 0;
    bottom: 0;
    width: 320px;
    background: var(--bg-surface);
    border-left: 1px solid var(--border);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3);
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.wp-chat-sidebar.is-active {
    right: 0;
}

.wp-chat-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wp-chat-header h3 {
    font-size: 1.1rem;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    margin: 0;
}

.btn-close-chat {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.wp-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-msg {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 85%;
}

.chat-msg-user {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.chat-msg-text {
    background: var(--bg-elevated);
    padding: 8px 12px;
    border-radius: 12px;
    border-top-left-radius: 2px;
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.chat-msg-mine {
    align-self: flex-end;
}

.chat-msg-mine .chat-msg-user {
    align-self: flex-end;
    color: var(--text-secondary);
}

.chat-msg-mine .chat-msg-text {
    background: var(--accent-primary);
    color: #fff;
    border-top-left-radius: 12px;
    border-top-right-radius: 2px;
}

.chat-system-msg {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    background: rgba(var(--accent-rgb), 0.05);
    padding: 4px 12px;
    border-radius: 20px;
    margin: 8px 0;
}

.wp-chat-input-area {
    padding: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
}

#wp-chat-input {
    flex: 1;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 8px 16px;
    color: var(--text-primary);
    font-size: 0.9rem;
}

#wp-chat-send {
    background: var(--accent-primary);
    color: #fff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

#wp-chat-send:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-accent);
}

/* Toggle Button */
.btn-toggle-chat {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: #fff;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10000;
    transition: var(--transition);
}

.btn-toggle-chat:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.chat-unread-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: var(--danger);
    border: 2px solid #fff;
    border-radius: 50%;
}

/* ── Comments Enhanced ───────────────────────────────── */
.ha-comments {
    margin-top: 40px;
    padding: 32px 24px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
}

.ha-comment-reputation {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 6px;
}

.ha-badge-gold {
    background: linear-gradient(135deg, #fbbf24, #d97706);
    color: #000;
    border: none;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3);
}

.ha-badge-silver {
    background: linear-gradient(135deg, #cbd5e1, #94a3b8);
    color: #000;
    border: none;
}

.ha-badge-bronze {
    background: linear-gradient(135deg, #d97706, #92400e);
    color: #fff;
    border: none;
}

.ha-badge-pro {
    background: var(--accent-primary);
    color: #fff;
    border: none;
    box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.3);
}

.ha-badge-newbie {
    background: var(--bg-elevated);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.ha-comment-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    gap: 16px;
    flex-wrap: wrap;
    border-top: 1px solid rgba(var(--accent-rgb), 0.05);
    padding-top: 12px;
}

.ha-comment-reactions {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* ── Trigger button ───────────────────────────────────────────── */
.ha-reaction-trigger {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-pill, 999px);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
    line-height: 1;
    user-select: none;
}
.ha-reaction-trigger:hover {
    background: rgba(var(--accent-rgb), 0.08);
    border-color: rgba(var(--accent-rgb), 0.28);
    color: var(--text-primary);
}
.ha-reaction-trigger.has-reaction {
    background: rgba(var(--accent-rgb), 0.12);
    border-color: rgba(var(--accent-rgb), 0.4);
    color: var(--accent-primary);
}

/* Show SVG icon when idle, emoji when reacted */
.ha-reaction-trigger .ha-reaction-default-icon { display: flex; align-items: center; }
.ha-reaction-trigger .ha-reaction-active-emoji { display: none; font-size: 0.95rem; }
.ha-reaction-trigger.has-reaction .ha-reaction-default-icon { display: none; }
.ha-reaction-trigger.has-reaction .ha-reaction-active-emoji { display: inline; }

.ha-reaction-trigger-label { line-height: 1; }

.ha-reaction-total {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
}
.ha-reaction-trigger.has-reaction .ha-reaction-total {
    color: rgba(var(--accent-rgb), 0.75);
}
.ha-reaction-top-emojis {
    font-size: 0.82rem;
    letter-spacing: -0.04em;
    line-height: 1;
}
.ha-reaction-num {
    line-height: 1;
}

/* ── Floating emoji picker ────────────────────────────────────── */
.ha-reaction-dropdown {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 0;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    padding: 8px 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.14);
    z-index: 200;
    /* caret */
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px) scale(0.86);
    transform-origin: bottom left;
    transition: opacity 0.16s ease, transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ha-reaction-dropdown::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 20px;
    width: 10px;
    height: 10px;
    background: var(--bg-elevated);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    transform: rotate(45deg);
}
.ha-comment-reactions.is-open .ha-reaction-dropdown {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

/* ── Individual emoji buttons ─────────────────────────────────── */
.ha-reaction-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 2px solid transparent;
    border-radius:5px;
    padding: 1px 6px;
    min-width: 46px;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
                background 0.15s, border-color 0.15s;
    user-select: none;
}
.ha-reaction-btn:hover {
    transform: scale(1.35) translateY(-4px);
    background: rgba(var(--accent-rgb), 0.08);
}
.ha-reaction-btn.is-active {
    background: rgba(var(--accent-rgb), 0.15);
    border-color: rgba(var(--accent-rgb), 0.45);
}
.ha-reaction-btn.is-active .ha-reaction-emoji {
    filter: drop-shadow(0 0 6px rgba(var(--accent-rgb), 0.7));
}

.ha-reaction-emoji {
    font-size: 0.95rem;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}
.ha-reaction-count {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    min-height: 0.9em;
    line-height: 1;
}
.ha-reaction-btn.is-active .ha-reaction-count { color: var(--accent-primary); }

/* ── Modern Comment Form (Image Match) ────────────────── */
.ha-comment-submit-row {
    display: flex;
    justify-content: flex-start;
    margin-top: 15px;
    position: relative;
}

.ha-comment-input-wrap {
    flex: 1;
}

.ha-comment-textarea-container {
    position: relative;
    background: var(--bg-surface);
    border: 2px solid var(--border);
    border-radius: 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ha-comment-textarea-container:focus-within {
    border-color: #3B82F6;
    /* Standard Blue as per image */
    box-shadow: 0 0 0 1px #3B82F6;
}

.ha-comment-emoji-trigger {
    position: absolute;
    right: 12px;
    bottom: 12px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: transform 0.2s;
}

.ha-comment-emoji-trigger:hover {
    transform: scale(1.1);
}

.ha-comment-textarea {
    width: 100%;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 16px 40px 16px 16px !important;
    /* Padding-right for emoji trigger */
    margin: 0 !important;
    min-height: 80px !important;
    resize: vertical;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.5;
}

.ha-comment-submit-btn {
    background: #2563EB !important;
    /* Deep Blue as per image */
    color: #fff !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    border: none !important;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex !important;
    align-items: center;
    gap: 10px;
}

.ha-comment-submit-btn:hover {
    background: #1D4ED8 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.ha-emoji-picker-popover {
    position: absolute;
    top: 55px;
    /* Open to the bottom */
    right: 10px;
    z-index: 99999;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    width: 320px;
    height: 320px;
    /* Reduced height */
    display: flex;
    flex-direction: column;
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.ha-emoji-picker-popover.hidden {
    display: none !important;
}

/* Style the custom element using theme variables */
emoji-picker {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    --num-columns: 8;
    --category-emoji-size: 1.1rem;
    --emoji-size: 1.3rem;

    /* Theme Color Mapping */
    --background: var(--bg-surface);
    --border-color: var(--border);
    --button-hover-background: var(--bg-elevated);
    --indicator-color: var(--accent-primary);
    --input-border-color: var(--border);
    --input-font-color: var(--text-primary);
    --input-placeholder-color: var(--text-muted);
    --outline-color: var(--accent-primary);
    --category-font-color: var(--text-secondary);

    /* Thin Scrollbar Styling */
    scrollbar-width: thin;
    --scrollbar-color: var(--border);
    --scrollbar-background: transparent;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ensure no clipping from any form elements */
.ha-comment-form,
.ha-comment-submit-row {
    overflow: visible !important;
}

.ha-comment-share {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    background: var(--bg-elevated);
    border: 1px solid rgba(var(--accent-rgb), 0.35);
    color: var(--text-secondary) !important;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    min-height: 30px;
    padding: 1px 5px;
}

.ha-comment-share:hover {
    background: rgba(var(--accent-rgb), 0.18);
    border-color: var(--accent-primary);
    color: var(--accent-primary) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(var(--accent-rgb), 0.22);
}

.ha-comment-share svg, .comment-reply-link svg {
    color: var(--accent-primary);
}

.comment-reply-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 50%;
    transition: var(--transition);
    text-decoration: none !important;
}

.comment-reply-link:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: var(--bg-surface);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.2);
}

.comment-reply-link svg {
    width: 16px;
    height: 16px;
}

/* Login Notice */
.ha-comment-login-notice {
    text-align: center;
    padding: 40px 20px;
    background: var(--bg-surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    margin: 20px 0;
}

.ha-comment-login-notice p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 1rem;
}

.ha-comment-login-btn {
    display: inline-block;
    background: var(--accent-primary);
    color: #fff;
    padding: 12px 32px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
}

.ha-comment-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.ha-giphy-search-wrap {
    padding: 16px;
    background: rgba(var(--accent-rgb), 0.03);
    border-bottom: 1px solid var(--border);
}

.ha-giphy-search-wrap input {
    width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 16px;
    color: var(--text-primary);
    outline: none;
    font-size: 0.95rem;
}

.ha-giphy-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
    padding: 12px;
    max-height: 300px;
    overflow-y: auto;
}

.ha-gif-item {
    cursor: pointer;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--bg-elevated);
    border: 2px solid transparent;
    transition: var(--transition);
}

.ha-gif-item:hover {
    border-color: var(--accent-primary);
    transform: scale(1.02);
}

.ha-gif-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Highlights */
.ha-comment-new {
    animation: ha-comment-glow 4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes ha-comment-glow {
    0% {
        background: rgba(var(--accent-rgb), 0.2);
        box-shadow: 0 0 0 2px var(--accent-primary);
    }

    100% {
        background: transparent;
        box-shadow: none;
    }
}

/* Share Modal Styles */
.ha-share-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.ha-share-modal-overlay.is-active {
    opacity: 1;
    pointer-events: auto;
}

.ha-share-modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    width: 100%;
    max-width: 420px;
    padding: 32px;
    transform: translateY(20px);
    transition: var(--transition);
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.6);
}

.ha-share-modal-overlay.is-active .ha-share-modal-card {
    transform: translateY(0);
}

.ha-share-modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.ha-share-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--text-primary), var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ha-share-modal-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.ha-share-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
}

/* ── Sharing Modal ─────────────────────────────────────── */
.ha-share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.ha-share-modal-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.ha-share-modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    width: 100%;
    max-width: 450px;
    padding: 32px;
    transform: scale(0.9);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.ha-share-modal-overlay.is-active .ha-share-modal-card {
    transform: scale(1);
}

.ha-share-modal-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ha-share-modal-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 24px;
}

.ha-share-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-decoration: none !important;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
}

.ha-share-item:hover {
    transform: translateY(-4px);
    color: var(--accent-primary);
}

.ha-share-icon-wrap {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.ha-share-item:hover .ha-share-icon-wrap {
    border-color: var(--accent-primary);
    background: rgba(var(--accent-rgb), 0.1);
    box-shadow: 0 8px 20px rgba(var(--accent-rgb), 0.2);
}

.ha-share-copy-row {
    display: flex;
    gap: 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 4px;
    margin-top: 16px;
}

.ha-share-copy-input {
    flex: 1;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 8px 12px;
    font-size: 0.85rem;
    color: var(--text-primary);
    width: 100%;
}

.ha-share-copy-btn {
    background: var(--accent-primary);
    color: #fff;
    padding: 0 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
}

.ha-share-copy-btn:hover {
    background: var(--accent-glow);
}

/* ── Community Hub ─────────────────────────────────────── */
.ha-community-grid {
    margin-top: 20px;
}

.ha-community-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-card);
}

.ha-community-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(var(--accent-rgb), 0.1);
}

.ha-community-card-header {
    background: rgba(var(--accent-rgb), 0.02);
    padding: 16px 20px;
}

.ha-community-card-body {
    padding: 20px;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.ha-community-card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: rgba(var(--accent-rgb), 0.04);
}

.ha-community-card .ha-avatar img {
    border: 2px solid var(--bg-surface);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.ha-community-card .ha-comment-text {
    position: relative;
}

.ha-community-card .ha-comment-text::before {
    content: '"';
    position: absolute;
    left: -15px;
    top: -10px;
    font-size: 3rem;
    color: rgba(var(--accent-rgb), 0.1);
    font-family: serif;
    pointer-events: none;
}

.ha-community-card .ha-badge-gold {
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.4);
}

#ha-emoji-group {
    width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 12px;
    color: var(--text-primary);
    outline: none;
    font-size: 0.9rem;
    cursor: pointer;
}

.ha-emoji-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
    gap: 8px;
    padding: 12px;
    max-height: 250px;
    overflow-y: auto;
}

.ha-emoji-item {
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition);
}

.ha-emoji-item:hover {
    background: rgba(var(--accent-rgb), 0.1);
    transform: scale(1.15);
}

/* ── Global Modal System ─────────────────────────────────── */
.ha-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    padding: 20px;
}

.ha-modal.is-active {
    opacity: 1;
    visibility: visible;
}

.ha-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.ha-modal-container {
    position: relative;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    width: 100%;
    max-width: 480px;
    z-index: 10001;
    transform: scale(0.9) translateY(20px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.ha-modal.is-active .ha-modal-container {
    transform: scale(1) translateY(0);
}

.ha-modal-close {
    position: absolute;
    top: 1px;
    right: 2px;
    width: 32px;
    height: 32px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10002;
    transition: var(--transition);
    font-size: 20px;
}

.ha-modal-close:hover {
    background: var(--accent-primary);
    color: #fff;
    transform: rotate(90deg);
}

/* ── Unified Auth Modal ─────────────────────────────────────── */
.ha-auth-container {
    background: var(--bg-surface);
}

.ha-auth-tabs {
    display: flex;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: 4px;
    border-radius: var(--radius-md);
    max-width: 100%;
    margin: 0 auto;
}

.ha-auth-tab {
    flex: 1;
    padding: 4px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    border-radius: var(--radius-sm);
}

.ha-auth-tab.is-active {
    color: var(--text-primary);
    background: var(--bg-surface);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ha-auth-content {
    padding: 20px 40px 40px;
}

.ha-auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.ha-auth-header h3 {
    font-size: 1.75rem;
    margin-bottom: 8px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.ha-auth-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.ha-auth-form {
    display: none;
}

.ha-auth-form.is-active {
    display: block;
    animation: authFadeIn 0.4s ease;
}

.ha-form-group {
    margin-bottom: 5px;
}

.ha-form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ha-input {
    width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--text-primary);
    font-family: inherit;
    transition: var(--transition);
}

.ha-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-surface);
    box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.1);
}

.ha-auth-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 0.9rem;
}

.ha-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-secondary);
}

.ha-lost-password {
    color: var(--accent-primary);
    font-weight: 600;
    text-decoration: none;
}

.ha-lost-password:hover {
    text-decoration: underline;
}

.ha-auth-submit {
    width: 100%;
    background: var(--accent-primary);
    color: #fff;
    border: none;
    padding: 5px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.ha-auth-submit:hover {
    background: var(--accent-glow);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.ha-auth-disclaimer {
    margin-top: 20px;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.5;
}

.ha-auth-disclaimer a {
    color: var(--text-secondary);
    font-weight: 600;
}

.ha-auth-message {
    margin-top: 16px;
    min-height: 24px;
    text-align: center;
}

@keyframes authFadeIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.auth-success {
    color: var(--success);
    font-weight: 600;
}

.auth-error {
    color: var(--danger);
    font-weight: 600;
}

/* ── Modern Episode Player ────────────────────────────── */
.ep-player-box {
    position: relative;
    background: #000;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    aspect-ratio: 16 / 9;
}

.ep-player-poster {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
}

.ep-player-poster.is-hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.05);
}

.ep-poster-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.2) 50%, rgba(0, 0, 0, 0.6) 100%);
    transition: opacity 0.3s ease;
}

.ep-player-poster:hover .ep-poster-overlay {
    opacity: 0.7;
}

.ep-poster-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* YouTube Style Play Button */
.ep-yt-play-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0, 0, 0.2, 1);
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
}

.ytp-play-button-bg {
    fill: #212121;
    fill-opacity: 0.8;
    transition: fill 0.1s cubic-bezier(0.4, 0, 1, 1), fill-opacity 0.1s cubic-bezier(0.4, 0, 1, 1);
}

.ep-player-poster:hover .ytp-play-button-bg {
    fill: #f00;
    fill-opacity: 1;
}

.ep-player-poster:hover .ep-yt-play-btn {
    transform: scale(1.1);
}

.ep-poster-meta {
    text-align: center;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.ep-poster-title {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.ep-poster-ep {
    display: block;
    font-size: 0.95rem;
    opacity: 0.9;
    font-weight: 500;
}

.ep-player-ratio {
    position: relative;
    width: 100%;
    height: 100%;
}

.ep-player-ratio iframe,
.ep-player-ratio video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
}

/* ── Loading Spinner ────────────────────────────────────── */
.ep-player-loading {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 50;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.ep-player-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: ep-spin 0.8s linear infinite;
}

@keyframes ep-spin {
    to {
        transform: rotate(360deg);
    }
}

.ep-player-loading-txt {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* ── Player Watermark ───────────────────────────────────── */
.ep-player-watermark {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 110;
    pointer-events: none;
    opacity: 0.75;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
}

.ep-player-box:hover .ep-player-watermark {
    opacity: 1;
}

.ep-watermark-text-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0,0,0,0.2);
    padding: 6px 12px;
    border-radius: 10px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.1);
}

.ep-watermark-favicon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.ep-player-watermark .logo-text {
    font-size: 1.1rem !important;
    color: #fff !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    margin: 0;
}

.ep-player-watermark .logo-accent {
    color: var(--accent-primary) !important;
}

.ep-player-watermark .site-logo-img {
    max-width: 110px;
    height: auto;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

/* ── Modern Video Controls (Native) ───────────────────────── */
.ep-vc {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 120;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(0deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 60%, transparent 100%);
    padding: 0 15px 10px;
}

.ep-vc-active {
    opacity: 1;
    visibility: visible;
}

/* Hide custom controls while poster is active to prevent play button overlap */
.ep-player-poster:not(.is-hidden) ~ .ep-player-ratio .ep-vc {
    display: none !important;
}

.ep-vc-bar {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.ep-vc-progress {
    position: relative;
    width: 100%;
    height: 5px;
    background: rgba(255,255,255,0.15);
    cursor: pointer;
    margin-bottom: 12px;
    transition: height 0.2s ease;
    border-radius: 3px;
    overflow: visible;
}

.ep-vc-progress:hover {
    height: 7px;
}

.ep-vc-played-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: var(--accent-primary, #007bff);
    border-radius: 3px;
    z-index: 2;
    transition: width 0.1s linear;
}

.ep-vc-buffer-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: rgba(255,255,255,0.25);
    border-radius: 3px;
    z-index: 1;
    transition: width 0.1s linear;
}

.ep-vc-thumb {
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    background: var(--accent-primary, #007bff);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.2s ease;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.ep-vc-progress:hover .ep-vc-thumb {
    transform: translate(-50%, -50%) scale(1);
}

/* Tooltip for progress bar */
.ep-vc-progress-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.95);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: 'Roboto Mono', monospace;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 50;
    bottom: 100%;
    transform: translateX(-50%) translateY(-8px);
    border: 1px solid rgba(255,255,255,0.1);
}

.ep-vc-row {
    display: flex;
    align-items: center;
    gap: 15px;
    height: 40px;
}

.ep-vc-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    opacity: 0.9;
}

.ep-vc-btn:hover {
    transform: scale(1.1);
    opacity: 1;
}

.ep-vc-time {
    color: #eee;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: 'Roboto Mono', monospace;
}

.ep-vc-spacer {
    flex: 1;
}

.ep-vc-vol-group {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0;
    overflow: hidden;
    transition: gap 0.2s ease;
}

/* Expand on hover to show slider */
.ep-vc-vol-group:hover .ep-vc-vol-range {
    width: 80px;
    opacity: 1;
}

.ep-vc-vol-range {
    -webkit-appearance: none;
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    height: 4px;
    width: 0;
    cursor: pointer;
    display: block;
    transition: width 0.2s ease, opacity 0.2s ease;
    opacity: 0;
    pointer-events: auto;
}

.ep-vc-vol-range::-webkit-slider-runnable-track {
    background: rgba(255, 255, 255, 0.2);
    height: 4px;
    border-radius: 2px;
}

.ep-vc-vol-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: var(--accent-primary, #fff);
    border-radius: 50%;
    cursor: pointer;
    margin-top: -4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    transition: background 0.15s ease;
}

.ep-vc-vol-range::-webkit-slider-thumb:hover {
    background: var(--accent-primary, #fff);
    transform: scale(1.2);
}

.ep-vc-vol-range::-moz-range-track {
    background: rgba(255, 255, 255, 0.2);
    height: 4px;
    border-radius: 2px;
    border: none;
}

.ep-vc-vol-range::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: var(--accent-primary, #fff);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    transition: background 0.15s ease;
}

.ep-vc-vol-range::-moz-range-thumb:hover {
    background: var(--accent-primary, #fff);
    transform: scale(1.2);
}

.ep-vc-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.ep-vc-play-big {
    background: rgba(0,0,0,0.5);
    border: none;
    color: #fff;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: scale(1.2);
}

.ep-vc:not(.ep-vc-playing) .ep-vc-play-big {
    opacity: 1;
    transform: scale(1);
}

.ep-vc-play-big:hover {
    background: rgba(var(--accent-rgb), 0.8);
    transform: scale(1.1);
}

/* ════════════════════════════════════════════════════════════
   helloPlayer — Rumble-style controls enhancements
════════════════════════════════════════════════════════════ */

/* Tighter, richer control bar */
.ep-vc {
    padding: 0 12px 12px;
}

.ep-vc-row {
    gap: 8px;
}

.ep-vc-btn {
    padding: 4px 6px;
    border-radius: 4px;
    transition: background 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}

.ep-vc-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: none;
    opacity: 1;
}

.ep-vc-btn-text {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    min-width: 28px;
    text-align: center;
    color: #fff;
    font-family: inherit;
}

/* ── Popup menus (CC & Quality) ─────────────────────────── */
.ep-vc-btn-group {
    position: relative;
    display: flex;
    align-items: center;
}

.ep-vc-popup-menu {
    position: absolute;
    bottom: calc(100% + 10px);
    right: 50%;
    transform: translateX(50%);
    background: rgba(18, 18, 22, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    min-width: 130px;
    padding: 6px 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    z-index: 200;
    display: none;
    backdrop-filter: blur(8px);
    pointer-events: none;
    opacity: 0;
    transform: translateX(50%) translateY(6px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.ep-vc-popup-menu.is-open {
    display: block;
    pointer-events: auto;
    opacity: 1;
    transform: translateX(50%) translateY(0);
}

.ep-popup-item {
    display: block;
    width: 100%;
    padding: 8px 16px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.82rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
    white-space: nowrap;
}

.ep-popup-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.ep-popup-item.is-active {
    color: #fff;
    font-weight: 700;
}

.ep-popup-item.is-active::before {
    content: '\2713\00a0';
    color: var(--accent-primary, #f00);
}

/* ── Settings menu tabs ──────────────────────────────────── */
.ep-settings-menu {
    min-width: 165px;
    padding: 0 !important;
    overflow: hidden;
}
.ep-settings-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.ep-settings-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 9px 8px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.12s;
    white-space: nowrap;
}
.ep-settings-tab:hover {
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.06);
}
.ep-settings-tab.is-active {
    color: #fff;
    border-bottom-color: var(--accent-primary, #e63946);
}
.ep-settings-panel {
    padding: 6px 0;
}

/* ── CC button active state ─────────────────────────────── */
.ep-cc-btn--active {
    color: #fff;
    background: rgba(var(--accent-rgb), 0.25) !important;
    border-radius: 4px;
    box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.5);
}

.ep-cc-btn--active:hover {
    background: rgba(var(--accent-rgb), 0.35) !important;
}

.is-menu-open {
    background: rgba(255, 255, 255, 0.15) !important;
}

/* ── [helloPlayer] brand badge ──────────────────────────── */
.ep-vc-brand {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.4);
    white-space: nowrap;
    padding: 3px 6px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-family: 'Roboto Mono', monospace;
    transition: color 0.2s ease, border-color 0.2s ease;
    user-select: none;
    flex-shrink: 0;
}

.ep-vc-active .ep-vc-brand:hover {
    color: rgba(255, 255, 255, 0.75);
    border-color: rgba(255, 255, 255, 0.3);
}


/* ── Watermark adjustments ──────────────────────────────── */
.ep-watermark-text-wrap {
    background: rgba(0, 0, 0, 0.35);
    padding: 5px 10px;
    border-radius: 8px;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    gap: 7px;
}

/* ── Admin: Caption tracks meta box ────────────────────── */
.ha-cc-row {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
}

/* Top fields row: label, lang, format */
.ha-cc-row-fields {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
}

.ha-cc-label   { width: 180px; }
.ha-cc-srclang { width: 90px; }
.ha-cc-format  { width: 75px; }

/* File picker row */
.ha-cc-row-file {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
}

.ha-cc-file-preview {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 200px;
    flex: 1;
    font-size: 0.85em;
    color: #333;
    overflow: hidden;
}

.ha-cc-file-empty .ha-cc-filename {
    color: #999;
    font-style: italic;
}

.ha-cc-filename {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ha-cc-file-link {
    flex-shrink: 0;
    color: #0073aa;
    text-decoration: none;
    font-size: 1em;
    line-height: 1;
}

.ha-cc-file-link:hover {
    color: #005177;
}

.ha-cc-upload-btn {
    flex-shrink: 0;
}

.ha-cc-clear-btn {
    flex-shrink: 0;
    color: #a00 !important;
    border-color: #a00 !important;
}

.ha-cc-clear-btn:hover {
    background: #fcf0f0 !important;
}

.ha-cc-remove {
    align-self: flex-end;
    color: #a00 !important;
}

/* ── Admin: Streaming sources attachment field ───────────── */
.ha-s-row-att {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px 0 4px;
    border-top: 1px dashed #e0e0e0;
    margin-top: 4px;
}

.ha-s-att-label { font-size: 0.85em; color: #555; flex-shrink: 0; }
.ha-s-att-id    { width: 140px; }
.ha-s-att-hint  { font-size: 0.78em; color: #888; font-style: italic; }

/* ── Topbar Auth Buttons ────────────────────────────────── */
.topbar-auth {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-auth-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 0.82rem;
    font-weight: 700;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.topbar-auth-btn--ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.topbar-auth-btn--ghost:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.topbar-auth-btn--solid {
    background: var(--accent-primary);
    border: 1px solid var(--accent-primary);
    color: #fff !important;
}

.topbar-auth-btn--solid:hover {
    background: var(--accent-glow);
    border-color: var(--accent-glow);
    color: #fff !important;
    /* Force white text on hover */
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

.topbar-auth-btn svg {
    flex-shrink: 0;
}

.topbar-login-avatar,
.topbar-signup-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.85;
}

/* Responsive Auth (1000px and below) */
@media (max-width: 1000px) {
    .topbar-auth-btn--solid {
        display: none !important;
    }

    .topbar-auth-btn--login {
        padding: 0;
        width: 36px;
        height: 36px;
        justify-content: center;
        background: var(--bg-elevated);
        border-color: var(--border);
    }

    .topbar-auth-btn--login .topbar-auth-label {
        display: none !important;
    }

    .topbar-auth-btn--login .topbar-login-avatar svg {
        width: 18px;
        height: 18px;
    }
}

/* ════════════════════════════════════════════════════════════
   Episode Controls Bar — Compact & Clean
════════════════════════════════════════════════════════════ */

.ep-controls-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 20px;
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin: 16px 0;
    border-radius: 8px;
    flex-wrap: wrap;
}

/* Navigation Buttons Group */
.ep-nav-btns {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.ep-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
    cursor: pointer;
}

.ep-nav-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-2px);
}

.ep-nav-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;
    min-width: 60px;
}

.ep-nav-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.ep-nav-num {
    font-size: 0.88rem;
    color: var(--accent-primary);
    font-weight: 700;
    font-family: 'Roboto Mono', monospace;
}

.ep-nav-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.ep-nav-btn--next {
    flex-direction: row-reverse;
}

/* Servers/Quality Selector Group */
.ep-servers {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.ep-servers-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    white-space: nowrap;
}

.server-dropdown {
    padding: 8px 12px !important;
    min-width: 160px;
    border-radius: 6px !important;
    background: var(--bg-surface) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border) !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    transition: all 0.15s ease !important;
    cursor: pointer;
}

.server-dropdown:hover {
    background: var(--bg-elevated) !important;
    border-color: var(--accent-primary) !important;
}

.server-dropdown:focus {
    outline: none;
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .ep-controls-bar {
        gap: 10px;
        padding: 10px 16px;
        flex-direction: column;
        align-items: stretch;
    }
    
    .ep-nav-btns {
        width: 100%;
        justify-content: space-between;
    }
    
    .ep-servers {
        width: 100%;
        margin-left: 0;
        flex-wrap: wrap;
    }
    
    .server-dropdown {
        min-width: 100% !important;
    }
    
    .ep-nav-label {
        min-width: auto;
    }
    
    .ep-nav-btn {
        flex: 1;
        min-width: 100px;
    }
}