/* ============================================
   MicroTV - 100% Exact Clean Stylesheet
   Pure CSS | Responsive | Ad-Free | Fast
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #0a0a0a;
    color: #ffffff;
    line-height: 1.6;
    min-height: 100vh;
}

/* ========== HEADER (HOME PAGE - EXACT SAME AS APP) ========== */
.home-header {
    text-align: center;
    margin-top: 0;
    padding: 10px 10px 4px;
    margin-bottom: 16px;
    background: transparent;
    border-bottom: none;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: clamp(22px, 5.5vw, 28px);
    font-weight: 900;
    letter-spacing: -0.5px;
    color: #ffffff;
    text-transform: uppercase;
}

.brand-logo span {
    color: #ffffff;
}

.brand-logo strong {
    color: #e50914;
}

.brand-tagline {
    font-size: clamp(10px, 2.3vw, 12px);
    font-weight: 600;
    color: #888888;
    letter-spacing: 0.8px;
    margin-top: 3px;
    text-transform: uppercase;
}

/* ========== SMALL RECTANGULAR SHAPE AD (VIDEO PLAYER PAGE - NO BIG BLACK AREA) ========== */
.watch-small-rect-ad {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2px auto 10px;
    width: 100%;
    max-width: 468px;
    min-height: 50px;
    background: transparent;
    overflow: hidden;
    box-sizing: border-box;
}

/* ========== CONTAINER ========== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ========== ACTION BAR (Search + Telegram) ========== */
.action-bar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 25px;
    width: 100%;
}

.search-form {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 100%;
}

.search-form input {
    flex: 1;
    min-width: 0;
    padding: 14px 18px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 40px;
    color: white;
    font-size: 15px;
    outline: none;
    transition: all 0.3s;
}

.search-form input:focus {
    border-color: #e50914;
}

.search-form button {
    padding: 14px 24px;
    background: #e50914;
    color: white;
    border: none;
    border-radius: 40px;
    cursor: pointer;
    font-weight: bold;
    font-size: 15px;
    transition: background 0.3s;
    flex-shrink: 0;
}

.search-form button:hover {
    background: #b8070f;
}

.clear-btn {
    padding: 14px 20px;
    background: #333;
    color: white;
    text-decoration: none;
    border-radius: 40px;
    transition: background 0.3s;
    font-size: 14px;
    display: none;
    cursor: pointer;
    border: none;
}

/* ========== ACTION BUTTONS (Download APK & Join Telegram) ========== */
/* Download App Button */
.download-app-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    padding: 13px 20px;
    background: linear-gradient(135deg, #e50914 0%, #ff3b30 50%, #e50914 100%);
    background-size: 200% auto;
    color: #ffffff;
    text-decoration: none;
    border-radius: 14px;
    font-weight: 800;
    font-size: 15px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 4px 18px rgba(229, 9, 20, 0.45);
    transition: all 0.25s ease;
    text-align: center;
    cursor: pointer;
}

.download-app-btn:hover {
    background-position: right center;
    box-shadow: 0 6px 24px rgba(229, 9, 20, 0.65);
    transform: translateY(-2px);
    color: #ffffff;
}

.download-app-btn:active,
.telegram-btn:active {
    transform: translateY(0);
}

.download-app-btn svg,
.telegram-btn svg {
    flex-shrink: 0;
}

/* Telegram Button */
.telegram-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    padding: 13px 20px;
    background: linear-gradient(135deg, #0088cc 0%, #00a8e8 100%);
    color: #ffffff;
    text-decoration: none;
    border-radius: 14px;
    font-weight: 800;
    font-size: 15px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 4px 16px rgba(0, 136, 204, 0.45);
    transition: all 0.25s ease;
    text-align: center;
    cursor: pointer;
}

.telegram-btn:hover {
    background: linear-gradient(135deg, #0099e6 0%, #00bfff 100%);
    box-shadow: 0 6px 22px rgba(0, 136, 204, 0.65);
    transform: translateY(-2px);
    color: #ffffff;
}

.search-info {
    background: #1a1a1a;
    padding: 12px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    color: #ddd;
    text-align: center;
}

/* ========== POST GRID ========== */
.post-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-bottom: 40px;
}

