:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --accent: #ef4444;
    --text-main: #f1f5f9;
    --text-dim: #94a3b8;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    height: 80px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.logo span {
    color: var(--accent);
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-list a {
    color: var(--text-dim);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.nav-list a:hover, .nav-list a.active {
    color: var(--accent);
}

.search-bar {
    display: flex;
    background: var(--bg-secondary);
    border-radius: 50px;
    padding: 5px 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.search-bar input {
    background: transparent;
    border: none;
    color: white;
    padding: 8px;
    outline: none;
    width: 200px;
}

.search-bar button {
    background: transparent;
    border: none;
    cursor: pointer;
}

/* Category Filter */
.filter-section {
    margin-bottom: 40px;
}

.category-filter {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
}

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

.category-filter::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 10px;
}

.filter-btn {
    white-space: nowrap;
    background: var(--bg-secondary);
    color: var(--text-dim);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 8px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
}

.filter-btn:hover, .filter-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Main Content */
.main-content {
    padding: 40px 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    position: relative;
    padding-left: 15px;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    height: 70%;
    width: 4px;
    background: var(--accent);
    border-radius: 2px;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.pagination-controls button {
    background: var(--bg-secondary);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.pagination-controls button:hover:not(:disabled) {
    background: var(--accent);
}

.pagination-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Movie Grid */
.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.movie-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
}

.movie-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.movie-thumb {
    width: 100%;
    aspect-ratio: 5 / 3;
    object-fit: cover;
}

.movie-info {
    padding: 15px;
}

.movie-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movie-meta-tags {
    display: flex;
    gap: 8px;
    font-size: 11px;
    color: var(--text-dim);
}

.tag {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.quality-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--bg-primary);
    margin: 5% auto;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 80%;
    max-width: 900px;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 20px;
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.movie-details-info {
    padding: 30px;
}

.movie-details-info h2 {
    margin-bottom: 10px;
}

.movie-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    color: var(--text-dim);
}

.server-list {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.server-btn {
    background: var(--bg-secondary);
    color: white;
    border: 1px solid var(--accent);
    padding: 8px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: var(--transition);
}

.server-btn:hover, .server-btn.active {
    background: var(--accent);
}

/* Skeleton Loader */
.skeleton-loader {
    display: contents;
}

.skeleton-card {
    height: 270px;
    background: linear-gradient(90deg, var(--bg-secondary) 25%, #2d3748 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 12px;
}

@keyframes loading {
    to {
        background-position: -200% 0;
    }
}

/* Footer */
.footer {
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-dim);
}

/* Watch Page Specific */
.watch-page .main-content {
    padding-top: 20px;
}

.player-wrapper {
    background: #000;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.player-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--bg-primary);
    z-index: 5;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-top: 5px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

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

.server-selection {
    padding: 20px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    gap: 20px;
}

.server-label {
    font-weight: 600;
    color: var(--text-dim);
}

.movie-meta-details {
    background: var(--bg-secondary);
    border-radius: 15px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.details-header {
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 20px;
}

.watch-title {
    font-size: 32px;
    margin-bottom: 10px;
}

.watch-meta {
    display: flex;
    gap: 10px;
}

.tag-badge {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent);
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}

.details-content {
    display: flex;
    gap: 30px;
}

.details-poster img {
    width: 200px;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.details-text {
    flex: 1;
}

.details-text h3 {
    margin-bottom: 15px;
    color: var(--accent);
}

.details-text p {
    color: var(--text-dim);
    margin-bottom: 20px;
    line-height: 1.8;
}

.extra-info p {
    margin-bottom: 8px;
    font-size: 15px;
}

.extra-info strong {
    color: var(--text-main);
}

/* Mobile Watch Responsive */
@media (max-width: 768px) {
    .details-content {
        flex-direction: column;
        align-items: center;
    }
    
    .details-poster img {
        width: 150px;
    }
    
    .server-selection {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        height: auto;
        padding: 15px;
        gap: 15px;
    }
    
    .header {
        height: auto;
    }

    .nav-list {
        gap: 15px;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .movie-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}
