/* ===== RESPONSIVE MODAL STYLES ===== */

/* Base Modal Styles */
.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(10px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

/* Responsive Modal Content */
.modal-content {
    background: rgba(31, 31, 53, 0.95);
    border-radius: 20px;
    padding: 20px;
    width: 100%;
    max-width: 1400px;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid rgba(145, 70, 255, 0.3);
    box-sizing: border-box;
    overflow: hidden;
}

/* Modal Header - always visible and STICKY */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 20px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    background: rgba(31, 31, 53, 0.98);
    z-index: 10;
    padding: 0 0 10px 0;
    border-bottom: 1px solid rgba(145, 70, 255, 0.2);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
    margin: 0;
    flex: 1;
    line-height: 1.3;
    word-wrap: break-word;
}

.close-btn {
    background: rgba(255, 107, 107, 0.2);
    border: 2px solid #ff6b6b;
    color: #ff6b6b;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.close-btn:hover {
    background: #ff6b6b;
    color: white;
    transform: rotate(90deg);
}

/* Modal Body - scrollable when needed */
.modal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
    gap: 20px;
}

/* Video Container - responsive aspect ratio */
.twitch-player-container {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
    min-height: 400px;
}

.twitch-player-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Clip Details Layout - Default Stacked */
.clip-details-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.clip-details-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.clip-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    color: #adadb8;
}

.detail-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.detail-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(145, 70, 255, 0.3);
    transform: translateY(-2px);
}

.detail-label {
    font-size: 0.85rem;
    color: #9146ff;
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 1rem;
    color: white;
    font-weight: 500;
    line-height: 1.3;
    word-break: break-word;
}

/* Clip Actions */
.clip-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.clip-action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.copy-btn {
    background: #007bff;
    color: white;
}

.copy-btn:hover {
    background: #0056b3;
}

.report-btn {
    background: #dc3545;
    color: white;
}

.report-btn:hover {
    background: #c82333;
}

.report-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* External Links */
.external-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.external-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(145, 70, 255, 0.1);
    border: 2px solid #9146ff;
    color: #9146ff;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.external-link:hover {
    background: #9146ff;
    color: white;
    transform: translateY(-2px);
}

.coffee-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    color: #9146ff;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.coffee-link:hover {
    color: white;
    transform: translateY(-2px);
}

/* Large Screens - Side by Side Layout (1200px+) */
@media (min-width: 1200px) {
    .modal-content {
        padding: 30px;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 0 0 15px 0;
    }
    
    .clip-details-container {
        display: flex;
        flex-direction: row;
        gap: 30px;
        align-items: flex-start;
        min-height: 450px;
    }
    
    .twitch-player-container {
        flex: 0 0 65%;
        width: 65%;
        min-width: 0;
        min-height: 450px;
        box-sizing: border-box;
    }
    
    .clip-details-info {
        flex: 0 0 calc(35% - 30px);
        width: calc(35% - 30px);
        min-width: 0;
        max-height: 450px;
        overflow-y: auto;
        box-sizing: border-box;
    }
    
    .clip-details {
        grid-template-columns: 1fr;
    }
    
    .modal-title {
        font-size: 1.8rem;
    }
}

/* Extra Large Screens - Optimized Layout (1920px+) */
@media (min-width: 1920px) {
    .clip-details-container {
        gap: 40px;
    }
    
    .twitch-player-container {
        flex: 0 0 70%;
        width: 70%;
        min-height: 500px;
    }
    
    .clip-details-info {
        flex: 0 0 calc(30% - 40px);
        width: calc(30% - 40px);
        max-height: 500px;
    }
    
    .modal-title {
        font-size: 2rem;
    }
}

