/* Styles de base */
body {
    
    margin-right: 0px;
    margin-left: 0px;
    margin-bottom: 0px;
    margin-top: 0px;
}
/* General Container */
.app-container {
    background: linear-gradient(135deg, #F98947, #F6643B);
    padding: 1px;
    max-width: 100%;
    margin: 0 auto;
    border-radius: 0px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
	display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
	font-family: Arial, sans-serif;
}

/* Correction pour mobile */
@media (max-width: 768px) {
    html, body {
        height: auto; /* Permet au contenu de s'adapter à la hauteur du contenu */
        overflow-y: auto; /* Active le défilement vertical sur mobile */
        -webkit-overflow-scrolling: touch; /* Défilement fluide sur iOS */
    }
}

.ads-css {
    width: 100%;
    text-align: center;
}

.text-css {
    width: 100%;
    text-align: center;
}

/* Search Container */
.search-container {
    position: relative;
    max-width: 700px;
    margin: 2px auto;
    display: inline; /* Flexbox to align items */
    align-items: center;
    gap: 10px; /* Space between elements */
    padding: 10px;
    background-color: #fff;
    border-radius: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    animation: fadeIn 1s ease;
}

/* Search Input */
.search-input {
    flex: 1; /* Takes up remaining space */
    padding: 15px 20px;
    font-size: 1.1rem;
    border: none;
    border-radius: 50px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    background-color: #f8f8f8;
    outline: none;
}

.search-input:focus {
    transform: scale(1.03);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Dropdown Menus */
.sort_by, .upload_date {
    padding: 10px 15px;
    font-size: 1rem;
    color: #333;
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 25px;
    appearance: none; /* Remove native dropdown style */
    cursor: pointer;
    transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

.sort_by:hover, .upload_date:hover {
    background-color: #f2f2f2;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
}

.sort_by:focus, .upload_date:focus {
    background-color: #fff;
    box-shadow: 0px 6px 8px rgba(0, 0, 0, 0.2);
    outline: none;
}

/* Add a dropdown arrow to select elements */
.sort_by, .upload_date {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px 12px;
    padding-right: 40px;
}

/* Loader */
.loader {
    position: absolute;
    right: 15px;
    width: 45px;
    height: 45px;
    border: 3px solid #f6643b;
    border-top: 3px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}

/* Conteneur principal */
.results-container {
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden; /* Empêche les débordements visuels */
    width: 100%;
}

/* Conteneur des résultats */
.results {
    display: flex;
    overflow: hidden;
    scroll-behavior: smooth; /* Défilement fluide */
    gap: 0px;
    width: 100%; /* Prend toute la largeur disponible */
    padding: 0px;
}

/* --- NOUVELLE VERSION DES FLÈCHES DE DÉFILEMENT --- */

.nav-arrow {
    /* --- COULEUR PRINCIPALE --- */
    --main-orange: #FF7A00; /* Une belle couleur orange vive. Changez-la ici pour tout modifier ! */
    --arrow-color-hover: #FFFFFF; /* Couleur de la flèche au survol */

    background-color: transparent;
    border: 2px solid var(--main-orange);
    color: var(--main-orange); /* Couleur de l'icône SVG par défaut */
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;

    /* --- FORME ET DIMENSIONS --- */
    width: 45px;   /* Légèrement plus petit pour un cercle parfait */
    height: 45px;
    border-radius: 50%; /* La clé pour une forme circulaire ! */
    
    /* --- OMBRE POUR UN EFFET DE PROFONDEUR --- */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    
    /* --- CENTRAGE DE L'ICÔNE --- */
    display: flex;
    justify-content: center;
    align-items: center;

    /* --- TRANSITIONS FLUIDES --- */
    transition: all 0.3s ease;
}

/* Le SVG hérite de la couleur de son parent (.nav-arrow) */
.nav-arrow svg {
    fill: currentColor; /* 'currentColor' prend la couleur définie dans .nav-arrow */
    width: 22px;
    height: 22px;
    transition: fill 0.3s ease;
}

/* Positionnement des flèches */
.nav-arrow.left {
    left: 15px;
}

.nav-arrow.right {
    right: 15px;
}

/* --- EFFET AU SURVOL (HOVER) --- */
.nav-arrow:hover {
    background-color: var(--main-orange);
    color: var(--arrow-color-hover); /* La couleur de l'icône change */
    
    /* Effet de grossissement et ombre plus prononcée */
    transform: translateY(-50%) scale(1.1); 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

/* Masquer les flèches si elles sont inutiles */
.nav-arrow[hidden] {
    display: none;
}


/* --- BONUS : STYLISER LA BARRE DE DÉFILEMENT POUR QU'ELLE SOIT ASSORTIE --- */
/* Pour Chrome, Edge, et Safari */
.search-results::-webkit-scrollbar {
    height: 8px;
    background-color: #f0f0f0; /* Fond de la piste */
}

.search-results::-webkit-scrollbar-thumb {
    background-color: #FF7A00; /* La même couleur orange ! */
    border-radius: 10px;
    border: 2px solid #f0f0f0; /* Petite bordure pour un effet de contour */
}

.search-results::-webkit-scrollbar-thumb:hover {
    background-color: #E65100; /* Un orange plus foncé au survol */
}

/* Pour Firefox (optionnel mais recommandé) */
.search-results {
  scrollbar-width: thin;
  scrollbar-color: #FF7A00 #f0f0f0;
}

/* Correction pour mobile */
@media (max-width: 768px) {
    html, body {
        height: auto; /* Permet au contenu de s'adapter à la hauteur du contenu */
        overflow-y: auto; /* Active le défilement vertical sur mobile */
        -webkit-overflow-scrolling: touch; /* Défilement fluide sur iOS */
    }
}


/* Style des cartes de résultats */
.result-card {
    min-width: 300px;
    max-width: 300px;
	max-height: 400px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: inline-block;
    flex-shrink: 0;
    text-align: center;
}

.result-card:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.thumbnailshorts {
    width: 50%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 10px;
	max-height: 190px;
}

.result-title {
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
    text-align: center;
}

.result-channel, .result-views, .result-published, .result-length {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.result-link {
    color: orange;
    font-weight: bold;
    text-decoration: none;
    margin-top: 0px;
    display: inline-block;
}

/* Badge styles */
.badge {
    display: inline-block;
    padding: 4px 6px;
    font-size: 0.7em;
    font-weight: bold;
    color: #fff;
    border-radius: 5px;
    margin-top: 5px;
}

.badge.live { background-color: #d9534f; }
.badge.popular { background-color: orange; }
.badge.new { background-color: #5cb85c; }


.download-button {
    margin-top: 5px;
    padding: 8px 12px;
    font-size: 14px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    display: inline-block;
}

.download-button:hover {
    background-color: #45a049;
}
	
.result-card {
    position: relative; /* Pour placer la boîte déroulante par rapport à chaque carte */
}

/* Style du popup de téléchargement */
.popup-container {
    display: none; /* Masqué par défaut */
    position: absolute;
    top: 50%; /* Centré verticalement */
    left: 50%; /* Centré horizontalement */
    width: 85%; /* Largeur ajustée pour rester dans les limites du cadre */
    max-height: 70%; /* Limite la hauteur */
    overflow-y: auto; /* Défilement vertical si le contenu est trop long */
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.2);
    padding: 15px;
    transform: translate(-50%, -50%);
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.popup-container.show {
    display: block;
    opacity: 1;
    visibility: visible;
}

.popup-container h4 {
    font-size: 16px;
    margin: 10px 0 5px;
    color: #333;
    font-weight: bold;
    padding: 5px;
    border-radius: 4px;
}

/* Couleurs de fond pour chaque groupe */
.audio-video {
    background-color: #e0f7fa;
}
.video-only {
    background-color: #f1f8e9;
}
.audio-only {
    background-color: #ffe0b2;
}

.download-link {
    display: block;
    margin: 8px 0;
    color: #007BFF;
    text-decoration: none;
    padding: 8px;
    background: #f0f8ff;
    border-radius: 6px;
    transition: background 0.3s;
}

.download-link:hover {
    background: #d0e2fc;
}

/* Bouton de fermeture */
.close-popup {
    display: block;
    text-align: right;
    font-size: 18px;
    cursor: pointer;
    color: #888;
}

.thumbnail {
    width: 100%;
    height: 125px;
    border-radius: 8px;
    margin-bottom: 10px;
    object-fit: cover; /* Optional, helps with resizing and maintaining aspect ratio */
}

/* Style pour le bouton MP3 */
.mp3-download {
    color: #FF5722;
    margin-top: 15px;
    font-weight: bold;
    text-align: center;
}

/* Style pour l'animation "Patientez s'il vous plaît..." */
.loader-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.2);
    text-align: center;
    animation: fadeIn 0.3s ease-in-out;
}

.loader-overlay .spinner {
    width: 40px;
    height: 40px;
    border: 5px solid #ccc;
    border-top: 5px solid #F6643B;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

.loader-overlay p {
    font-size: 16px;
    color: #333;
    margin: 0;
}

/* Animation du spinner */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.download-button.mp4-button {
    background-color: #2196F3;
    margin-left: 10px;
}

.download-button.mp4-button:hover {
    background-color: #1976D2;
}

.mp4-download {
    color: #2196F3;
    margin-top: 15px;
    font-weight: bold;
    text-align: center;
}



.modal {
        display: none;
        position: fixed;
        z-index: 1000;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0,0,0,0.8);
    }
.modal-content {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: #222;
        padding: 20px;
        border-radius: 8px;
        text-align: center;
    }
.close {
        position: absolute;
        top: 10px;
        right: 15px;
        font-size: 24px;
        color: white;
        cursor: pointer;
    }

.instructions {
        text-align: left;
        margin-top: 15px;
        padding: 10px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 5px;
    }
.instructions h3 {
        text-align: center;
        color: #F6643B;
    }
.instructions h1 {
        text-align: center;
        color: #F6643B;
    }
	.instructions h2 {
        text-align: center;
        color: #F6643B;
    }
.instructions ol {
        padding-left: 20px;
    }
.instructions img {
        display: block;
        margin: 10px auto;
        border-radius: 5px;
    }
	
.format-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.format-button {
    background: #F6643B;
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease-in-out, transform 0.2s;
}

.format-button:hover {
    background: #f44a1a;
    transform: scale(1.05);
}

.format-button:active {
    transform: scale(0.95);
}

.selected-format {
    background: #28a745 !important;
}


/* --- Unique "Pulsing Dots" Loader Design --- */
.popup-container .loader-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
}

.popup-container .loader-label {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 15px;
}

.popup-container .dots-container {
    display: flex;
    gap: 8px; /* Espacement entre les points */
}

.popup-container .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #d0d0d0; /* Couleur du point inactif */
    transition: all 0.4s ease;
    animation: pulse-inactive 1.5s infinite ease-in-out;
}

/* Styles pour un point une fois qu'il est actif */
.popup-container .dot.active {
    background-color: #F98947; /* Couleur du point actif */
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.7);
    animation: none; /* Arrête l'animation de pulsation une fois actif */
}

/* Animation de pulsation pour les points inactifs */
@keyframes pulse-inactive {
    0%, 100% {
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        transform: scale(0.8);
        opacity: 1;
    }
}

/* Appliquer des délais d'animation pour un effet de vague */
.popup-container .dot:nth-child(2) { animation-delay: 0.1s; }
.popup-container .dot:nth-child(3) { animation-delay: 0.2s; }
.popup-container .dot:nth-child(4) { animation-delay: 0.3s; }
.popup-container .dot:nth-child(5) { animation-delay: 0.4s; }
.popup-container .dot:nth-child(6) { animation-delay: 0.5s; }
.popup-container .dot:nth-child(7) { animation-delay: 0.6s; }
.popup-container .dot:nth-child(8) { animation-delay: 0.7s; }
.popup-container .dot:nth-child(9) { animation-delay: 0.8s; }
.popup-container .dot:nth-child(10){ animation-delay: 0.9s; }


/*
  CSS pour la barre de progression indéterminée
*/
.indeterminate-progress-bar {
    width: 100%;
    height: 4px; /* Hauteur de la barre */
    background-color: #e0e0e0; /* Couleur de fond de la barre */
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    margin-top: 8px;
}

.indeterminate-progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #F6643B; /* Couleur de la barre qui bouge */
    animation: indeterminate-animation 1.5s infinite linear;
}

/* Animation pour la barre */
@keyframes indeterminate-animation {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Style de base pour le conteneur du loader (optionnel mais recommandé) */
.loader-container {
    padding: 20px;
}