/* Base Styles & CSS Variables */
:root {
    --bg-main: #0f0f0f;
    --bg-header: #1a1a1a;
    --bg-card: #1c1c1c;
    --accent: #e50914;
    --accent-hover: #b31217;
    --text-main: #ffffff;
    --text-muted: #aaaaaa;
    --highlight: #fca311;
}

* {
    margin: 0; padding: 0; box-sizing: border-box; 
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}
body { 
    background-color: var(--bg-main); color: var(--text-main); 
    -webkit-font-smoothing: antialiased; 
}

/* Spinner Loading */
#spinner-container {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9); display: flex; flex-direction: column;
    justify-content: center; align-items: center; z-index: 9999; display: none;
}
.spinner {
    width: 50px; height: 50px; border: 4px solid #333;
    border-top: 4px solid var(--accent); border-radius: 50%; 
    animation: spin 1s linear infinite;
}
.loading-text { margin-top: 15px; font-weight: bold; color: var(--highlight); font-size: 16px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Header */
header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 20px; background-color: var(--bg-header); 
    position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
.logo img { max-height: 40px; border-radius: 4px; object-fit: contain; }
.header-spacer { width: 80px; } 

.dynamic-island {
    background-color: #000; width: 80px; height: 28px; border-radius: 20px;
    display: flex; justify-content: center; align-items: center; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.8); border: 1px solid #333;
}
.red-dot {
    width: 8px; height: 8px; background-color: #ff0000; border-radius: 50%;
    box-shadow: 0 0 10px #ff0000; animation: pulse 1.5s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 0.4; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.2); } }

/* VPN Notice Banner */
.vpn-notice {
    background: linear-gradient(90deg, #b31217, #e50914); color: #fff;
    padding: 10px 15px; display: flex; justify-content: space-between; align-items: center;
    font-size: 13px; font-weight: 500; border-bottom: 1px solid #ff4d4d;
}
.vpn-notice span { flex: 1; text-align: center; line-height: 1.4; }
#close-notice {
    background: transparent; border: none; color: #fff; font-size: 16px; 
    cursor: pointer; padding-left: 10px; font-weight: bold;
}

/* Category Navigation (Scrollable on Mobile) */
.category-nav {
    display: flex; justify-content: center; gap: 10px; padding: 15px 20px;
    background: #111; flex-wrap: nowrap; overflow-x: auto; 
    -ms-overflow-style: none; scrollbar-width: none;
}
.category-nav::-webkit-scrollbar { display: none; } /* ဖုန်းတွင် Scrollbar ဖျောက်ထားရန် */

.cat-btn {
    background: #2a2a2a; color: var(--text-muted); border: none; padding: 8px 20px;
    border-radius: 20px; font-size: 14px; cursor: pointer; transition: all 0.3s ease;
    font-weight: 600; white-space: nowrap; flex-shrink: 0;
}
.cat-btn:hover, .cat-btn.active { 
    background: var(--accent); color: #fff; box-shadow: 0 0 10px rgba(229, 9, 20, 0.4); 
}

/* Movie Grid */
.movie-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px; padding: 20px; max-width: 1200px; margin: 0 auto;
}

/* Skeleton Card */
.skeleton-card {
    aspect-ratio: 3/4; background: linear-gradient(90deg, #222 25%, #333 50%, #222 75%);
    background-size: 200% 100%; border-radius: 8px; animation: shimmer 1.5s infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Movie Card */
.movie-card {
    background: var(--bg-card); border-radius: 8px; overflow: hidden;
    cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #333; display: flex; flex-direction: column;
}
@media (hover: hover) {
    .movie-card:hover { transform: translateY(-4px); box-shadow: 0 6px 12px rgba(0,0,0,0.6); border-color: var(--accent); }
}
.movie-card img { width: 100%; aspect-ratio: 3/4; object-fit: cover; background: #000; }
.movie-card h3 {
    font-size: 13px; padding: 10px; text-align: center; color: #ddd;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; line-height: 1.2;
}

/* Pagination */
.pagination {
    display: flex; justify-content: center; align-items: center; gap: 15px;
    padding: 20px 0 40px; flex-wrap: wrap;
}
.page-btn {
    background: var(--accent); color: #fff; border: none; padding: 10px 20px;
    border-radius: 5px; font-size: 14px; cursor: pointer; font-weight: bold; transition: 0.2s;
}
.page-btn:hover:not(:disabled) { background: var(--accent-hover); }
.page-btn:disabled { background: #444; cursor: not-allowed; color: #888; }
#page-indicator { font-size: 16px; font-weight: bold; color: var(--highlight); }

/* Video Player */
#video-player-section { padding: 20px; max-width: 900px; margin: 0 auto; width: 100%; }
.back-btn {
    background: #333; color: #fff; border: none; padding: 10px 18px;
    border-radius: 5px; cursor: pointer; margin-bottom: 20px; font-size: 14px; 
    font-weight: bold; transition: 0.2s; display: flex; align-items: center; gap: 8px;
}
.back-btn:hover { background: var(--accent); }
.video-wrapper { 
    width: 100%; background: #000; border-radius: 8px; overflow: hidden; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.8); aspect-ratio: 16/9;
}
video { width: 100%; height: 100%; outline: none; object-fit: contain; }
#video-title { margin-top: 15px; font-size: 18px; color: #fff; line-height: 1.4; word-break: break-word; }

/* Responsive Adjustments for Mobile */
@media (max-width: 600px) {
    .header-spacer { display: none; }
    .movie-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 10px; }
    #video-player-section { padding: 10px; }
    .vpn-notice { font-size: 12px; }
}