@media (max-width: 992px) {
    .post-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 680px) {
    .post-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

.post-card {
    position: relative;
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(229, 9, 20, 0.3);
}

.post-card a {
    text-decoration: none;
    color: white;
    display: block;
}

.post-card img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    display: block;
    background: #151515;
    transition: transform 0.3s ease;
}

.post-card:hover img {
    transform: scale(1.05);
}

.post-card h3 {
    font-size: 15px;
    padding: 12px 12px 6px;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #ffffff;
}

.post-card .views {
    font-size: 12px;
    color: #888;
    padding: 0 12px 12px;
    display: block;
}

/* ========== PAGINATION ========== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.pagination a, .pagination button {
    padding: 10px 16px;
    background: #1a1a1a;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
    font-size: 14px;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.pagination a:hover, .pagination button:hover {
    background: #e50914;
}

.pagination a.active, .pagination button.active {
    background: #e50914;
}

.pagination span.dots {
    padding: 10px 5px;
    color: #888;
}

/* ========== CATEGORY FILTER SELECTION CHIPS ========== */
.filter-chips-wrapper {
    margin: 18px 0 12px;
    width: 100%;
    position: relative;
}

.filter-chips-scroll {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    padding: 6px 2px 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(229, 9, 20, 0.4) transparent;
    -webkit-overflow-scrolling: touch;
}

.filter-chips-scroll::-webkit-scrollbar {
    height: 4px;
}

.filter-chips-scroll::-webkit-scrollbar-thumb {
    background: rgba(229, 9, 20, 0.4);
    border-radius: 4px;
}

.filter-chip {
    flex-shrink: 0;
    padding: 8px 18px;
    background: #191c26;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    user-select: none;
    font-family: inherit;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.filter-chip:hover {
    background: #252a3a;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.filter-chip.active {
    background: linear-gradient(135deg, #e50914, #b20710);
    color: #fff;
    border-color: #ff3344;
    box-shadow: 0 4px 16px rgba(229, 9, 20, 0.45);
}

/* ========== 24-HOUR DAILY REFRESH STATUS BAR ========== */
.daily-refresh-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(20, 24, 35, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 8px 16px;
    margin: 8px 0 20px;
    font-size: 12px;
    color: #94a3b8;
}

.daily-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #a5b4fc;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulseGlow 1.8s infinite;
}

@keyframes pulseGlow {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.daily-date-label {
    color: #64748b;
    font-size: 11px;
}

/* ========== FRESH DEDICATED WATCH PAGE VIEW (YouTube Style) ========== */
.watch-view {
    width: 100%;
    animation: fadeInWatch 0.3s ease-in-out;
    padding-top: 16px;
}

@keyframes fadeInWatch {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.watch-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 8px 4px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Small Red Back Button */
.yt-small-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #e50914 0%, #b20710 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    padding: 7px 16px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(229, 9, 20, 0.35);
    font-family: inherit;
}

.yt-small-back-btn:hover {
    background: linear-gradient(135deg, #ff1a26 0%, #cc0813 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(229, 9, 20, 0.55);
}

.back-arrow {
    font-size: 15px;
    line-height: 1;
}

.watch-status-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 5px 12px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.live-dot {
    width: 6px;
    height: 6px;
    background: #ef4444;
    border-radius: 50%;
    animation: livePulse 1.2s infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Big YouTube Cinema / Theater Player Wrapper */
.youtube-player-container {
    width: 100%;
    max-width: 1040px;
    margin: 0 auto 16px;
}

.youtube-player-ratio {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Widescreen aspect ratio */
    height: 0;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.youtube-player-ratio iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 16px;
}

/* Player Poster Fallback Card (When video is not found/empty) */
.player-poster-fallback {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #0b0d14;
    border-radius: 16px;
    z-index: 5;
}

.poster-fallback-backdrop {
    position: absolute;
    inset: -20px;
    background-size: cover;
    background-position: center;
    filter: blur(24px) brightness(0.28);
    transform: scale(1.1);
    z-index: 1;
}

.poster-fallback-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 16px 24px;
    width: 100%;
    max-width: 720px;
    box-sizing: border-box;
}

.poster-fallback-img-wrap {
    position: relative;
    flex-shrink: 0;
    width: 130px;
    height: 190px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.15);
    background: #141722;
}

.poster-fallback-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.poster-fallback-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(10, 12, 18, 0.92);
    backdrop-filter: blur(8px);
    padding: 5px 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 800;
    color: #38bdf8;
    letter-spacing: 0.3px;
    border-top: 1px solid rgba(56, 189, 248, 0.3);
    white-space: nowrap;
}

.poster-fallback-badge .badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #38bdf8;
    box-shadow: 0 0 8px #38bdf8;
    animation: livePulse 1.8s infinite;
}

