/* ========================================
   🎬 TOP CLIPS - PAGE STYLES
   ======================================== */

/* === HEADER SECTION COMPACTE === */
.top-clips-header {
    border-bottom: 1px solid var(--color-border);
}

/* === CONTRÔLES ET FILTRES === */
.clips-controls {
    border-bottom: 1px solid var(--color-border);
}

.filter-group {
    min-width: 16rem;
}

.control-select {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 0.8rem;
    padding: 0.8rem 1.2rem;
    color: var(--color-text);
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 14rem;
}

.control-select:hover,
.control-select:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 0.3rem rgba(var(--color-primary-rgb), 0.1);
}

.search-group {
    position: relative;
    min-width: 28rem;
}

.search-input {
    width: 100%;
    padding: 0.8rem 4rem 0.8rem 1.2rem;
    border: 1px solid var(--color-border);
    border-radius: 0.8rem;
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 1.4rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.3rem rgba(var(--color-primary-rgb), 0.1);
}

.search-clear-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--color-muted);
    font-size: 1.6rem;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 0.4rem;
    transition: all 0.3s ease;
}

.search-clear-btn:hover {
    color: var(--color-text);
    background: var(--color-secondary-light);
}

/* === GRILLE DES CLIPS === */
.clips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(32rem, 1fr));
    gap: 2.4rem;
    margin-top: 2rem;
}

.clip-card {
    background: var(--color-secondary);
    border-radius: 1.2rem;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid var(--color-border);
    position: relative;
}

.clip-card:hover {
    transform: translateY(-0.4rem);
    box-shadow: 0 1.2rem 2.4rem rgba(0, 0, 0, 0.15);
    border-color: var(--color-primary);
}

.clip-thumbnail {
    position: relative;
    width: 100%;
    height: 18rem;
    overflow: hidden;
    background: var(--color-bg);
}

.clip-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.clip-card:hover .clip-image {
    transform: scale(1.05);
}

.clip-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.1) 0%,
        rgba(0, 0, 0, 0) 30%,
        rgba(0, 0, 0, 0) 70%,
        rgba(0, 0, 0, 0.8) 100%
    );
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 1.2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.clip-card:hover .clip-overlay {
    opacity: 1;
}

