/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body */
body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    background: #f4f7fc; /* Soft off-white background */
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
	width: -webkit-fill-available;
}

/* Header */
.pads {
    background: linear-gradient(135deg, #64b5f6, #42a5f5);
    color: #fff;
    text-align: center;
	width: 100%
    padding: 1px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.site-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.site-subtitle {
    font-size: 0.9rem;
}

/* Main Content */
.main-content {
    padding: 0;
	background: linear-gradient(135deg, #64b5f6, #42a5f5);
    color: #fff;
    text-align: center;
    padding: 1px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Search Section */
.search-section {
    display: flex;
    justify-content: center;
	padding: 10px;
}

.search-container {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 600px;
}

/* Conteneur principal */
.search-results-container {
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
    overflow: hidden;
}

.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;
}

/* --- DESIGN POUR FLÈCHES DE NAVIGATION - THÈME ROUGE --- */

/* Conteneur de base pour les deux flèches */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;

    /* TAILLE : On garde la forme de "languette" */
    width: 45px;
    height: 80px;

    /* EFFET VERRE DÉPOLI (Glassmorphism) - Version Rouge */
    /* On utilise la couleur rouge #E53935 (RGB: 229, 57, 53) */
    background: rgba(229, 57, 53, 0.25); /* Fond rouge très transparent */
    backdrop-filter: blur(5px); /* Floute ce qui est derrière */
    -webkit-backdrop-filter: blur(5px); /* Pour la compatibilité Safari */
    border: 1px solid rgba(255, 255, 255, 0.2); /* Bordure blanche subtile, qui va bien avec le rouge */

    /* STYLE GÉNÉRAL */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease-in-out;
}

/* Forme spécifique pour la flèche gauche (arrondi à droite) */
.nav-arrow.left {
    left: 0; 
    border-radius: 0 25px 25px 0;
}

/* Forme spécifique pour la flèche droite (arrondi à gauche) */
.nav-arrow.right {
    right: 0;
    border-radius: 25px 0 0 25px;
}

/* L'icône SVG à l'intérieur de la flèche */
.nav-arrow svg {
    /* TAILLE : On garde l'icône bien visible */
    width: 36px;
    height: 36px;
    
    fill: #E53935; /* Couleur de base de l'icône (Rouge) */
    transition: all 0.3s ease-in-out;
}


/* --- EFFETS AU SURVOL (HOVER) - Version Rouge --- */

.nav-arrow:hover {
    /* Le fond devient plus rouge et la flèche s'agrandit */
    background: rgba(229, 57, 53, 0.7);
    transform: translateY(-50%) scale(1.05); /* Effet "pop" */
    box-shadow: 0 0 20px rgba(229, 57, 53, 0.6); /* Ajoute une lueur ROUGE */
}

.nav-arrow:hover svg {
    /* L'icône devient blanche pour un contraste maximal */
    fill: white;
    transform: scale(1.1);
}

.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 */
    }
}

