:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-card: #1e1e1e;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --accent: #e50914;
    --accent-hover: #f40612;
    --border: #333333;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Header */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(135deg, #e50914, #ff6b6b);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
    font-size: 0.9rem;
}

.nav-links a:hover {
    color: var(--accent);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    padding: 3rem 1.5rem;
    text-align: center;
    animation: fadeInUp 0.8s ease;
}

.hero h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff, #e50914);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Section Titles */
section h2 {
    font-size: 1.3rem;
    margin-bottom: 1.2rem;
    padding-left: 0.5rem;
    border-left: 4px solid var(--accent);
}

/* Video Grid - Responsive square cards */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.video-card {
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    animation: scaleIn 0.5s ease;
}

.video-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(229, 9, 20, 0.2);
}

/* Square thumbnail - 1:1 aspect ratio */
.video-thumbnail {
    position: relative;
    background: #000;
    aspect-ratio: 1 / 1;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-thumbnail video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.video-card:hover .video-thumbnail video {
    transform: scale(1.05);
}

/* Play icon overlay */
.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: rgba(229, 9, 20, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 1.2rem;
}

.video-card:hover .play-icon {
    opacity: 1;
}

/* Video info */
.video-info {
    padding: 0.75rem;
}

.video-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.2rem;
}

.video-views {
    color: var(--text-secondary);
    font-size: 0.7rem;
}

/* Watch Page */
.watch-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.video-player {
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    position: relative;
}

.video-player video {
    width: 100%;
    height: auto;
    display: block;
}

/* Video title on watch page */
.watch-container h1 {
    font-size: 1.2rem;
    margin: 0.5rem 0;
    line-height: 1.4;
}

/* Controls */
.controls {
    padding: 0.75rem;
    background: var(--bg-secondary);
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.control-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.4rem 0.8rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.8rem;
}

.control-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
}

/* Related Videos */
.related-title {
    font-size: 1.2rem;
    margin: 1.5rem 0 1rem 0;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

/* In-Video Ad Overlay */
.ad-overlay {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0,0,0,0.95);
    border-radius: 10px;
    padding: 15px;
    z-index: 2000;
    max-width: 280px;
    animation: slideInRight 0.5s ease;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
}

.ad-overlay .close-ad {
    position: absolute;
    top: -12px;
    right: -12px;
    background: var(--accent);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
}

/* Banner Ads */
.banner-ad {
    text-align: center;
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow-x: auto;
}

.banner-ad img,
.banner-ad iframe {
    max-width: 100%;
    height: auto;
}

/* Social Bar - Mobile friendly */
.social-bar {
    position: fixed;
    left: 10px;
    bottom: 20px;
    top: auto;
    transform: none;
    background: var(--bg-secondary);
    border-radius: 25px;
    padding: 0.5rem;
    z-index: 100;
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.social-bar a {
    display: inline-block;
    padding: 0.3rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
    font-size: 1.2rem;
}

.social-bar a:hover {
    color: var(--accent);
}

/* Admin Panel */
.admin-panel {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 10px;
    margin: 1rem;
}

.admin-form input,
.admin-form textarea {
    width: 100%;
    padding: 0.8rem;
    margin: 0.5rem 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 5px;
    font-size: 0.9rem;
}

.admin-form button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 1rem;
    width: 100%;
}

/* Table responsive */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    background: var(--bg-card);
    border-radius: 10px;
    overflow: hidden;
    font-size: 0.85rem;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

/* Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ============================================ */
/* RESPONSIVE DESIGN - Mobile First */
/* ============================================ */

/* Small phones (up to 480px) */
@media (max-width: 480px) {
    .nav-container {
        padding: 0.8rem 1rem;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .nav-links {
        gap: 1rem;
    }
    
    .nav-links a {
        font-size: 0.8rem;
    }
    
    .hero {
        padding: 2rem 1rem;
    }
    
    .hero h1 {
        font-size: 1.5rem;
    }
    
    .hero p {
        font-size: 0.8rem;
    }
    
    .container {
        padding: 1rem;
    }
    
    /* Grid for phones - 2 columns with square cards */
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    .video-info {
        padding: 0.5rem;
    }
    
    .video-title {
        font-size: 0.75rem;
        min-height: 2rem;
    }
    
    .video-views {
        font-size: 0.65rem;
    }
    
    .play-icon {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .watch-container {
        padding: 0.8rem;
    }
    
    .watch-container h1 {
        font-size: 1rem;
    }
    
    .controls {
        gap: 0.3rem;
    }
    
    .control-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
    }
    
    .social-bar {
        left: 5px;
        bottom: 10px;
        padding: 0.4rem;
        gap: 0.3rem;
    }
    
    .social-bar a {
        font-size: 1rem;
        padding: 0.2rem;
    }
    
    .ad-overlay {
        max-width: 250px;
        bottom: 10px;
        right: 10px;
        padding: 10px;
    }
    
    .banner-ad {
        margin: 1rem 0;
        padding: 0.8rem;
    }
    
    section h2 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    .admin-panel {
        padding: 1rem;
        margin: 0.5rem;
    }
    
    .admin-form input,
    .admin-form textarea {
        padding: 0.6rem;
        font-size: 0.85rem;
    }
}

/* Tablets (481px to 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .video-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    
    .related-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    
    .video-title {
        font-size: 0.8rem;
    }
    
    .container {
        padding: 1.2rem;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
}

/* Desktops (769px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .video-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.2rem;
    }
    
    .related-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.2rem;
    }
}

/* Large Desktops (1025px and above) */
@media (min-width: 1025px) {
    .video-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 1.5rem;
    }
    
    .related-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 1.5rem;
    }
    
    .video-title {
        font-size: 0.9rem;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .social-bar {
        position: fixed;
        left: 20px;
        top: 50%;
        bottom: auto;
        transform: translateY(-50%);
        flex-direction: column;
        border-radius: 10px;
        padding: 1rem;
    }
}

/* Landscape orientation fix */
@media (max-width: 768px) and (orientation: landscape) {
    .video-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .hero {
        padding: 1.5rem;
    }
    
    .hero h1 {
        font-size: 1.3rem;
    }
}