/* --- NOUVEAU STYLE : NEUMORPHIC / SOFT UI --- */
/* Importation de la police moderne 'Poppins' */
@import url('../css/css.css');

/* --- Global Styling --- */
body {
    /* Nouvelle police plus douce et moderne */
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f9; /* La couleur de base est parfaite pour le Neumorphism */
    color: #333;
    transition: background-color 0.3s;
}

/*
 * =======================================================
 * STYLES POUR LE BOUTON BLANC AVEC ICÔNE (.result-link)
 * =======================================================
 */
.result-link {
  /* Positionnement relatif pour l'icône */
  position: relative;
  
  /* Comportement et espacement */
  display: inline-block;
  /* Plus de padding à gauche pour faire de la place à l'icône */
  padding: 5px 10px 5px 30px; 
  text-align: center;
  
  /* Apparence */
  background-color: #ffffff;
  color: #333333;
  border: 1px solid #e0e0e0;
  border-radius: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);

  /* Typographie avec Google Fonts */
  font-family: 'Poppins', sans-serif;
  font-size: 10px;
  font-weight: 600;
  text-decoration: none;
  
  /* Effets de transition */
  cursor: pointer;
  transition: all 0.3s ease;
}

/* Création de l'icône "Play" avant le texte */
.result-link::before {
  content: '';
  position: absolute;
  left: 14px; /* Position de l'icône */
  top: 50%;
  transform: translateY(-50%); /* Centrage vertical parfait */
  width: 18px;
  height: 18px;
  background-repeat: no-repeat;
  background-size: contain;
  /* Icône SVG "Play" encodée directement dans le CSS (très performant) */
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23333"><path d="M8 5v14l11-7z"/></svg>');
  transition: transform 0.3s ease;
}

/* Effet au survol */
.result-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.15);
  border-color: #cccccc;
}

/* On peut même animer l'icône au survol */
.result-link:hover::before {
  transform: translateY(-50%) scale(1.1);
}

