@import url('https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300..900;1,300..900&display=swap');

* {
    box-sizing: border-box;
    word-break: break-word;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Rubik", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    margin: 0;
    padding: 0;
    background-color: #f9f9f9;
}

header {
    background-color: #333;
    color: white;
    padding: 1rem;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

header nav a {
    color: white;
    text-decoration: none;
    margin: 0 1rem;
    font-weight: bold;
    transition: color 0.3s ease-in-out;
}

header nav a:hover {
    color: #ffa4a4;
}

header nav a.active {
    color: #ff5858 !important;
}

header nav a.active:hover {
    color: #ff0000 !important;
}

.search-bar {
    margin: 2rem auto;
    max-width: 600px;
    display: flex;
    justify-content: center;
    position: relative;
    width: 90%;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    width: 20px;
    height: 20px;
}

.search-bar input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.5rem;
    font-size: 0.9rem;
    font-family: inherit;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 25px;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-bar input:focus {
    outline: none;
    border-color: #b30000;
    box-shadow: 0 4px 10px rgba(179, 0, 0, 0.1);
}

.search-bar input::placeholder {
    color: #999;
    font-style: italic;
}

.summary {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.card {
    display: flex;
    flex-direction: column;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 400px;
    padding: 1rem;
    text-align: center;
}

.card > div:first-child {
    margin-bottom: 1rem; 
}

.card p {
    font-size: 0.9rem;
    color: #666;
}

.card a {
    text-decoration: none;
    font-size: 1.2rem;
    margin: 0;
    color: #b30000;
    font-weight: bold;
    background-image: linear-gradient(#960000, #960000);
    background-position: left bottom;
    background-size: 0% 2px;
    background-repeat: no-repeat;
    transition: transform 0.2s, box-shadow 0.2s, background-size 0.3s ease-in-out, color 0.2s ease-in-out;
}

.card a:hover {
    color: #960000;
    background-size: 100% 2px;
}

a:not(header nav a):not(.card a) {
    margin: 0;
    color: #b30000;
    font-weight: bold;
    text-decoration: none;
    word-break: break-word; 
    background-image: linear-gradient(#960000, #960000);
    background-position: left bottom;
    background-size: 0% 2px;
    background-repeat: no-repeat;
    transition: background-size 0.3s ease-in-out, color 0.2s ease-in-out;
}

a:not(header nav a):not(.card a):hover {
    color: #960000;
    background-size: 100% 2px; 
}

iframe {
    width: 100%;
    aspect-ratio: 1/1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    zoom: 70%;
    border: 1px solid #ddd;
    border-top: none; 
    border-radius: 0;
}

.preview-toggle {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.75rem;
    background-color: #f1f1f1;
    border-radius: 6px 6px 0 0; 
    font-size: 0.9rem;
    font-weight: bold;
    color: #333;
    transition: background-color 0.2s ease, border-radius 0.2s ease;
    user-select: none;
    border: 1px solid #ddd;
}

.preview-toggle.collapsed {
    border-radius: 6px;
}

.preview-toggle svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.preview-toggle.collapsed svg {
    transform: rotate(-90deg);
}

.card-links {
    display: flex;
    justify-content: space-between;
    gap: 0;
}

.card-links .card-btn {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background-color: #333;
    color: white;
    font-size: 0.85rem;
    font-weight: bold;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.2s ease;
    background-image: none; 
}

.card-links .card-btn svg {
    width: 18px;
    height: 18px;
}

.card-links .card-btn:first-child {
    border-radius: 0 0 0 6px;
    border: 1px solid #ddd;
    border-top: none;
    border-right: none;
}

.card-links .card-btn.play-btn {
    background-color: #b30000;
    border-radius: 0 0 8px 0;
    border: 1px solid #ddd;
    border-top: none;
}

/* Effets au survol */
.card-links .card-btn:hover {
    background-color: #555;
    color: white;
}

.card-links .card-btn.play-btn:hover {
    background-color: #960000;
    color: white;
}

.preview-toggle.collapsed {
    border-radius: 6px 6px 0 0;
    border-bottom: none;
}

@media (max-width: 650px) {
    .card {
        width: 75%;
    }

    .search-bar {
        max-width: 90%;
    }
}