.poster-fallback-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
}

.poster-fallback-title {
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.poster-fallback-subtitle {
    font-size: 13px;
    font-weight: 600;
    color: #38bdf8;
    margin: 0;
}

@media (max-width: 640px) {
    .poster-fallback-content {
        gap: 14px;
        padding: 10px;
    }
    .poster-fallback-img-wrap {
        width: 90px;
        height: 130px;
    }
    .poster-fallback-title {
        font-size: 14px;
    }
    .poster-fallback-subtitle {
        font-size: 11px;
    }
}

/* YouTube Style Details Card */
.watch-details-card {
    max-width: 1040px;
    margin: 0 auto;
    background: #141722;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 20px 22px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    box-sizing: border-box;
}

.yt-drama-title {
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 8px 0;
    line-height: 1.35;
    word-break: break-word;
}

/* YouTube Subtitle Meta Row */
.yt-meta-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 16px;
}

.yt-views {
    color: #e2e8f0;
    font-weight: 600;
}

.yt-dot {
    color: #475569;
    font-size: 10px;
}

.yt-date {
    color: #94a3b8;
}

.yt-hd-tag {
    background: rgba(229, 9, 20, 0.15);
    border: 1px solid rgba(229, 9, 20, 0.4);
    color: #ff3344;
    font-size: 11px;
    font-weight: 800;
    padding: 1px 7px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

/* YouTube Action Bar (Likes, Dislike, Share, Telegram) */
.yt-action-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
    margin-bottom: 18px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.yt-action-bar::-webkit-scrollbar {
    display: none;
}

.yt-pill-segment {
    display: inline-flex;
    align-items: center;
    background: #1e2434;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.yt-segment-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: transparent;
    border: none;
    color: #f1f5f9;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.yt-segment-btn:hover {
    background: #2a334d;
    color: #ffffff;
}

.yt-segment-btn.active {
    color: #ff3344;
    background: rgba(229, 9, 20, 0.22);
}

.yt-segment-btn.active .yt-action-svg {
    fill: #ff3344;
}

.yt-segment-divider {
    width: 1px;
    height: 18px;
    background: rgba(255, 255, 255, 0.15);
}

.yt-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #1e2434;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
    padding: 8px 16px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    font-family: inherit;
}

.yt-pill-btn:hover {
    background: #2a334d;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.yt-tg-pill {
    background: rgba(0, 136, 204, 0.15);
    border-color: rgba(0, 136, 204, 0.35);
    color: #38bdf8;
}

.yt-tg-pill:hover {
    background: rgba(0, 136, 204, 0.3);
    color: #fff;
}

/* Real Clean SVG Action Icons (No Emojis) */
.yt-action-svg {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    fill: currentColor;
    transition: transform 0.2s ease, fill 0.2s ease;
}

.yt-segment-btn:hover .yt-action-svg,
.yt-pill-btn:hover .yt-action-svg {
    transform: scale(1.08);
}

.tg-icon {
    fill: #38bdf8;
}

.yt-tg-pill:hover .tg-icon {
    fill: #ffffff;
}

/* YouTube Style Red Download Button */
.yt-download-card {
    margin: 10px 0 18px;
    width: 100%;
}