/* Medium Screens Modal (768px-1199px) */
@media (max-width: 1199px) and (min-width: 768px) {
    .modal-content {
        padding: 25px;
    }
    
    .twitch-player-container {
        min-height: 400px;
    }
    
    .clip-details {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-title {
        font-size: 1.6rem;
    }
}

/* Small Screens Modal (up to 767px) */
@media (max-width: 767px) {
    .modal {
        padding: 5px;
    }
    
    .modal-content {
        padding: 15px;
        border-radius: 15px;
        max-height: 98vh;
    }
    
    .modal-header {
        margin-bottom: 15px;
        position: sticky;
        top: 0;
        background: rgba(31, 31, 53, 0.98);
        padding: 0 0 10px 0;
        border-bottom: 1px solid rgba(145, 70, 255, 0.2);
    }
    
    .close-btn {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
        flex-shrink: 0;
    }
    
    .modal-title {
        font-size: 1.3rem;
        margin-right: 10px;
    }
    
    .modal-body {
        gap: 15px;
    }
    
    .twitch-player-container {
        min-height: 250px;
    }
    
    .clip-details {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .detail-item {
        padding: 15px;
        min-height: 70px;
    }
    
    .external-links {
        gap: 10px;
        justify-content: stretch;
        flex-direction: column;
    }
    
    .external-link {
        justify-content: center;
        padding: 12px 16px;
    }
    
    .coffee-link {
        justify-content: center;
        padding: 12px 16px;
    }
}

/* Extra Small Screens Modal (up to 480px) */
@media (max-width: 480px) {
    .modal-content {
        padding: 10px;
        border-radius: 10px;
    }
    
    .modal-title {
        font-size: 1.1rem;
    }
    
    .detail-item {
        padding: 12px;
    }
    
    .detail-label {
        font-size: 0.8rem;
    }
    
    .detail-value {
        font-size: 0.9rem;
    }
}

/* ===== MAIN STYLES ===== */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 100%);
    color: white;
    line-height: 1.6;
}

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

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 5px 20px;
}

.header-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.logo-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-image {
    height: auto;
    width: 100px;
}

.logo-text h1 {
    font-size: 2.8rem;
    font-weight: 800;
    color: white;
}

.logo-text p {
    font-size: 1.2rem;
    color: #d3cfff;
}

.logo-link:hover {
    transform: translateY(-2px);
}

.header h1 {
    font-size: 3rem;
    background: linear-gradient(45deg, #9146ff, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header p {
    font-size: 1.2rem;
    color: #adadb8;
}

.stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 100px;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #9146ff;
}

.stat-label {
    color: #adadb8;
    font-size: 0.9rem;
}

.unified-search-section {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    border-radius: 25px;
    padding: 30px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.search-container {
    margin: 0 auto;
}

.main-search-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    align-items: center;
}

.search-input-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.main-search-input {
    width: 100%;
    padding: 16px 50px 16px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    color: white;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
}

.main-search-input:focus {
    border-color: #9146ff;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 20px rgba(145, 70, 255, 0.3);
}

.main-search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.clear-search-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 107, 107, 0.2);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #ff6b6b;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.clear-search-btn:hover {
    background: #ff6b6b;
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.main-search-btn {
    padding: 16px 30px;
    background: linear-gradient(45deg, #9146ff, #ff6b6b);
    border: none;
    border-radius: 15px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-size: 16px;
}

.main-search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(145, 70, 255, 0.4);
    background: linear-gradient(45deg, #7c3aed, #ff5252);
}

.filter-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-label {
    font-size: 0.9rem;
    color: #9146ff;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 18px;
    background: rgba(145, 70, 255, 0.1);
    border: 2px solid rgba(145, 70, 255, 0.3);
    color: #9146ff;
    border-radius: 20px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-btn:hover {
    background: rgba(145, 70, 255, 0.2);
    border-color: rgba(145, 70, 255, 0.5);
    transform: translateY(-1px);
}

.filter-btn.active {
    background: #9146ff;
    color: white;
    border-color: #9146ff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(145, 70, 255, 0.4);
}

.clip-count {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-left: 4px;
}

.filter-btn.active .clip-count {
    opacity: 0.9;
}

.search-info {
    background: rgba(145, 70, 255, 0.1);
    border: 1px solid rgba(145, 70, 255, 0.3);
    border-radius: 15px;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.search-result-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
    text-align: center;
}

.search-query {
    font-weight: 600;
    color: #9146ff;
    font-size: 1.1rem;
}

.search-filters {
    font-size: 0.9rem;
    color: #adadb8;
}

.main-content {
    width: 100%;
}

.content-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    min-height: 70vh;
}

.clips-section {
    display: flex;
    flex-direction: column;
}

.clips-section h2 {
    font-size: 2rem;
    margin-bottom: 30px;
    text-align: center;
    color: white;
}

#clipsContainer {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.clips-grid {
    display: grid;
    gap: 25px;
    margin: 0 auto;
    max-width: none;
    width: 100%;
    justify-content: center;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

.clip-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 450px;
    display: flex;
    flex-direction: column;
    animation: fadeInUp 0.3s ease-out forwards;
}

