/* General Container */
.app-container {
    background: linear-gradient(135deg, #006AF0, #40FFFF); /* Blue to 006AF0 - 40FFFF Gradient */
    padding: 10px;
    max-width: 100%;
    margin: 0 auto;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
	align-items: center;
    justify-content: center;
}

.texth1 {
	width: 100%;
    justify-content: center;
    text-align: center;
}

/* Search Container */
.search-container {
    background: #fff;
    border-radius: 8px;
    padding: 5px 8px;
    margin-bottom: 0px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Conteneur principal */
.search-results-container {
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
    overflow: hidden;
	justify-content: center;
}

.search-results {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    scroll-behavior: smooth;
}

.nav-arrow {
    /* Style de base transparent, comme dans la proposition précédente */
    background-color: transparent;
    border: 2px solid #40FFFF;
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;

    /* --- LA MODIFICATION CLÉ ! --- */
    /* Une forme rectangulaire */
    width: 50px;
    height: 38px;
    border-radius: 8px; /* Coins légèrement arrondis */

    display: flex;
    justify-content: center;
    align-items: center;

    transition: background-color 0.25s ease, transform 0.25s ease;
}

/* Le SVG est de couleur jaune au départ */
.nav-arrow svg {
    fill: #40FFFF;
    width: 24px;
    height: 24px;
    transition: fill 0.25s ease;
}

.nav-arrow.left {
    left: 15px;
}

.nav-arrow.right {
    right: 15px;
}

/* Effet de remplissage au survol */
.nav-arrow:hover {
    background-color: #40FFFF;
}

.nav-arrow:hover svg {
    fill: white; /* La flèche devient blanche */
}

.nav-arrow[hidden] {
    display: none;
}

/* Règle pour ne pas afficher si inutile */
.nav-arrow[hidden] {
    display: none;
}

.search-results::-webkit-scrollbar {
    display: none; /* Hide scrollbars for better aesthetics */
}

.search-results::-webkit-scrollbar {
    height: 8px; /* Barre de défilement horizontale visible uniquement si nécessaire */
}

.search-results::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
}

/* 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 */
    }
}



.search-group {
    display: block;
    gap: 10px;
}

.search-input {
    padding: 10px;
    font-size: 1.3rem;
    border-radius: 5px;
    border: 2px solid #ddd;
    transition: all 0.3s;
    flex: 1;
	max-width: 1200px;
}

.duration_by {
    padding: 10px;
    border-radius: 5px;
    border: 2px solid #ddd;
    transition: all 0.3s;
    flex: 1;
	max-width: 130px;
	font-size: 1.3rem;
}
.sort_by {
    padding: 10px;
    border-radius: 5px;
    border: 2px solid #ddd;
    transition: all 0.3s;
    flex: 1;
	max-width: 130px;
	font-size: 1.3rem;
}
.upload_date {
    padding: 10px;
    border-radius: 5px;
    border: 2px solid #ddd;
    transition: all 0.3s;
    flex: 1;
	max-width: 130px;
	font-size: 1.3rem;
}

.search-input:focus {
    border-color: #006AF0; /* Blue focus */
    outline: none;
    box-shadow: 0 0 5px rgba(33, 150, 243, 0.5);
}

/* Results Section */
.results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2px;
    background: linear-gradient(135deg, #006AF0, #40FFFF); /* Blue to Red Gradient */

}
/* Result Card Container */
.result-card {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb); /* Light blue gradient */
    border: 2px solid #006AF0; /* Strong blue border */
    border-radius: 20px; /* Rounded corners */
    padding: 15px; /* Reduced padding */
    display: flex;
    flex-direction: column;
	flex: 0 0 22%;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2); /* Subtle shadow */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    margin: 0 auto; /* Centered cards */
	min-height: 270px;
	min-width: 261.11px;
}

.result-card:hover {
    transform: scale(1.05) rotate(-1deg); /* Hover effect with rotation */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3); /* Deeper shadow on hover */
}


/*
 * CODE CSS CORRIGÉ ET MIS À JOUR
 */

/* Le conteneur principal de la carte */
.result-card2 {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border: 2px solid #006AF0;
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    margin: 0; /* Marge en haut/bas, mais pas sur les côtés */
    min-height: 150px;

    /* ----- MODIFICATION PRINCIPALE ----- */
    width: 100%;             /* 1. La carte prend toute la largeur disponible */
    box-sizing: border-box;  /* 2. S'assure que le padding ne s'ajoute pas à la largeur */

    /* ----- Styles pour la disposition interne (image à gauche, infos à droite) ----- */
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;            /* 3. Ajoute un espace entre l'image et les infos */
}

