* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1f1f1f;
    --secondary: #282828;
    --accent: #e50914;
    --text: #ffffff;
    --text-secondary: #b3b3b3;
    --border: #404040;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--primary);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* NAVIGATION */
.navbar {
    background: linear-gradient(180deg, rgba(0,0,0,0.8), transparent);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    gap: 30px;
    flex: 1;
}

.nav-link {
    color: var(--text);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.3s ease;
    cursor: pointer;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent);
}

.nav-search {
    display: flex;
    align-items: center;
    background: var(--secondary);
    border-radius: 20px;
    padding: 8px 16px;
    flex: 0.3;
}

.nav-search input {
    background: none;
    border: none;
    color: var(--text);
    width: 100%;
    outline: none;
    font-size: 14px;
}

.nav-search input::placeholder {
    color: var(--text-secondary);
}

.nav-search button {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 16px;
}

.nav-user {
    font-size: 28px;
    color: var(--text);
    cursor: pointer;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    gap: 6px;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* MAIN CONTENT */
main {
    min-height: calc(100vh - 70px);
    padding-top: 0;
}

.page {
    display: none;
    animation: fadeIn 0.5s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* HERO BANNER */
.hero-banner {
    height: 500px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 500"><defs><pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse"><path d="M 40 0 L 0 0 0 40" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="1200" height="500" fill="url(%23grid)" /></svg>');
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
}

.hero-content h1 {
    font-size: 56px;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.hero-content p {
    font-size: 20px;
    margin-bottom: 40px;
    opacity: 0.9;
}

.play-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 14px 40px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.play-btn:hover {
    background: #cc070c;
    transform: scale(1.05);
}

/* SECTIONS */
.category-section {
    padding: 50px 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 30px;
    color: var(--text);
}

.page-header {
    padding: 40px;
    background: linear-gradient(180deg, var(--secondary), var(--primary));
    max-width: 1400px;
    margin: 0 auto;
}

.page-header h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 10px;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 16px;
}

.filter-bar {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--secondary);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
}

/* VIDEO GRID */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 0 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.video-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: var(--secondary);
    transition: all 0.3s ease;
}

.video-card:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

.video-thumbnail {
    width: 100%;
    height: 140px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-card:hover .play-overlay {
    opacity: 1;
}

.play-icon {
    width: 60px;
    height: 60px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.video-info {
    padding: 15px;
}

.video-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-height: 2.8em;
    line-height: 1.4em;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
}

.progress-bar-mini {
    width: 100%;
    height: 2px;
    background: var(--border);
    margin-top: 8px;
    border-radius: 1px;
    overflow: hidden;
}

.progress-bar-mini::after {
    content: '';
    display: block;
    height: 100%;
    background: var(--accent);
    width: 30%;
}

/* PLAYER PAGE */
.player-container {
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.player-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 40px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.player-wrapper {
    position: relative;
    background: #000;
}

.player-wrapper:hover .custom-controls {
    opacity: 1;
    visibility: visible;
}

.custom-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.9) 100%);
    padding: 40px 20px 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
}

.progress-bar {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2.5px;
    margin-bottom: 12px;
    position: relative;
    cursor: pointer;
    transition: height 0.2s ease;
}

.progress-bar:hover {
    height: 8px;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2.5px;
    width: 0%;
    transition: width 0.1s linear;
    position: relative;
}

.progress-handle {
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 1;
    box-shadow: 0 2px 8px rgba(229, 9, 20, 0.4);
}

.control-buttons {
    display: flex;
    align-items: center;
    gap: 5px;
    justify-content: space-between;
}

.control-btn {
    background: none;
    border: none;
    color: var(--text);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.control-btn:hover {
    color: var(--accent);
    background: rgba(255, 255, 255, 0.1);
}

.control-btn i {
    display: flex;
    align-items: center;
    justify-content: center;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.volume-slider {
    width: 70px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: all 0.2s ease;
}

.volume-slider:hover {
    background: rgba(255, 255, 255, 0.3);
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(229, 9, 20, 0.3);
}

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 4px rgba(229, 9, 20, 0.3);
}

.volume-slider::-moz-range-track {
    background: transparent;
    border: none;
}

/* VIDEO INFO SECTION */
.video-info {
    margin-bottom: 40px;
}

.video-info h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 15px;
}

.video-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--text-secondary);
}

.rating {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--accent);
}

.video-description {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 30px;
    font-size: 15px;
}

.video-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--secondary);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: var(--border);
    border-color: var(--accent);
    color: var(--accent);
}

.action-btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.action-btn.primary:hover {
    background: #cc070c;
}

/* SUGGESTED VIDEOS */
.suggested-section {
    margin-top: 60px;
    padding: 40px 0;
    border-top: 1px solid var(--border);
}

.suggested-section h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
}

.horizontal-scroll {
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.horizontal-scroll::-webkit-scrollbar {
    height: 8px;
}

.horizontal-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.horizontal-scroll::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

#suggestedGrid {
    display: flex !important;
    overflow-x: auto !important;
    gap: 20px !important;
    padding: 0 !important;
}

#suggestedGrid .video-card {
    flex: 0 0 280px;
}

/* FOOTER */
.footer {
    background: var(--primary);
    border-top: 1px solid var(--border);
    padding: 60px 40px 30px;
    margin-top: 80px;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h4 {
    color: var(--accent);
    margin-bottom: 15px;
    font-size: 14px;
    font-weight: 600;
}

.footer-section a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--accent);
}

.social-links {
    display: flex;
    gap: 20px;
    font-size: 20px;
}

.footer-bottom {
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
}

/* MODALS */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--secondary);
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    padding: 30px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 15px;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text);
    font-size: 28px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: var(--accent);
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.setting-item label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.setting-item select,
.setting-item input[type="checkbox"] {
    padding: 8px 12px;
    background: var(--primary);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 4px;
    font-size: 14px;
}

.setting-item input[type="checkbox"] {
    width: 20px;
    cursor: pointer;
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
    .nav-container {
        flex-wrap: wrap;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--primary);
        flex-direction: column;
        padding: 20px;
        border-bottom: 1px solid var(--border);
    }

    .nav-menu.active {
        display: flex;
    }

    .menu-toggle {
        display: flex;
    }

    .nav-search {
        flex: none;
        width: 40px;
        padding: 8px;
    }

    .nav-search input {
        display: none;
    }

    .hero-banner {
        height: 300px;
    }

    .hero-content h1 {
        font-size: 32px;
    }

    .hero-content p {
        font-size: 16px;
    }

    .category-section {
        padding: 30px 20px;
    }

    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 12px;
        padding: 0 20px;
    }

    .video-thumbnail {
        height: 100px;
    }

    .player-container {
        padding: 20px;
    }

    .video-info h1 {
        font-size: 24px;
    }

    .video-actions {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
        justify-content: center;
    }
}