.status-message,
.mp4-download,
.mp3-download {
    color: #42a5f5;
    text-align: center;
}
.search-input {
    flex: 1;
    padding: 10px 15px;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-input:focus {
    border-color: #42a5f5;
    box-shadow: 0 0 5px rgba(66, 165, 245, 0.5);
    outline: none;
}

.search-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #42a5f5, #64b5f6);
    border: none;
    border-radius: 5px;
    color: #fff;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

.search-btn:hover {
    background: linear-gradient(135deg, #2196f3, #42a5f5);
    transform: scale(1.05);
}

/* Card Container */
.result-cardmedia {
    display: flex; /* Horizontal layout */
    align-items: flex-start; /* Align thumbnail and content to the top */
    gap: 15px; /* Space between thumbnail and content */
    padding: 10px;
    background: #ffffff; /* White background for the card */
    border: 1px solid #ddd; /* Light gray border */
    border-radius: 8px; /* Rounded corners */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
    margin-bottom: 15px; /* Space between cards */
}

/* Thumbnail Styling */
.thumbnailmedia {
    width: 280px; /* Fixed width for the thumbnail */
    height: 280; /* Maintain aspect ratio */
    border-radius: 5px; /* Rounded corners for thumbnail */
    object-fit: cover; /* Ensure the image covers the container */
}

/* Content Container */
.result-contentmedia {
    flex: 1; /* Allow text content to take up the remaining space */
    display: flex;
    flex-direction: column; /* Stack text and buttons vertically */
    gap: 8px; /* Space between text elements */
}

/* Title Styling */
.result-titlemedia {
    font-size: 1rem;
    font-weight: bold;
    color: #333;
    margin: 0;
}

/* Source and Duration Text */
.result-sourcemedia,
.result-views,
.result-length,
.result-published,
.result-keywords,
.result-durationmedia {
    font-size: 0.9rem;
    color: #666; /* Lighter text color */
    margin: 0;
}

/* Download Links */
.download-links {
    display: flex;
    flex-wrap: wrap; /* Allow links to wrap to the next line if necessary */
    gap: 10px; /* Space between buttons */
}

.download-link {
    display: inline-block;
    padding: 6px 12px;
    background: #42a5f5; /* Blue background */
    color: white; /* White text */
    font-size: 0.9rem;
    text-decoration: none;
    border-radius: 4px; /* Rounded corners */
    transition: background 0.3s ease, transform 0.2s ease;
}

.download-link:hover {
    background: #1e88e5; /* Darker blue on hover */
    transform: scale(1.05); /* Slight zoom effect */
}

.download-link:active {
    transform: scale(0.95); /* Button appears pressed */
}


.results-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    text-align: center;
    color: #333;
}

/* Results Section with Scroll */
.results-grid {
    overflow-y: none; /* Enable vertical scroll for overflow content (auto, none) (max-height: 400px;) */
    padding: 10px;
    background-color: inherit; /* Optional: Add a background color */
	display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}


/* Result Card */
.result-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    display: flex;
    flex-direction: column;
	flex: 0 0 33%;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
	min-width: 353.1px;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.thumbnail {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 10px;
}

.result-title {
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 5px;
    color: #42a5f5;
}

.result-description {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 10px;
	color: #333;
}

.result-link {
    font-size: 0.9rem;
    color: #42a5f5;
    text-decoration: none;
    font-weight: bold;
}

.result-link:hover {
    text-decoration: underline;
}

/* Footer */
.footer {
    text-align: center;
    background: #333;
    color: #fff;
    padding: 1rem;
    font-size: 0.9rem;
}

.keyword-link {
    color: #1976d2; /* Blue link color */
    text-decoration: none;
    margin-right: 5px;
}

.keyword-link:hover {
    text-decoration: underline;
    color: #0d47a1; /* Darker blue on hover */
}

.result-channel {
    display: flex;
    align-items: center;
    margin: 8px 0;
	color: #666;
}

.channel-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.channel-thumbnail {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 8px;
}

/* Badge Styling */
.badge {
    display: inline-block;
    padding: 2px 5px; /* Compact padding */
    font-size: 0.65rem; /* Smaller font size */
    font-weight: bold;
    color: #fff; /* White text */
    border-radius: 3px;
    margin-left: 4px; /* Small spacing between badges */
    text-transform: uppercase;
}

.badge.live {
    background: #ff0000; /* Bright red for live */
}

.badge.popular {
    background: #e60000; /* Slightly darker red for popular videos */
}


/* Channel Thumbnail Styling */
.channel-thumbnail {
    width: 28px; /* Thumbnail size */
    height: 28px;
    border-radius: 50%; /* Circular shape */
    margin-right: 8px; /* Spacing between thumbnail and text */
}

/* Channel Link Container */
.result-channel {
    display: flex; /* Enables horizontal layout */
    align-items: center; /* Centers content vertically */
    justify-content: center; /* Centers content horizontally */
    gap: 8px; /* Spacing between thumbnail and text */
    font-size: 1.2rem; /* Text size */
    text-align: center; /* Ensures alignment */
    margin: 8px 0; /* Space above and below */
    line-height: 1.2; /* Fine-tune text vertical alignment */
	color: #333; /* color for the link text */
}

/* Channel Link Text */
.result-channel a {
    display: inline-flex; /* Ensures alignment within flex parent */
    align-items: center; /* Aligns text with the thumbnail */
    justify-content: center; /* Centers text within its container */
    color: #ff0000; /* Red for the link text */
    text-decoration: none; /* Removes underline */
    font-weight: bold;
}

.result-channel a:hover {
    text-decoration: underline; /* Underline on hover */
}


/* Dropdown Container */
.dropdown {
    position: relative;
    display: grid;
}

/* Dropdown Button */
.dropdown-button {
    background: linear-gradient(135deg, #42a5f5, #64b5f6);
    color: white;
    font-size: 0.9rem;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    width: 100%;
    text-align: center;
}

.dropdown-button:hover {
    background: linear-gradient(135deg, #1e88e5, #42a5f5);
    transform: scale(1.05);
}

/* Dropdown Content */
.dropdown-content {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    background-color: #ffffff;
    width: 100%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    z-index: 1;
    overflow: hidden;
}

/* Buttons inside Dropdown */
.dropdown-content button {
    padding: 10px 15px;
    background: #ffffff;
    color: #333;
    font-size: 0.9rem;
    text-align: left;
    border: none;
    cursor: pointer;
    width: 100%;
    transition: background 0.3s ease;
}

.dropdown-content button:hover {
    background: #f1f1f1;
}

/* Loader Overlay */
.loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8); /* Semi-transparent white background */
    display: flex;
    flex-direction: column;
    align-items: center; /* Horizontally center */
    justify-content: center; /* Vertically center */
    z-index: 1000; /* Ensure it appears above all other elements */
}

/* Spinner Animation */
.loader {
    width: 50px; /* Size of the spinner */
    height: 50px;
    border: 5px solid #64b5f6; /* Light gray border */
    border-top: 5px solid #fff; /* Red border for the spinner */
    border-radius: 50%;
    animation: spin 1s linear infinite;
	align-items: center; /* Horizontally center */
    justify-content: center; /* Vertically center */
}

/* Loading Text */
.loader-text {
    margin-top: 15px;
    font-size: 1rem;
    color: #333;
    font-weight: bold;
    text-align: center;
}

/* Keyframes for Spinner */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}