/* Style pour l'image (thumbnail) */
.result-card2 .thumbnail2 {
    width: 400px;             /* Largeur fixe pour l'image */
    height: 280px;            /* Hauteur fixe */
    object-fit: cover;        /* Empêche l'image d'être déformée */
    border-radius: 12px;      /* Bords arrondis pour l'image */
    flex-shrink: 0;           /* Empêche l'image de rétrécir */
}

/* Nouveau conteneur pour les informations textuelles */
.result-card2 .card-info {
    display: flex;
    flex-direction: column;   /* Empile les infos (titre, source...) verticalement */
    justify-content: center;  /* Centre le contenu s'il y a de l'espace */
    flex-grow: 1;             /* Fait en sorte que ce bloc prenne tout l'espace restant */
    gap: 5px;                 /* Petit espace entre le titre, la source, etc. */
}

/* Le reste de vos styles pour le titre, les boutons, etc., peut rester inchangé.
   Assurez-vous juste de supprimer les marges qui pourraient créer des espaces non désirés. */
.result-card2 .result-title,
.result-card2 .result-source,
.result-card2 .result-duration {
    margin: 0; /* Important pour éviter les marges par défaut des <p> */
}

.result-card2 .download-button {
    margin-top: 10px; /* Un peu d'espace avant les boutons */
    display: flex;
    flex-direction: column; /* Boutons empilés */
    gap: 5px;
}

.result-card2:hover {
    transform: scale(1.03); /* Un scale un peu plus subtil */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}




/* Thumbnail Styling */
.thumbnail {
    width: 100%;
    height: 140px; /* Smaller height */
    object-fit: cover; /* Maintain aspect ratio */
    border-radius: 10px; /* Slightly rounded corners */
    border: 2px solid #40FFFF; /* Bold red border */
    margin-bottom: 5px; /* Minimal spacing below */
}

.thumbnail2 {
    width: 100%;
    height: 300px; /* Smaller height */
    object-fit: cover; /* Maintain aspect ratio */
    border-radius: 10px; /* Slightly rounded corners */
    border: 2px solid #40FFFF; /* Bold red border */
    margin-bottom: 5px; /* Minimal spacing below */
}

/* Title Styling */
.result-title {
    font-size: 0.9rem; /* Smaller font size */
    font-weight: bold;
    color: #0d47a1; /* Darker blue for readability */
    margin: 0;
    line-height: 1.2; /* Reduced line height */
    text-align: left;
    text-shadow: none; /* Removed subtle shadow */
}

/* Source & Duration Styling */
.result-source,
.result-duration,
.result-published {
    font-size: 0.8rem; /* Smaller font size */
    color: #444; /* Neutral dark gray */
    font-style: italic; /* Italic for distinction */
    margin: 1px 0; /* Compact spacing between lines */
}

/* Badges */
.badge {
    position: absolute;
    top: 5px; /* Adjusted position for smaller size */
    left: 5px;
    padding: 4px 10px; /* Reduced padding */
    font-size: 0.7rem; /* Smaller font size */
    font-weight: bold;
    color: #fff;
    border-radius: 15px; /* Rounded badge */
    background: #006AF0; /* Bright blue */
    text-transform: uppercase;
}

.badge.live {
    background: #d32f2f; /* Bright red for live */
}

.badge.popular {
    background: #006AF0; /* Bright blue for popular */
}

.badge.new {
    background: #388e3c; /* Bright green for new */
}

/* Channel Information */
.result-channel {
    font-size: 0.85rem; /* Reduced font size */
    font-weight: bold;
    color: #0d47a1; /* Consistent blue tone */
    margin-top: 5px;
    text-align: left;
}

/* Popup Container */
.popup-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    width: 90%;
    max-width: 400px;
    display: none; /* Hidden by default */
    flex-direction: column;
    gap: 15px;
    text-align: center;
	height: 82%;
    overflow-y: auto;
}

/* Show Popup */
.popup-container.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Close Popup Button */
.close-popup {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    cursor: pointer;
}

.close-popup:hover {
    color: #d32f2f;
}

/* MP3 and MP4 Titles */
.mp3-download, .mp4-download {
    font-size: 1.2rem;
    font-weight: bold;
    margin: 10px 0;
    color: #006AF0; /* Blue for MP4/MP3 Titles */
    text-align: center;
    text-transform: uppercase;
}

.mp3-download {
    color: #388e3c; /* Green for MP3 */
}

.mp4-download {
    color: #d32f2f; /* Red for MP4 */
}

