/* General Styles */
body {
    background: #eee;
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0;
    letter-spacing: 1px;
    color: #333;
}

.container-result {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-behavior: smooth;
	max-height: 500px;
	position: relative; /* Ajouté pour positionner les flèches */
}

.adsmp {
    width: 100%;
    text-align: center;
}

.bottom-container {
    background: #39404A;
    color: white;
    padding: 4px;
    text-align: center;
}

.app-container {
    background: #39404A;
    color: white;
    padding: 0px;
    text-align: center;
}

.app-title {
    font-family: 'Arvo', sans-serif;
    color: #E35865;
    margin: 0 0 10px;
    font-size: 2.5rem;
}

.search-container {
    display: flex;
    flex-direction: column;
    gap: 0px;
    padding: 10px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin: 0 auto;
}

.search-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0px;
    justify-content: left;
}

.search-input {
    border: 2px solid #E35865;
    border-radius: 5px;
    padding: 10px;
    font-size: 1rem;
    flex: 1;
    outline: none;
    width: calc(100% - 22px);
}

.search-button {
    background: #E35865;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 10px 15px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

.search-button:hover {
    background: #d04457;
    transform: scale(1.05);
}

/* Dropdown Filters */
.sort_by, .upload_date, .duration_by, .lang_by {
    border: 2px solid #E35865;
    border-radius: 5px;
    padding: 4px;
    outline: none;
    background: white;
    color: #39404A;
    width: 100px;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.sort_by:hover, .upload_date:hover, .duration_by:hover, .lang_by:hover {
    border-color: #d04457;
    box-shadow: 0 0 5px rgba(227, 88, 101, 0.5);
}

/* Results Container */
.results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
    margin: 20px auto;
    max-width: 1200px;
}

.thumbnail {
    width: 100%;
    border-radius: 5px;
    margin-bottom: 10px;
}

.thumbnail2 {
    width: 100%;
	height: 350px;
	max-width: 600px;
	max-height: 350px;
    border-radius: 5px;
    margin-bottom: 10px;
}

.result-title {
    font-size: 0.8rem;
    font-weight: bold;
    color: #39404A;
    margin-bottom: 8px;
}

.result-channel,
.result-views,
.result-date,
.result-duration {
    font-size: 0.9rem;
    color: #666;
}

/* Result Card */
.result-card {
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-width: 1100px;
    position: relative; /* Ajouté pour positionner le loader-overlay */
    overflow: hidden; /* Empêche le débordement du loader */
	min-height: 380px;
	max-height: 380px;
}

/* Loader */
.loader {
    position: absolute;
    background: rgba(255, 255, 255, 0.8);
	width: 150px;
    height: 150px;
	top: 30%;
    left: 43%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 10px; /* Correspond au border-radius de la carte */
    display: none;
	z-index: 9999;
}

/* 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: 10px; /* Correspond au border-radius de la carte */
    z-index: 1000;
    opacity: 0; /* Masqué par défaut */
    visibility: hidden; /* Masqué par défaut */
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loader-overlay.active {
    opacity: 1; /* Visible */
    visibility: visible; /* Visible */
}

.spinner {
    border: 4px solid #39404A;
    border-top: 4px solid #E35865;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.button-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.button-singlecontainer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px;
}

.download-button {
    background-color: #28a745; /* Green for download */
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.download-button:hover {
    background-color: #218838; /* Darker green on hover */
}

.preview-button {
    background-color: #17a2b8; /* Blue-teal for preview */
    color: white;
    text-decoration: none; /* Removes underline from link */
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.preview-button:hover {
    background-color: #117a8b; /* Darker blue-teal on hover */
}


/* Popup Container */
.popup-container {
	font-family: 'Montserrat', sans-serif;
    position: absolute; /* Position relative to the card */
    top: 50%; /* Center within the card */
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 10; /* Stays on top of other elements in the card */
    width: 90%;
    max-width: 300px;
    display: none; /* Hidden by default */
    flex-direction: column;
    gap: 15px;
    text-align: center;
	overflow-y: auto;
	max-height: 90%;
}


/* Show Popup */
.popup-container.show {
    display: flex;
    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;
}

.search-results {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-behavior: smooth;
}

.result-item {
    max-width: 375px; /* Width of each result item */
    display: flex;
    text-align: center;
    flex-shrink: 0;
	min-height: 360px;
}

.nav-arrow {
    background-color: #E35865;
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.nav-arrow.left {
    left: 10px;
}

.nav-arrow.right {
    right: 10px;
}

.nav-arrow:hover {
    background-color: #d04457;
}

.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 */
    }
}

.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: #E35865;
    }
.instructions h1 {
        text-align: center;
        color: #E35865;
    }
	.instructions h2 {
        text-align: center;
        color: #E35865;
    }
.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;
}

.download-link {
    display: inline-block;
    background: linear-gradient(45deg, #ff416c, #ff4b2b);
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    font-weight: bold;
    padding: 12px 20px;
    border: 5px;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 4px 10px rgba(255, 75, 43, 0.3);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.download-link:hover {
    background: linear-gradient(45deg, #ff4b2b, #ff416c);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 75, 43, 0.5);
}

.download-link:active {
    transform: translateY(2px);
    box-shadow: 0 2px 5px rgba(255, 75, 43, 0.3);
}

.download-link::after {
    content: '⬇';
    position: absolute;
    right: 15px;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.download-link:hover::after {
    opacity: 1;
}


.format-button {
    background: #F6643B;
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 4px #c55230;
    transition: all 0.2s ease-in-out;
}

.format-button:hover {
    background: #f44a1a;
    box-shadow: 0 2px #c55230;
    transform: translateY(2px);
}

.format-button:active {
    background: #c55230;
    box-shadow: none;
    transform: translateY(4px);
}

.selected-format {
    background: #28a745 !important;
    box-shadow: 0 4px #1e7e34 !important;
}

.popup-container .progress-bar-container {
    width: 100%;
    background-color: #eee;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
    height: 10px;
}

.popup-container .progress-bar {
    height: 100%;
    width: 0%;
    background-color: #28a745;
    transition: width 0.4s ease;
}