.clip-duration,
.clip-views {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 0.4rem;
    font-size: 1.2rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.clip-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6rem;
    height: 6rem;
    background: rgba(var(--color-primary-rgb), 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    opacity: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.clip-card:hover .clip-play-btn {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

.clip-info {
    padding: 1.6rem;
}

.clip-title {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.8rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.clip-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.clip-streamer {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--color-primary);
}

.clip-date {
    font-size: 1.2rem;
    color: var(--color-muted);
}

.clip-creator {
    font-size: 1.2rem;
    color: var(--color-muted);
    font-style: italic;
}

/* === PLACEHOLDERS === */
.loading-placeholder {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.loading-spinner {
    width: 4rem;
    height: 4rem;
    border: 0.4rem solid var(--color-border);
    border-top: 0.4rem solid var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1.6rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-placeholder {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    background: var(--color-secondary);
    border-radius: 1.2rem;
    border: 1px solid var(--color-border);
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 1.6rem;
}

.error-placeholder h3 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.8rem;
}

.error-placeholder p {
    font-size: 1.4rem;
    color: var(--color-muted);
    margin-bottom: 2rem;
}

/* === BOUTON CHARGER PLUS === */
.btn-1 {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 1.2rem 2.4rem;
    border-radius: 0.8rem;
    font-size: 1.4rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-1:hover {
    background: var(--color-primary-dark);
    transform: translateY(-0.2rem);
    box-shadow: 0 0.8rem 1.6rem rgba(var(--color-primary-rgb), 0.3);
}

/* === RESPONSIVE === */
@media (max-width: 1200px) {
    .clips-grid {
        grid-template-columns: repeat(auto-fill, minmax(28rem, 1fr));
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    /* Hero section mobile */
    .top-clips-hero {
        padding: 3rem 1.5rem !important;
    }
    
    .top-clips-hero h1 {
        font-size: 3.2rem !important;
    }
    
    .top-clips-hero p {
        font-size: 1.6rem !important;
    }
    
    /* Stats mobile */
    .d-flex.justify-center {
        flex-direction: row !important;
        gap: 2rem !important;
    }
    
    .d-flex.justify-center > div {
        flex: 1;
        text-align: center;
    }
    
    /* Contrôles mobile */
    .clips-controls {
        padding: 1.5rem !important;
    }
    
    .d-flex.justify-between {
        flex-direction: column !important;
        gap: 1.6rem !important;
    }
    
    .d-flex.items-center.gap-16 {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1.2rem !important;
    }
    
    .filter-group {
        min-width: auto;
        width: 100%;
    }
    
    .control-select {
        width: 100%;
        min-width: auto;
    }
    
    .search-group {
        min-width: auto;
        width: 100%;
    }
    
    /* Grille mobile */
    .clips-grid {
        grid-template-columns: 1fr;
        gap: 1.6rem;
        margin-top: 1.5rem;
    }
    
    .clip-card {
        border-radius: 1rem;
    }
    
    .clip-thumbnail {
        height: 20rem;
    }
    
    .clip-info {
        padding: 1.2rem;
    }
    
    .clip-title {
        font-size: 1.5rem;
    }
    
    .clip-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }
    
    /* Overlay toujours visible sur mobile */
    .clip-overlay {
        opacity: 1;
    }
    
    .clip-play-btn {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@media (max-width: 480px) {
    .clips-grid {
        gap: 1.2rem;
    }
    
    .clip-thumbnail {
        height: 18rem;
    }
    
    .clip-play-btn {
        width: 5rem;
        height: 5rem;
        font-size: 1.8rem;
    }
    
    .search-input {
        font-size: 1.6rem;
        padding: 1rem 4rem 1rem 1.2rem;
    }
}

/* === ANIMATIONS === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(2rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.clip-card {
    animation: fadeInUp 0.6s ease forwards;
}

.clip-card:nth-child(1) { animation-delay: 0.1s; }
.clip-card:nth-child(2) { animation-delay: 0.2s; }
.clip-card:nth-child(3) { animation-delay: 0.3s; }
.clip-card:nth-child(4) { animation-delay: 0.4s; }
.clip-card:nth-child(5) { animation-delay: 0.5s; }
.clip-card:nth-child(6) { animation-delay: 0.6s; }

/* === MODAL CLIPS === */
.clip-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.clip-modal.active {
    opacity: 1;
}

.clip-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    cursor: pointer;
}

.clip-modal-content {
    position: relative;
    background: var(--color-secondary);
    border-radius: 1.2rem;
    box-shadow: 0 2rem 4rem rgba(0, 0, 0, 0.3);
    width: 90vw;
    max-width: 120rem;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.clip-modal.active .clip-modal-content {
    transform: scale(1);
}

.clip-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.6rem 2rem;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-secondary-light);
}

.clip-modal-info h3 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 0.4rem 0;
    line-height: 1.3;
}

.clip-modal-info p {
    font-size: 1.4rem;
    color: var(--color-primary);
    margin: 0;
    font-weight: 500;
}

.clip-modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--color-muted);
    cursor: pointer;
    padding: 0.8rem;
    border-radius: 0.6rem;
    transition: all 0.3s ease;
    line-height: 1;
}

.clip-modal-close:hover {
    background: var(--color-secondary);
    color: var(--color-text);
}

.clip-modal-body {
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
    height: 50vh;
}

.clip-modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.clip-modal-footer {
    padding: 1.6rem 2rem;
    border-top: 1px solid var(--color-border);
    background: var(--color-secondary-light);
    text-align: center;
}

.btn-twitch {
    background: #9146FF;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 0.8rem;
    font-size: 1.4rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-twitch:hover {
    background: #7c3aed;
    transform: translateY(-0.2rem);
    box-shadow: 0 0.8rem 1.6rem rgba(145, 70, 255, 0.3);
}

/* === RESPONSIVE MODAL === */
@media (max-width: 768px) {
    .clip-modal-content {
        max-width: 95vw;
        max-height: 95vh;
        margin: 1rem;
    }
    
    .clip-modal-header {
        padding: 1.2rem 1.6rem;
    }
    
    .clip-modal-info h3 {
        font-size: 1.6rem;
    }
    
    .clip-modal-info p {
        font-size: 1.3rem;
    }
    
    .clip-modal-body iframe {
        height: 25rem;
    }
    
    .clip-modal-footer {
        padding: 1.2rem 1.6rem;
    }
    
    .btn-twitch {
        width: 100%;
        padding: 1.2rem;
    }
}

@media (max-width: 480px) {
    .clip-modal-content {
        max-width: 98vw;
        max-height: 98vh;
        margin: 0.5rem;
        border-radius: 0.8rem;
    }
    
    .clip-modal-body iframe {
        height: 22rem;
    }
}

/* === UTILITAIRES === */
.section-padding {
    padding: 4rem 2rem;
}

@media (max-width: 768px) {
    .section-padding {
        padding: 2.5rem 1.5rem;
    }
}