/* Download Button (Global Style) */
.download-button {
    display: inline-block;
    padding: 8px 12px; /* Rendre les boutons plus compacts */
    font-size: 0.85rem; /* Réduction de la taille du texte */
    font-weight: bold;
    color: #fff;
    background: linear-gradient(135deg, #006AF0, #40FFFF); /* Dégradé bleu */
    border: none;
    border-radius: 8px; /* Coins arrondis */
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Ombre subtile */
}

.download-button:hover {
    background: linear-gradient(135deg, #0d47a1, #006AF0); /* Dégradé plus sombre */
    transform: translateY(-3px); /* Effet de levée au survol */
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.2); /* Ombre renforcée */
}

.download-button:active {
    background: #0d47a1; /* Bleu uni au clic */
    transform: translateY(0); /* Retirer l'effet de levée */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Ombre réduite */
}

/* Status Message */
.status-message {
    font-size: 0.9rem;
    color: #444;
    font-style: italic;
}

.status-message.error-message {
    color: #d32f2f;
}

/* Loader Overlay */
.loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    z-index: 1001;
}

/* Loader Animation */
.loader {
    width: 100px;
    height: 100px;
    background-color: #40FFFF; /* Red loader */
    border-radius: 50%; /* Circle shape */
	align-items: center;
    justify-content: center;
    animation: pulse 1.5s infinite ease-in-out;
	display: none;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.5;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}


/* Spinner */
.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #ddd;
    border-top: 3px solid #006AF0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Play Button Link */
.play-button {
    display: inline-block;
    width: 40px; /* Smaller button width */
    height: 40px; /* Smaller button height */
    line-height: 40px; /* Align text vertically */
    text-align: center; /* Center text horizontally */
    text-decoration: none; /* Remove underline */
    color: #fff; /* White text */
    font-size: 0.8rem; /* Smaller font size */
    font-weight: bold; /* Bold text */
    background: linear-gradient(135deg, #006AF0, #40FFFF); /* Blue gradient */
    border-radius: 50%; /* Circular shape */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Button shadow */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative; /* For glow effect */
    cursor: pointer;
}

.play-button:hover {
    transform: scale(1.1); /* Slight zoom effect on hover */
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3); /* Enhanced shadow on hover */
    background: linear-gradient(135deg, #1565c0, #42a5f5); /* Darker gradient on hover */
}

.play-button:active {
    transform: scale(0.95); /* Shrink effect on click */
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2); /* Reduced shadow */
    background: linear-gradient(135deg, #0d47a1, #1e88e5); /* Darker blue gradient */
}

/* Glow Effect */
.play-button::before {
    content: '';
    position: absolute;
    top: -6px; /* Adjusted for smaller size */
    left: -6px;
    width: 52px; /* Glow slightly larger than button */
    height: 52px;
    border-radius: 50%; /* Circular glow */
    background: radial-gradient(circle, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0));
    animation: glow 1.5s infinite;
    opacity: 0.7;
    z-index: -1; /* Behind the button */
}

@keyframes glow {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.5;
    }
    100% {
        transform: scale(1);
        opacity: 0.8;
    }
}

.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: #006AF0;
    }
.instructions h1 {
        text-align: center;
        color: #006AF0;
    }
	.instructions h2 {
        text-align: center;
        color: #006AF0;
    }
.instructions ol {
        padding-left: 20px;
    }
.instructions img {
        display: block;
        margin: 10px auto;
        border-radius: 5px;
    }
	

.format-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.format-button {
    background: linear-gradient(45deg, #40FFFF, #40FFFF);
    color: #fff;
    border: 2px solid transparent;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 0 10px #ccc;
}

.format-button:hover {
    background: linear-gradient(45deg, #40FFFF, #40FFFF);
    box-shadow: 0 0 15px #ccc;
    transform: translateY(-3px);
}

.format-button:active {
    transform: translateY(2px);
}

.selected-format {
    background: linear-gradient(45deg, #1d976c, #93f9b9) !important;
    box-shadow: 0 0 15px rgba(40, 167, 69, 0.8) !important;
}


/* --- Unique "Radial Progress" Loader Design --- */
.popup-container .loader-radial-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 15px 0;
}

.popup-container .loader-svg-container {
    position: relative;
    width: 100px;
    height: 100px;
}

.popup-container .loader-svg {
    transform: rotate(-90deg); /* Starts the circle from the top */
}

.popup-container .loader-track,
.popup-container .loader-arc {
    fill: transparent;
    stroke-width: 8;
}

.popup-container .loader-track {
    stroke: #f0f0f0; /* The light grey background track */
}

.popup-container .loader-arc {
    stroke: #007BFF; /* The blue progress arc */
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
}

.popup-container .loader-percentage-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2em;
    font-weight: bold;
    color: #007BFF;
}

.popup-container .loader-status-label {
    font-size: 0.9em;
    color: #333;
}