.clip-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: #9146ff;
}

.clip-card.featured-clip {
    position: relative;
    border: 1px solid rgba(168, 85, 247, 0.3);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.4), 0 0 40px rgba(168, 85, 247, 0.2), 0 0 60px rgba(168, 85, 247, 0.1), inset 0 0 0 1px rgba(168, 85, 247, 0.3);
}

.clip-card.featured-clip:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 25px rgba(168, 85, 247, 0.6), 0 0 50px rgba(168, 85, 247, 0.3), 0 0 80px rgba(168, 85, 247, 0.15), inset 0 0 0 1px rgba(168, 85, 247, 0.5);
    border-color: rgba(168, 85, 247, 0.5);
}

.clip-thumbnail {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.clip-card:hover .clip-thumbnail {
    transform: scale(1.05);
}

.clip-info {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.clip-title {
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 1.1rem;
    line-height: 1.4;
    flex: 1;
}

.clip-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #adadb8;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.clip-meta-creator {
    color: #adadb8;
    font-weight: 500;
    font-size: 0.85rem;
}

.clip-views {
    color: #9146ff;
    font-weight: 600;
}

.streamer-link,
.game-link,
.creator-link {
    color: #9146ff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.streamer-link:hover,
.game-link:hover,
.creator-link:hover {
    color: #a855f7;
    text-shadow: 0 0 8px rgba(145, 70, 255, 0.3);
    text-decoration: none;
}

.streamer-link:visited,
.game-link:visited,
.creator-link:visited,
.streamer-link:active,
.game-link:active,
.creator-link:active {
    color: #9146ff;
}

.featured-text {
    color: #a855f7;
    font-weight: 600;
    text-shadow: 0 0 8px rgba(168, 85, 247, 0.6);
}

.clip-buttons {
    display: flex;
    gap: 12px;
    margin-top: auto;
}

.clip-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    padding: 12px 16px;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    text-align: center;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.clip-btn-play {
    background: linear-gradient(45deg, #9146ff, #a855f7);
    border: 2px solid transparent;
}

.clip-btn-play:hover {
    background: linear-gradient(45deg, #7c3aed, #9333ea);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(145, 70, 255, 0.4);
}

.clip-btn-twitch {
    background: rgba(145, 70, 255, 0.1);
    border: 2px solid #9146ff;
    color: #9146ff;
}

.clip-btn-twitch:hover {
    background: rgba(145, 70, 255, 0.2);
    border-color: #a855f7;
    color: #a855f7;
    transform: translateY(-2px);
}

.sidebar {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.sidebar h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: #9146ff;
    text-align: center;
}

.categories-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(145, 70, 255, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(145, 70, 255, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.category-item:hover {
    background: rgba(145, 70, 255, 0.2);
    border-color: rgba(145, 70, 255, 0.4);
    transform: translateY(-2px);
    text-decoration: none;
}

.category-item:visited,
.category-item:active {
    color: inherit;
    text-decoration: none;
}

.category-name {
    font-weight: 600;
    color: white;
    font-size: 0.9rem;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-count {
    background: #9146ff;
    color: white;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 45px;
    text-align: center;
    white-space: nowrap;
}

.loading,
.loading-categories {
    text-align: center;
    color: #adadb8;
}

.loading {
    padding: 60px 0;
    font-size: 1.2rem;
}

.loading-categories {
    padding: 20px;
}

.loading-small {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #adadb8;
    font-size: 0.85rem;
}

.spinner,
.spinner-small {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top: 3px solid #9146ff;
    animation: spin 1s linear infinite;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 20px;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.loading-more {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    gap: 12px;
    font-size: 0.9rem;
    color: #adadb8;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 20px;
}

.loading-more .spinner {
    width: 20px;
    height: 20px;
    border-width: 2px;
    margin: 0;
}

.end-message {
    text-align: center;
    padding: 30px 20px;
    font-size: 0.95rem;
    color: #adadb8;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 20px;
    background: rgba(145, 70, 255, 0.05);
    border-radius: 10px;
}

.error-message {
    text-align: center;
    padding: 20px;
    margin: 20px 0;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 10px;
    color: #ff6b6b;
}

.retry-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    margin-left: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    background: #ff5252;
    transform: translateY(-1px);
}

.no-results {
    text-align: center;
    color: #adadb8;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.no-results-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.6;
}

.no-results h3 {
    font-size: 1.5rem;
    color: white;
    margin-bottom: 10px;
}

.no-results p {
    font-size: 1rem;
    margin-bottom: 8px;
}

.no-results-suggestion {
    color: #9146ff !important;
    font-weight: 500;
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(145, 70, 255, 0.9);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 600;
    z-index: 10000;
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ===== RESPONSIVE LAYOUT BREAKPOINTS ===== */

@media (min-width: 1600px) {
    .clips-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 1600px;
        margin: 0 auto;
    }
}

@media (min-width: 2000px) {
    .clips-grid {
        grid-template-columns: repeat(4, 1fr);
        max-width: 2000px;
        margin: 0 auto;
    }
}

@media (min-width: 2400px) {
    .clips-grid {
        grid-template-columns: repeat(5, 1fr);
        max-width: 2400px;
        margin: 0 auto;
    }
}

@media (min-width: 1400px) {
    .container {
        max-width: none;
        padding: 20px 40px;
    }

    .content-layout {
        grid-template-columns: 1fr 320px;
        gap: 40px;
    }
}

@media (min-width: 1600px) {
    .container {
        padding: 20px 60px;
    }

    .content-layout {
        grid-template-columns: 1fr 340px;
        gap: 50px;
    }
}

@media (min-width: 2000px) {
    .container {
        padding: 20px 80px;
    }
}

/* Medium to Large Screens */
@media (max-width: 1200px) {
    .content-layout {
        grid-template-columns: 1fr 280px;
        gap: 30px;
    }

    .sidebar {
        padding: 18px;
    }

    .sidebar h3 {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }

    .category-item {
        padding: 8px 10px;
    }

    .category-name {
        font-size: 0.8rem;
    }

    .category-count {
        font-size: 0.7rem;
        padding: 2px 5px;
        min-width: 35px;
    }

    .clips-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    }
}

/* Tablet Layout */
@media (max-width: 1000px) {
    .content-layout {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
    }

    .clips-section {
        grid-row: 1;
    }

    .sidebar {
        grid-row: 2;
        position: static;
        margin-top: 30px;
        margin-bottom: 0;
    }

    .clips-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

/* Mobile Layout */
@media (max-width: 800px) {
    .container {
        padding: 15px;
    }

    .header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 20px;
        padding: 5px 15px;
    }

    .header-left {
        align-items: center;
    }

    .stats {
        display: none;
    }

    .header h1 {
        font-size: 2rem;
    }

    .unified-search-section {
        padding: 20px;
    }

    .main-search-bar {
        flex-direction: column;
        gap: 12px;
    }

    .main-search-input {
        padding: 14px 45px 14px 16px;
        font-size: 16px;
    }

    .main-search-btn {
        padding: 14px 24px;
        width: 100%;
        justify-content: center;
    }

    .filter-controls {
        gap: 15px;
    }

    .filter-buttons {
        justify-content: center;
    }

    .filter-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .search-result-info {
        align-items: flex-start;
        text-align: left;
    }

    .clips-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .clip-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .stats {
        justify-content: center;
        gap: 15px;
    }

    .stat-item {
        min-width: 100px;
        padding: 15px;
    }

    .clip-card.featured-clip {
        box-shadow: 0 0 15px rgba(168, 85, 247, 0.3), 0 0 30px rgba(168, 85, 247, 0.15), inset 0 0 0 1px rgba(168, 85, 247, 0.2);
    }

    .clip-card.featured-clip:hover {
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2), 0 0 20px rgba(168, 85, 247, 0.4), 0 0 40px rgba(168, 85, 247, 0.2), inset 0 0 0 1px rgba(168, 85, 247, 0.3);
    }
}

/* Small Mobile Layout */
@media (max-width: 480px) {
    .unified-search-section {
        padding: 15px;
        border-radius: 20px;
    }

    .filter-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .clip-count {
        display: none;
    }

    .main-search-input {
        padding: 12px 40px 12px 14px;
        font-size: 15px;
    }

    .clear-search-btn {
        width: 24px;
        height: 24px;
        right: 8px;
        font-size: 14px;
    }

    .main-search-btn {
        padding: 12px 20px;
        font-size: 15px;
    }
}