.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: #42a5f5;
    }
.instructions h1 {
        text-align: center;
        color: #42a5f5;
    }
	.instructions h2 {
        text-align: center;
        color: #42a5f5;
    }
.instructions ol {
        padding-left: 20px;
    }
.instructions img {
        display: block;
        margin: 10px auto;
        border-radius: 5px;
    }
	
.format-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}


.format-button {
    background: transparent;
    color: #333;
    border: 2px solid #F6643B;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
    transition: color 0.3s ease-in-out, border-color 0.3s;
}

.format-button::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: #F6643B;
    transition: left 0.3s ease-in-out;
    z-index: -1;
}

.format-button:hover {
    color: #fff;
    border-color: #f44a1a;
}

.format-button:hover::before {
    left: 0;
}

.format-button:active {
    transform: scale(0.95);
}

.selected-format {
    background: #28a745 !important;
    color: #fff !important;
    border-color: #28a745 !important;
}


/* --- Custom Progress Bar Design --- */

.popup-container .progress-wrapper {
    width: 100%;
    margin: 15px 0;
}

.popup-container .progress-label {
    display: block;
    text-align: center;
    font-size: 0.9em;
    margin-bottom: 8px;
    color: #333;
}

.popup-container .progress-bar-custom-container {
    width: 100%;
    height: 12px;
    background-color: #e9ecef;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.popup-container .progress-bar-custom {
    height: 70%;
    width: 0%; /* Starts at 0% */
    background-color: #42a5f5;
    background-image: linear-gradient(
        45deg, 
        rgba(255, 255, 255, 0.2) 25%, 
        transparent 25%, 
        transparent 50%, 
        rgba(255, 255, 255, 0.2) 50%, 
        rgba(255, 255, 255, 0.2) 75%, 
        transparent 75%, 
        transparent
    );
    background-size: 30px 30px;
    border-radius: 25px;
    transition: width 0.5s ease-in-out;
    animation: move-stripes 1s linear infinite;
}

@keyframes move-stripes {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 30px 0;
    }
}