.yt-red-download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: linear-gradient(135deg, #e50914 0%, #b20710 100%);
    color: #ffffff;
    text-decoration: none;
    padding: 15px 22px;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(229, 9, 20, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.25s ease;
    cursor: pointer;
    box-sizing: border-box;
    width: 100%;
}

.yt-red-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(229, 9, 20, 0.65);
    background: linear-gradient(135deg, #ff1a26 0%, #cc0813 100%);
    color: #fff;
}

.dl-svg-large {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    fill: #ffffff;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.dl-text-wrap {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.dl-title-text {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.4px;
}

.dl-subtitle-text {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

/* Watch Ad Container */
.watch-ad-wrapper {
    margin: 16px auto 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* ========== YOUTUBE STYLE DESCRIPTION & TAGS DROP CARD ========== */
.yt-description-card {
    background: #141722;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    margin: 18px 0 24px;
    overflow: hidden;
    transition: all 0.25s ease;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

.yt-description-card:hover {
    border-color: rgba(255, 255, 255, 0.16);
}

/* Dropdown Toggle Button */
.yt-desc-drop-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1a1e2d;
    border: none;
    padding: 13px 18px;
    color: #f1f5f9;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s ease;
    box-sizing: border-box;
}

.yt-desc-drop-btn:hover {
    background: #23283c;
}

.yt-desc-drop-left {
    display: flex;
    align-items: center;
    gap: 9px;
}

.yt-desc-icon {
    fill: #e50914;
    flex-shrink: 0;
}

.yt-desc-drop-title {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.3px;
}

.yt-desc-drop-right {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 600;
}

.yt-desc-action-text {
    color: #cbd5e1;
}

.yt-desc-chevron {
    fill: currentColor;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.yt-desc-drop-btn[aria-expanded="true"] .yt-desc-chevron {
    transform: rotate(180deg);
}

.yt-desc-body {
    padding: 16px 18px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    animation: fadeInDesc 0.25s ease-out;
}

@keyframes fadeInDesc {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.yt-desc-text {
    font-size: 13.5px;
    line-height: 1.6;
    color: #94a3b8;
    margin: 0 0 16px 0;
}

.yt-desc-text strong {
    color: #ffffff;
}

/* Up Next / Recommended Dramas Grid (Like YouTube) */
.up-next-section {
    margin-top: 35px;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.up-next-header {
    margin-bottom: 18px;
}

.up-next-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0 0 4px;
}

.up-next-sub {
    font-size: 13px;
    color: #64748b;
}

.up-next-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

@media (max-width: 992px) {
    .up-next-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 680px) {
    .up-next-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .watch-details-card {
        padding: 14px 10px;
    }
    .yt-drama-title {
        font-size: 17px;
    }
    .dl-title-text {
        font-size: 14px;
    }
    .yt-red-download-btn {
        padding: 13px 16px;
    }
    .yt-action-bar {
        gap: 8px;
    }
}

.bottom-back-wrapper {
    text-align: center;
    margin: 35px 0 15px;
}

/* Legacy modal fallback */
.modal-overlay {
    display: none !important;
}

/* ========== TAGS SECTION ========== */
.tags-container {
    background: #1a1a1a;
    padding: 18px 20px;
    border-radius: 12px;
    margin: 10px 0 5px;
    border-left: 4px solid #e50914;
    width: 100%;
    box-sizing: border-box;
}

.tags-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #e50914;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 12px;
    letter-spacing: 0.3px;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    justify-content: flex-start;
    align-items: center;
}

.tag {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.25s ease;
    white-space: nowrap;
    background: #2a2a2a;
    color: #ddd;
    cursor: pointer;
}

.global-tag {
    background: #e50914;
    color: white;
}

.global-tag:hover {
    background: #ff1a2a;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(229, 9, 20, 0.4);
}

.post-tag {
    background: rgba(229, 9, 20, 0.12);
    color: #ff6b6b;
    border: 1px solid rgba(229, 9, 20, 0.3);
}

.post-tag:hover {
    background: #e50914;
    color: white;
    border-color: #e50914;
    transform: translateY(-2px);
}

/* ========== META INFO ========== */
.meta {
    color: #888;
    font-size: 14px;
    text-align: center;
    padding: 20px;
    border-top: 1px solid #222;
    margin-top: 25px;
}

.back-home {
    display: inline-block;
    color: #e50914;
    text-decoration: none;
    margin-top: 15px;
    font-weight: bold;
    cursor: pointer;
}

.back-home:hover {
    text-decoration: underline;
}

/* ========== FOOTER ========== */
footer {
    text-align: center;
    padding: 30px 20px;
    border-top: 1px solid #222;
    margin-top: 40px;
    color: #888;
    font-size: 14px;
}

footer p {
    margin: 5px 0;
}

/* ========== AD SLOTS STYLING ========== */
.ad-slot-container {
    margin: 20px auto;
    text-align: center;
    display: none;
    overflow: hidden;
    position: relative;
    max-width: 100%;
}

.ad-native-wrapper {
    background: #141414;
    border: 1px solid #282828;
    border-radius: 8px;
    padding: 16px;
    margin: 20px auto;
    max-width: 1000px;
    text-align: center;
    position: relative;
}

.ad-badge {
    display: inline-block;
    font-size: 11px;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

/* Floating Side Skyscrapers (Equal Left & Right 160x600) */
.ad-skyscraper-left,
.ad-skyscraper-right {
    position: fixed;
    top: max(80px, calc(50vh - 300px));
    width: 160px;
    height: 600px;
    z-index: 90;
    display: none;
    background: rgba(18, 22, 34, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    overflow: hidden;
    transition: all 0.3s ease;
}

.ad-skyscraper-left {
    left: max(12px, calc(50% - 600px - 176px));
}

.ad-skyscraper-right {
    right: max(12px, calc(50% - 600px - 176px));
}

@media (min-width: 1540px) {
    .ad-skyscraper-left,
    .ad-skyscraper-right {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Footer Admin Link */
.footer-admin-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    color: #555;
    text-decoration: none;
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid #222;
    transition: all 0.2s;
}

.footer-admin-link:hover {
    color: #e50914;
    border-color: #444;
    background: #141414;
}

/* ========== IN-GRID ADS: 2 RECTANGLE ADS & 2 SQUARE ADS ========== */
.in-grid-rect-ad,
.in-grid-square-ad,
.in-grid-dual-ad,
.in-grid-small-ad,
.in-grid-big-square-ad {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(20, 24, 38, 0.9) 0%, rgba(13, 16, 26, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 16px;
    padding: 16px 14px;
    margin: 14px 0;
    width: 100%;
    overflow: hidden;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
}

.in-grid-ad-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
    width: 100%;
}

.in-grid-ad-badge {
    font-size: 11px;
    font-weight: 700;
    color: #a5b4fc;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 4px 14px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Dual Ads Container (2 ads side by side) */
.in-grid-dual-rect-container,
.in-grid-dual-square-container,
.in-grid-dual-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    width: 100%;
}

.dual-rect-box-1,
.dual-rect-box-2,
.dual-square-box-1,
.dual-square-box-2,
.dual-box-1,
.dual-box-2,
.single-rect-box,
.single-square-box {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(10, 12, 18, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    box-sizing: border-box;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
}

.dual-rect-box-1:hover,
.dual-rect-box-2:hover,
.dual-square-box-1:hover,
.dual-square-box-2:hover,
.dual-box-1:hover,
.dual-box-2:hover,
.single-rect-box:hover,
.single-square-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    border-color: rgba(229, 9, 20, 0.3);
}

/* Mobile In-Grid Ads Customization */
@media (max-width: 680px) {
    .in-grid-rect-ad,
    .in-grid-square-ad,
    .in-grid-single-ad {
        padding: 10px 4px !important;
        margin: 10px 0 !important;
        border-radius: 12px !important;
    }
    .in-grid-ad-header {
        margin-bottom: 6px !important;
    }
    .in-grid-ad-badge {
        font-size: 10px !important;
        padding: 2px 10px !important;
        letter-spacing: 0.5px !important;
    }
    .single-rect-box iframe,
    .single-square-box iframe {
        max-width: 100% !important;
    }
}

/* Series Download Button & Interactive Progress States */
.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #e50914, #b20710);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    padding: 14px 32px;
    border-radius: 50px;
    box-shadow: 0 6px 20px rgba(229, 9, 20, 0.4);
    transition: all 0.25s ease;
    cursor: pointer;
    border: none;
    max-width: 90%;
    margin: 10px auto;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(229, 9, 20, 0.6);
    color: #fff;
}

/* Step Progress State (e.g. Step 1/2 Completed) */
.download-btn.btn-step-progress {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
    animation: pulseStep 1.6s infinite;
}

/* Step Ready State (Unlocks Real Download) */
.download-btn.btn-step-ready {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 6px 25px rgba(16, 185, 129, 0.5);
    animation: pulseReady 1.4s infinite;
}

@keyframes pulseStep {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

@keyframes pulseReady {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1.03); box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* =========================================================================
   BOTTOM NAVIGATION BAR & TAB VIEWS (FAVORITES & HISTORY)
   ========================================================================= */
body {
    padding-bottom: 74px !important;
}

.bottom-nav-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 62px;
    background: rgba(11, 14, 22, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.09);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 10000;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.6);
}

.bottom-nav-item {
    flex: 1;
    max-width: 160px;
    height: 100%;
    background: none;
    border: none;
    outline: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    cursor: pointer;
    color: #64748b;
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 6px 0;
    user-select: none;
}

.bottom-nav-item:hover {
    color: #94a3b8;
}

.bottom-nav-item.active {
    color: #e50914;
}

.bottom-nav-item.active .nav-icon-wrap {
    transform: scale(1.12) translateY(-2px);
    filter: drop-shadow(0 0 10px rgba(229, 9, 20, 0.6));
}

.nav-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.nav-badge-pill {
    position: absolute;
    top: -4px;
    right: -10px;
    background: #e50914;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 10px;
    border: 1.5px solid #0b0e16;
    min-width: 16px;
    text-align: center;
    line-height: 1.2;
}

.nav-tab-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

/* Drama Card Fav Button Overlay (Glowing Heart) */
.card-fav-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(10, 12, 18, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 25;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.card-fav-btn:hover {
    transform: scale(1.18);
    background: rgba(15, 18, 28, 0.95);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.5);
}

.card-fav-btn.is-fav {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.22);
    border-color: rgba(239, 68, 68, 0.75);
    filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.75));
    animation: heartPulse 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Watch Fav Button in Action Bar */
.yt-pill-btn.active#watchFavBtn {
    background: rgba(239, 68, 68, 0.2) !important;
    border: 1px solid rgba(239, 68, 68, 0.6) !important;
    color: #ef4444 !important;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

@keyframes heartPulse {
    0% { transform: scale(0.7); }
    50% { transform: scale(1.35); }
    100% { transform: scale(1); }
}

/* Tab View Container (Favorites / History) */
.tab-view-container {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 16px 0 32px;
    animation: fadeInTab 0.2s ease-out;
}

@keyframes fadeInTab {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.tab-view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tab-view-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tab-view-title {
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tab-view-counter {
    background: rgba(229, 9, 20, 0.15);
    border: 1px solid rgba(229, 9, 20, 0.4);
    color: #ff4d5a;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 20px;
}

.clear-btn-action {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #f87171;
    font-size: 13px;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-btn-action:hover {
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
}

/* Empty State */
.tab-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: rgba(15, 18, 28, 0.6);
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    max-width: 480px;
    margin: 40px auto;
}

.tab-empty-icon {
    font-size: 48px;
    opacity: 0.8;
}

.tab-empty-title {
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
}

.tab-empty-desc {
    font-size: 14px;
    color: #94a3b8;
    line-height: 1.5;
    max-width: 340px;
}

.tab-empty-action-btn {
    margin-top: 6px;
    background: linear-gradient(135deg, #e50914 0%, #b80710 100%);
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    padding: 10px 24px;
    border-radius: 24px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(229, 9, 20, 0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tab-empty-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229, 9, 20, 0.6);
}

/* History List Layout */
.history-items-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: #111420;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px 14px;
    transition: all 0.2s ease;
}

.history-item-row:hover {
    background: #171c2d;
    border-color: rgba(56, 189, 248, 0.35);
    transform: translateX(4px);
}

.history-item-main {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
    cursor: pointer;
    background: none;
    border: none;
    text-align: left;
    padding: 0;
    color: inherit;
}

.history-thumb-wrap {
    width: 54px;
    height: 72px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: #000;
}

.history-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.history-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.history-title {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #94a3b8;
}

.history-time-badge {
    color: #38bdf8;
    font-weight: 600;
}

.history-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-remove-btn {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: color 0.15s ease, background 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-remove-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
}

