/* ==================== RESET & GLOBALS ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #7b2cbf;
    --secondary-color: #c81e7d;
    --dark-bg: #0f0f0f;
    --darker-bg: #1a1a1a;
    --text-color: #ffffff;
    --text-secondary: #b0b0b0;
    --border-color: #333333;
    --accent-color: #ff006e;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-color);
    overflow-x: hidden;
}

/* ==================== HEADER ==================== */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.search-box {
    flex: 1;
    display: flex;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 0.5rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.search-box:focus-within {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--accent-color);
}

.search-box input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-color);
    outline: none;
    font-size: 1rem;
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

#searchBtn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-color);
    transition: transform 0.2s;
}

#searchBtn:hover {
    transform: scale(1.2);
}

.nav-buttons {
    display: flex;
    gap: 1rem;
}

.nav-buttons button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--text-color);
    padding: 0.7rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-buttons button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* ==================== MAIN CONTAINER ==================== */
.main-container {
    max-width: 1400px;
    margin: 2rem auto;
    display: flex;
    gap: 2rem;
    padding: 0 2rem;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    width: 250px;
    background: var(--darker-bg);
    padding: 1.5rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    height: fit-content;
    position: sticky;
    top: 80px;
}

.sidebar h3 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: var(--accent-color);
}

.filter-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.filter-section:last-child {
    border-bottom: none;
}

.filter-section h4 {
    font-size: 0.95rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-btn, .category-btn {
    display: block;
    width: 100%;
    background: var(--darker-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.6rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.filter-btn:hover, .category-btn:hover {
    background: var(--primary-color);
    color: var(--text-color);
    border-color: var(--primary-color);
}

.filter-btn.active, .category-btn.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--text-color);
    border-color: var(--accent-color);
    font-weight: 600;
}

.duration-filter {
    margin-right: 0.5rem;
    cursor: pointer;
}

.filter-section label {
    display: block;
    margin-bottom: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.filter-section label:hover {
    color: var(--text-color);
}

/* ==================== CONTENT ==================== */
.content {
    flex: 1;
}

.ad-banner {
    background: linear-gradient(135deg, rgba(123, 44, 191, 0.2) 0%, rgba(200, 30, 125, 0.2) 100%);
    border: 2px dashed var(--primary-color);
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==================== VIDEOS GRID ==================== */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.video-card {
    background: var(--darker-bg);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.video-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(123, 44, 191, 0.3);
}

.video-thumbnail {
    width: 100%;
    height: 130px;
    background: linear-gradient(135deg, rgba(123, 44, 191, 0.5) 0%, rgba(200, 30, 125, 0.5) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.video-thumbnail div {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-thumbnail::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 0, 110, 0.1) 0%, transparent 100%);
    z-index: 1;
}

.video-info {
    padding: 1rem;
}

.video-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.video-category {
    display: inline-block;
    background: var(--primary-color);
    color: var(--text-color);
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

/* ==================== MODAL ==================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--darker-bg);
    margin: auto;
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid var(--border-color);
}

.close {
    color: var(--text-secondary);
    float: right;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--accent-color);
}

.player-container {
    width: 100%;
    background: #000000;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

#videoPlayer {
    width: 100%;
    height: 400px;
    display: block;
    pointer-events: auto !important;
}

#modalTitle {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

#modalDescription {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.video-stats {
    display: flex;
    gap: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    flex-wrap: wrap;
}

/* ==================== UPLOAD FORM ==================== */
.upload-form {
    max-width: 600px;
}

.upload-form h2 {
    color: var(--accent-color);
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-color);
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(123, 44, 191, 0.3);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.btn-submit {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(123, 44, 191, 0.4);
}

/* ==================== FOOTER ==================== */
.footer {
    background: var(--darker-bg);
    border-top: 1px solid var(--border-color);
    padding: 2rem;
    text-align: center;
    margin-top: 3rem;
    color: var(--text-secondary);
}

.footer-links {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent-color);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
        gap: 1rem;
        padding: 0 1rem;
    }

    .sidebar {
        width: 100%;
        position: static;
    }

    .videos-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .search-box {
        width: 100%;
    }

    .nav-buttons {
        width: 100%;
    }

    .nav-buttons button {
        flex: 1;
    }

    .modal-content {
        width: 95%;
        padding: 1rem;
    }

    #videoPlayer {
        height: 250px;
    }

    .filter-section {
        display: none;
    }

    .filter-section.active {
        display: block;
    }
}

@media (max-width: 480px) {
    .videos-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .logo h1 {
        font-size: 1.4rem;
    }

    .header-content {
        padding: 0;
    }

    .modal-content {
        max-width: 100%;
    }
}