/* Effet au clic */
.result-link:active {
  transform: translateY(0);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Style pour l'accessibilité (focus) */
.result-link:focus {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}




/* --- App Container --- */
.app-container {
    max-width: 96%;
    margin: 0 auto;
    padding: 20px 10px; /* Ajout d'un peu plus d'espace */
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- Header --- */
.header {
    /* On enlève le fond pour intégrer le titre directement dans la page */
    background-color: transparent;
    color: #333; /* Texte foncé sur fond clair */
    padding: 20px;
    width: 90%;
    text-align: center;
    margin-bottom: 20px;
    border-radius: 0; /* Plus de bordure pour le conteneur */
}

.ads {
    width: 100%;
    text-align: center;
    margin-bottom: 20px; /* Espace pour la pub */
}

.title {
    font-size: 2.5rem; /* Un peu plus grand */
    font-weight: 700;
    margin: 0;
    /* Effet de texte subtil */
    color: #333;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

/* --- Search Container --- */
.search-container {
    width: 100%;
    margin: 0px auto 0px auto; /* Plus d'espace vertical */
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- Search Box --- */
.search-box {
    /* Effet Neumorphic principal : l'élément semble sortir de la page */
    background: #f4f4f9;
    padding: 0px;
    border-radius: 20px; /* Bords très arrondis */
    box-shadow: 9px 9px 18px #d0d0d5, -9px -9px 18px #ffffff;
    color: #333; /* Changé pour le texte foncé */
    width: 100%;
    transition: box-shadow 0.3s ease;
}

.search-label {
    font-size: 1.2rem;
    margin-bottom: 15px;
    font-weight: 600;
    color: #555;
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
}

/* Style "enfoncé" pour les inputs */
.search-input, .search-filter {
    flex: 1;
    padding: 12px 15px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    border: none; /* On enlève la bordure */
    border-radius: 12px;
    outline: none;
    background: #f4f4f9;
    color: #333;
    /* Ombre intérieure pour l'effet "enfoncé" */
    box-shadow: inset 5px 5px 10px #d0d0d5, inset -5px -5px 10px #ffffff;
    transition: box-shadow 0.3s ease;
}

.search-input:focus, .search-filter:focus {
    /* L'ombre s'intensifie avec la couleur d'accent */
    box-shadow: inset 7px 7px 14px #d0d0d5, inset -7px -7px 14px #ffffff, 0 0 0 2px #FFCE00;
}

.search-filter {
    flex: 0 1 auto; /* Le filtre prend moins de place */
    cursor: pointer;
}

/* Bouton pressable */
.search-button {
    background: #FFCE00;
    color: #222; /* Texte noir pour un meilleur contraste sur le jaune */
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    /* Ombre extérieure pour l'effet de relief */
    box-shadow: 5px 5px 10px #d0d0d5, -5px -5px 10px #ffffff;
    transition: all 0.2s ease-in-out;
}

.search-button:hover {
    background: #FFBC00; /* Un peu plus foncé au survol */
    box-shadow: 7px 7px 14px #d0d0d5, -7px -7px 14px #ffffff; /* Ombre plus prononcée */
}

.search-button:active {
    /* Effet "pressé" : l'ombre devient intérieure */
    background: #FFBC00;
    box-shadow: inset 5px 5px 10px #dcb000, inset -5px -5px 10px #ffe238;
    transform: translateY(2px); /* Léger enfoncement */
}

/* --- Loader --- */
.loader {
    margin-top: 20px;
    display: none;
    width: 30px;
    height: 30px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top-color: #FFCE00;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Conteneur principal */
.search-results-container {
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
    overflow: hidden;
	justify-content: center;
}

.search-results {
    display: flex;
    gap: 10px;
    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 #FFBC00;
    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: #FFBC00;
    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: #FFBC00;
}

.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 */
    }
}


/* --- Result Card --- */
.result-card {
    background: #f4f4f9;
	margin-bottom: 0;
	min-width: 400px;
    border-radius: 15px; /* Bords arrondis */
    padding: 0px;
    /* Ombre Neumorphic pour chaque carte */
    box-shadow: 7px 7px 14px #d0d0d5, -7px -7px 14px #ffffff;
    font-size: 0.8rem;
    line-height: 1.4;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.result-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 12px 12px 24px #d0d0d5, -12px -12px 24px #ffffff;
}

.thumbnail {
    width: 100%;
    height: 180px; /* Hauteur ajustée pour un ratio plus courant */
    border-radius: 10px; /* Bords arrondis pour l'image */
    object-fit: cover;
    margin-bottom: 12px;
}

.result-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 5px 0;
    line-height: 1.3;
    color: #333;
}

.result-source, .result-duration, .result-views, .result-length, .result-published {
    font-size: 0.75rem;
    color: #666;
    margin: 2px 0;
    line-height: 1.2;
}

.result-channel {
    font-size: 0.8rem;
    font-weight: 600;
    color: #444;
    margin: 4px 0;
    line-height: 1.3;
}

/* --- Badges --- */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 600;
    color: #fff;
    margin: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}
.badge.live { background-color: #e74c3c; }
.badge.popular { background-color: #f1c40f; }
.badge.new { background-color: #2ecc71; }

/* --- Nav Circle (si utilisé) --- */
.nav-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #FFCE00;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #222;
    font-size: 1.8rem;
    box-shadow: 5px 5px 10px #d0d0d5, -5px -5px 10px #ffffff;
    transition: all 0.2s ease-in-out;
}

.nav-circle:hover {
    background-color: #FFBC00;
    transform: scale(1.1);
    box-shadow: 7px 7px 14px #d0d0d5, -7px -7px 14px #ffffff;
}

/* --- Footer --- */
.footer {
    margin-top: 40px;
    text-align: center;
    font-size: 0.9rem;
    color: #999;
}

/* --- Loader Overlay & Spinner --- */
.loader-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(244, 244, 249, 0.85); /* Fond semi-transparent assorti */
    backdrop-filter: blur(5px); /* Effet verre dépoli */
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 15px; /* Doit correspondre à la carte parente */
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0, 0, 0, 0.1);
    border-top-color: #FFCE00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* --- Download Links --- */
.download-card {
    background: #f4f4f9;
    border: none;
    border-radius: 15px;
    padding: 20px;
    width: 180px;
    text-align: center;
    box-shadow: 7px 7px 14px #d0d0d5, -7px -7px 14px #ffffff;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.download-card:hover {
    transform: translateY(-5px);
    box-shadow: 10px 10px 20px #d0d0d5, -10px -10px 20px #ffffff;
}

.media-quality {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.media-format {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 15px;
}

.download-link {
display: flex;
}

.download-link-button {
    display: inline-block;
    width: 100%;
    padding: 6px 5px;
    background-color: #d0d0d5;
    color: #000;
    text-decoration: none;
    border: 1px solid #bbb;
    border-radius: 2px; /* très léger arrondi */
    font-family: "Segoe UI", sans-serif;
    text-align: center;
    box-shadow: 2px 2px 4px #b0b0b5, -2px -2px 4px #f0f0f5;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.download-link-button:hover {
    transform: translateY(-2px);
    box-shadow: 3px 3px 6px #b0b0b5, -3px -3px 6px #f0f0f5;
}

.download-link-button:active {
    box-shadow: inset 2px 2px 4px #6f5106, inset -2px -2px 4px #a7790a;
    transform: scale(0.98);
}

/* --- Responsive Design --- */
@media (max-width: 600px) {
    .input-wrapper {
        flex-direction: column;
    }
    .search-input, .search-filter, .search-button {
        width: 100%;
    }
    .results {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: 15px;
    }
    .download-card {
        width: 100%;
    }
    .title {
        font-size: 2rem;
    }
}

/* --- Modal --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    /* Effet de verre dépoli pour le fond */
    background-color: rgba(244, 244, 249, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-content {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: #f4f4f9; /* Fond assorti */
    color: #333;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    width: 100%;
    max-width: 600px;
    /* Ombre Neumorphic pour le modal */
    box-shadow: 15px 15px 30px #d0d0d5, -15px -15px 30px #ffffff;
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    color: #888;
    cursor: pointer;
    transition: color 0.3s ease;
}
.close:hover {
    color: #333;
}

.instructions {
    text-align: left;
    margin-top: 15px;
    padding: 15px;
    /* Effet "enfoncé" pour le conteneur d'instructions */
    background: #f4f4f9;
    border-radius: 15px;
    box-shadow: inset 5px 5px 10px #d0d0d5, inset -5px -5px 10px #ffffff;
}
.instructions h1, .instructions h2, .instructions h3 {
    text-align: center;
    color: #FFBC00; /* Utilisation de la couleur accent */
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}
.instructions ol {
    padding-left: 25px;
    line-height: 1.6;
}
.instructions img {
    display: block;
    margin: 15px auto;
    border-radius: 10px;
    max-width: 100%;
    box-shadow: 5px 5px 10px #d0d0d5;
}
	
/* Bouton de téléchargement final */
.download-button {
    background: #FFCE00;
    color: #222;
    font-size: 1rem;
    font-weight: 600;
    padding: 4px 6px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 5px 5px 10px #d0d0d5, -5px -5px 10px #ffffff;
    transition: all 0.2s ease-in-out;
    margin-top: 10px; /* Espace ajouté */
}

.download-button:hover {
    background: #FFBC00;
    transform: translateY(-2px);
    box-shadow: 7px 7px 14px #d0d0d5, -7px -7px 14px #ffffff;
}

.download-button:active {
    transform: scale(0.98);
    box-shadow: inset 5px 5px 10px #dcb000, inset -5px -5px 10px #ffe238;
}




/* 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;
}