* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

:root {
    --primary-color: #6d28d9;
    --primary-gradient: linear-gradient(135deg, #7c3aed, #4f46e5);
    --secondary-gradient: linear-gradient(135deg, #f472b6, #ec4899);
    --background-dark: #030712;
    --background-gradient: linear-gradient(165deg, #030712, #111827);
    --glass-background: rgba(255, 255, 255, 0.07);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --danger-color: #ef4444;
    --success-color: #10b981;
    --accent-1: #f472b6;
    --accent-2: #8b5cf6;
    --accent-3: #4f46e5;
    --shadow-color: rgba(139, 92, 246, 0.15);
    --shadow-strong: rgba(0, 0, 0, 0.3);
    --text-color: #1f2937;
    --background-color: #f9fafb;
}

body {
    background: var(--background-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    margin: 0;
    padding-top: 70px; /* Hauteur du header */
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(124, 58, 237, 0.12), transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(244, 114, 182, 0.12), transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.08), transparent 60%);
    z-index: -1;
    animation: gradientMove 30s ease-in-out infinite alternate;
    filter: blur(60px);
}

@keyframes gradientMove {
    0% { 
        transform: translate(0, 0) rotate(0deg) scale(1); 
        filter: hue-rotate(0deg);
    }
    50% { 
        transform: translate(-2%, 2%) rotate(180deg) scale(1.05);
        filter: hue-rotate(180deg);
    }
    100% { 
        transform: translate(2%, -2%) rotate(360deg) scale(1);
        filter: hue-rotate(360deg);
    }
}

/* Ajout d'un effet de scintillement moderne */
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.shimmer {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.08),
        transparent
    );
    background-size: 1000px 100%;
    animation: shimmer 2s linear infinite;
}

/* Nouvelles animations et effets modernes */
@keyframes fadeScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Style de base moderne pour les éléments interactifs */
button, 
input, 
select {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

button::before,
input::before,
select::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        transparent,
        rgba(255, 255, 255, 0.05),
        transparent
    );
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

button:hover::before,
input:focus::before,
select:focus::before {
    transform: translateX(100%);
}

header {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 2rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px; /* Hauteur fixe */
}

header h1 {
    font-size: 2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: var(--primary-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
    text-shadow: 0 0 30px rgba(139, 92, 246, 0.3);
}

nav {
    display: flex;
    gap: 1rem;
    padding: 0.5rem;
    background: var(--glass-background);
    border-radius: 99px;
    border: 1px solid var(--glass-border);
}

.nav-btn {
    background: transparent;
    color: var(--text-secondary);
    padding: 0.8rem 1.5rem;
    border-radius: 99px;
    font-size: 1rem;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.nav-btn:hover {
    color: var(--text-primary);
    background: var(--glass-background);
}

.nav-btn.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

main {
    margin: 2rem auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
    width: 100%;
}

.search-container {
    width: 100%;
    margin: 0 auto;
}

.search-box {
    max-width: 800px;
    margin: 0 auto 2rem auto;
    display: flex;
    gap: 1rem;
    background: var(--glass-background);
    padding: 0.5rem;
    border-radius: 99px;
    border: 1px solid var(--glass-border);
    transition: border-color 0.3s ease;
    position: relative;
    max-width: 600px;
    width: 100%;
    margin: 1rem auto;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 3rem 0.75rem 1rem;
    border: 2px solid var(--primary-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    background: transparent !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    box-shadow: none !important;
    outline: none !important;
    border: none;
    color: var(--text-primary);
}

.search-box input:focus {
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

.search-box input:-webkit-autofill,
.search-box input:-webkit-autofill:hover,
.search-box input:-webkit-autofill:focus,
.search-box input:-webkit-autofill:active {
    -webkit-text-fill-color: var(--text-primary) !important;
    -webkit-box-shadow: 0 0 0 30px transparent inset !important;
    box-shadow: 0 0 0 30px transparent inset !important;
    transition: background-color 5000s ease-in-out 0s;
    background: transparent !important;
    caret-color: var(--text-primary);
}

.search-box:focus-within {
    border-color: var(--glass-border);
}

.search-box button {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0.5rem;
}

.search-results {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    width: 100%;
}

.search-result {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 1.5rem;
    text-align: left;
    background: var(--glass-background);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    position: relative;
    animation: fadeScale 0.3s ease-out;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transform-origin: center;
}

.search-result:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 20px 30px rgba(0, 0, 0, 0.2),
        0 0 0 1px var(--primary-color),
        0 0 20px rgba(139, 92, 246, 0.3);
}

.search-result img {
    width: 150px;
    height: 225px;
    object-fit: cover;
    border-radius: 8px;
    margin: 0;
}

.search-result-info {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    flex: 1;
}

.search-result-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.search-result-year {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.search-result-overview {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.search-result button {
    background: var(--primary-gradient);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.search-result button:hover {
    transform: scale(1.15);
    box-shadow: 
        0 0 15px rgba(139, 92, 246, 0.4),
        0 0 0 2px rgba(139, 92, 246, 0.2);
}

.lists {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.list-container {
    background: var(--glass-background);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.media-item {
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

.media-item:hover {
    transform: translateX(5px);
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.media-content {
    display: flex;
    gap: 1rem;
    flex: 1;
}

.media-poster {
    width: 80px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.media-info {
    flex: 1;
}

.media-overview {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-top: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.media-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: 1rem;
}

.media-item button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: translateZ(0);
    backface-visibility: hidden;
}

.media-item button:hover {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    transform: scale(1.15);
    box-shadow: 
        0 0 15px rgba(139, 92, 246, 0.4),
        0 0 0 2px rgba(139, 92, 246, 0.2);
}

.media-item button.status-btn:hover {
    background: var(--success-color);
}

.media-item button.delete-btn:hover {
    background: var(--danger-color);
}

.badge {
    padding: 0.3rem 0.8rem;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 2px 4px rgba(0, 0, 0, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transform: translateZ(0);
    backface-visibility: hidden;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.badge:hover {
    transform: translateY(-1px) scale(1.05);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 4px 8px rgba(0, 0, 0, 0.3);
}

.badge.film {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.badge.serie {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

h2 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    position: relative;
    padding-bottom: 0.5rem;
    display: inline-block;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: 3px;
}

/* Notification */
.notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--primary-gradient);
    color: white;
    padding: 1rem 2rem;
    border-radius: 99px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification i {
    font-size: 1.2rem;
}

/* Styles pour la pagination */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding: 1rem;
    color: var(--text-primary); /* Utilisation de la couleur de texte claire */
}

.pagination-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
}

.pagination-btn:disabled {
    background: var(--glass-background);
    cursor: not-allowed;
    opacity: 0.5;
}

.pagination-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.3);
}

.page-indicator {
    font-size: 1rem;
    color: var(--text-primary); /* Utilisation de la couleur de texte claire */
    background: var(--glass-background);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--glass-border);
}

/* Amélioration du style des résultats de recherche */
.no-results {
    text-align: center;
    padding: 2rem;
    color: var(--text-color);
    font-size: 1.1rem;
    grid-column: 1 / -1;
}

.no-results i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    display: block;
}

/* Media Queries */
@media (max-width: 600px) {
    header h1 {
        font-size: 1.8rem;
    }

    .search-box {
        flex-direction: column;
        border-radius: 16px;
        padding: 1rem;
    }

    .search-box button {
        width: 100%;
        border-radius: 99px;
    }

    .search-result {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }

    .search-result img {
        width: 120px;
        height: 180px;
        margin: 0 0 1rem 0;
    }

    .search-result button {
        width: 100%;
        height: 40px;
        border-radius: 99px;
        margin-top: 1rem;
    }

    .search-result button i {
        margin-right: 0.5rem;
    }

    .notification {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        justify-content: center;
    }

    nav {
        flex-direction: column;
        width: 100%;
        border-radius: 16px;
    }

    .nav-btn {
        width: 100%;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 120px; /* Hauteur du header sur mobile */
    }

    header {
        height: auto;
    }

    main {
        padding: 0 1rem;
    }

    nav {
        width: 100%;
        flex-direction: row;
        border-radius: 99px;
    }

    .nav-btn {
        flex: 1;
    }

    .search-results, .library-content {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }

    .search-result img {
        width: 180px;
        height: 270px;
    }

    .library-header {
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    main {
        padding: 0 0.5rem;
    }

    .search-results, .library-content {
        grid-template-columns: 1fr;
    }

    .library-header {
        padding: 1rem 0.5rem;
    }
}

.tab-content {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease-in-out;
}

.tab-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Assurez-vous que le contenu inactif est vraiment caché */
.tab-content:not(.active) {
    position: absolute;
    visibility: hidden;
    pointer-events: none;
}

/* Library Styles */
.library-container {
    width: 100%;
    margin: 0;
    border-radius: 0;
}

.library-header {
    padding: 2rem;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--glass-border);
}

.library-header .search-box {
    max-width: 800px;
    margin: 0 auto 1.5rem auto;
}

.filters {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.filter-select {
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-primary);
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex: 1;
    min-width: 150px;
    max-width: 200px;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    padding-right: 2.5rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 2px 8px rgba(0, 0, 0, 0.1);
}

.filter-select option {
    background-color: var(--background-dark);
    color: var(--text-primary);
    padding: 0.5rem;
}

.filter-select:hover, .filter-select:focus {
    border-color: var(--primary-color);
    outline: none;
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 4px 12px rgba(0, 0, 0, 0.2);
}

.manage-btn {
    background: var(--primary-gradient);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    border: none;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.manage-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.3);
}

.library-content {
    padding: 2rem;
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
    min-height: 500px; /* Hauteur minimale pour éviter les sauts de page */
}

/* Media Item in Library */
.media-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    position: relative;
    animation: fadeScale 0.3s ease-out;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transform-origin: center;
}

.media-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--primary-color);
    box-shadow: 
        0 20px 30px rgba(0, 0, 0, 0.2),
        0 0 0 1px var(--primary-color),
        0 0 20px rgba(139, 92, 246, 0.3);
}

.media-card-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    object-position: center top;
    transition: transform 0.3s ease;
}

.media-card:hover .media-card-image {
    transform: scale(1.05);
}

.media-card-content {
    padding: 1.5rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.5));
    flex: 1;
}

.media-card-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.media-card-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.year {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.status-badge {
    background: var(--primary-gradient);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 99px;
    font-size: 0.8rem;
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 2px 4px rgba(0, 0, 0, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transform: translateZ(0);
    backface-visibility: hidden;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.status-badge:hover {
    transform: translateY(-1px) scale(1.05);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 4px 8px rgba(0, 0, 0, 0.3);
}

.status-badge.vu {
    background: var(--success-color);
}

.status-badge.a-voir {
    background: var(--primary-color);
}

.media-overview {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-top: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.media-card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.media-card-actions button {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: translateZ(0);
    backface-visibility: hidden;
}

.media-card-actions button:hover {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    transform: scale(1.15);
    box-shadow: 
        0 0 15px rgba(139, 92, 246, 0.4),
        0 0 0 2px rgba(139, 92, 246, 0.2);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .library-header {
        padding: 1rem;
    }

    .filters {
        flex-direction: column;
    }

    .filter-select {
        max-width: none;
    }

    .library-content {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
}

.streaming-providers {
    margin-top: 0.5rem;
}

.streaming-providers h4 {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    display: inline-block;
}

.provider-logos {
    display: inline-flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    margin-left: 0.5rem;
}

.provider-logo {
    width: 25px;
    height: 25px;
    border-radius: 4px;
}

/* Styles pour la carte détaillée */
.detail-card-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 2rem;
}

.detail-card-overlay.show {
    opacity: 1;
}

.detail-card {
    background: var(--background-dark);
    border-radius: 20px;
    width: 100%;
    max-width: 1000px;
    max-height: 90vh;
    position: relative;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
    transform: translateY(20px);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.3s ease;
    transform-origin: center;
}

.detail-card-overlay.show .detail-card {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.close-detail-card {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
}

.close-detail-card:hover {
    background: var(--danger-color);
    transform: scale(1.1);
}

.detail-card-content {
    display: flex;
    gap: 2rem;
    padding: 2rem;
    max-height: 90vh;
    overflow-y: auto;
}

.detail-card-left {
    flex: 0 0 300px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.detail-poster {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.detail-card-right {
    flex: 1;
    min-width: 0;
}

.detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.detail-header h2 {
    font-size: 2rem;
    margin: 0;
}

.detail-badge {
    padding: 0.5rem 1rem;
    border-radius: 99px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
}

.detail-badge.movie, .detail-badge.film {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.detail-badge.tv, .detail-badge.serie {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.detail-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.detail-year {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.detail-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fbbf24;
}

.detail-overview {
    margin-bottom: 2rem;
}

.detail-overview h3 {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.detail-overview p {
    line-height: 1.6;
    color: var(--text-primary);
}

.detail-streaming-providers {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
}

.detail-streaming-providers h3 {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.detail-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.status-toggle-btn, .delete-media-btn, .add-to-library-btn {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.status-toggle-btn {
    background: var(--primary-gradient);
    color: white;
}

.delete-media-btn {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.add-to-library-btn {
    background: var(--primary-gradient);
    color: white;
}

.status-toggle-btn:hover, .add-to-library-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(139, 92, 246, 0.3);
}

.delete-media-btn:hover {
    background: var(--danger-color);
    color: white;
    transform: translateY(-2px);
}

/* Media Queries pour la carte détaillée */
@media (max-width: 768px) {
    .detail-card-content {
        flex-direction: column;
        padding: 1rem;
    }

    .detail-card-left {
        flex: 0 0 auto;
    }

    .detail-poster {
        max-width: 200px;
        margin: 0 auto;
    }

    .detail-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .detail-header h2 {
        font-size: 1.5rem;
    }
}

/* Rendre les cartes cliquables */
.search-result, .media-card {
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.search-result:hover, .media-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Empêcher le hover sur les boutons à l'intérieur des cartes */
.search-result button, .media-card button {
    pointer-events: auto;
}

.detail-streaming-providers .no-providers {
    color: var(--text-secondary);
    font-style: italic;
    padding: 0.5rem 0;
}

/* Styles pour l'authentification */
.user-section {
    display: flex;
    gap: 1rem;
}

.auth-btn {
    background: transparent;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border: 1px solid var(--glass-border);
    border-radius: 99px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.auth-btn:hover {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: linear-gradient(
        165deg,
        rgba(3, 7, 18, 0.95),
        rgba(17, 24, 39, 0.95)
    );
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    position: relative;
    border: 1px solid var(--glass-border);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1);
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.auth-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.auth-tab {
    flex: 1;
    padding: 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.auth-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--primary-color);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-form h2 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.auth-form form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-form input {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.auth-form button {
    padding: 1rem;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.auth-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.3);
}

/* Media Queries pour l'authentification */
@media (max-width: 768px) {
    .user-section {
        margin-top: 1rem;
        justify-content: center;
    }

    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }
}

/* Media Queries pour la responsivité */
@media (max-width: 1200px) {
    main {
        padding: 0 2rem;
    }
    
    .library-content {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 992px) {
    header {
        flex-direction: column;
        height: auto;
        padding: 1rem;
        gap: 1rem;
    }

    .user-section {
        width: 100%;
        justify-content: center;
    }

    nav {
        width: 100%;
    }

    main {
        margin-top: 140px;
    }

    .detail-card-content {
        flex-direction: column;
    }

    .detail-card-left {
        display: flex;
        flex-direction: row;
        gap: 2rem;
        align-items: flex-start;
    }

    .detail-poster {
        width: 200px;
        height: auto;
    }

    .detail-actions {
        flex: 1;
    }
}

@media (max-width: 768px) {
    .search-result {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1.5rem;
    }

    .search-result img {
        width: 200px;
        height: 300px;
        margin-bottom: 1rem;
    }

    .search-result-info {
        width: 100%;
    }

    .search-result button {
        width: 100%;
        border-radius: 8px;
        height: 45px;
        margin-top: 1rem;
    }

    .filters {
        flex-direction: column;
    }

    .filter-select, .manage-btn {
        width: 100%;
        max-width: none;
    }

    .detail-card-left {
        flex-direction: column;
        align-items: center;
    }

    .detail-poster {
        width: 80%;
        max-width: 300px;
    }

    .detail-actions {
        width: 100%;
    }

    .detail-card-content {
        padding: 1rem;
    }

    .detail-header h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    main {
        padding: 0 1rem;
        margin-top: 160px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .nav-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    .search-box input {
        padding: 0.8rem 1rem;
        font-size: 1rem;
    }

    .search-box button {
        width: 40px;
        height: 40px;
    }

    .media-card-image {
        height: 300px;
    }

    .media-card-title {
        font-size: 1.1rem;
    }

    .detail-card {
        width: 95%;
        margin: 1rem;
    }

    .streaming-providers {
        overflow-x: auto;
        padding-bottom: 1rem;
    }

    .provider-logos {
        display: flex;
        gap: 1rem;
        padding: 0.5rem;
    }

    .auth-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }

    .modal-content {
        width: 90%;
        padding: 1rem;
    }

    .auth-form input, .auth-form button {
        padding: 0.8rem;
    }
}

/* Supprimer le bouton + */
.search-result .add-to-library-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--primary-gradient);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
}

.search-result .add-to-library-button:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

.search-result .add-to-library-button.added {
    background: var(--success-color);
    cursor: default;
}

/* Styles pour la bibliothèque */
.media-card .streaming-providers {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.8);
    padding: 0.4rem;
    border-radius: 6px;
    backdrop-filter: blur(4px);
    z-index: 2;
    display: flex;
    gap: 0.3rem;
}

.media-card .provider-logos {
    display: flex;
    gap: 0.3rem;
    margin: 0;
}

.media-card .provider-logo {
    width: 20px;
    height: 20px;
    border-radius: 3px;
}

/* Media Queries */
@media (max-width: 768px) {
    .search-results {
        grid-template-columns: 1fr;
    }

    .search-result {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .search-result img {
        width: 180px;
        height: 270px;
    }

    .search-result-info {
        align-items: center;
    }

    .provider-logos {
        justify-content: center;
    }
}

/* Style des providers dans les résultats de recherche */
.search-result .streaming-providers {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.search-result .streaming-providers h4 {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin: 0;
}

.search-result .provider-logos {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.3rem;
    border-radius: 6px;
}

.search-result .provider-logo {
    width: 18px;
    height: 18px;
    border-radius: 3px;
}

/* Style des providers dans la carte détaillée */
.detail-streaming-providers {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
}

.detail-streaming-providers h3 {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 0.8rem;
}

.detail-streaming-providers .provider-logos {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.detail-streaming-providers .provider-logo {
    width: 35px;
    height: 35px;
    border-radius: 6px;
    transition: transform 0.2s ease;
}

.detail-streaming-providers .provider-logo:hover {
    transform: scale(1.1);
}

/* Media Queries */
@media (max-width: 768px) {
    .search-result .streaming-providers {
        justify-content: center;
    }

    .media-card .streaming-providers {
        top: 0.5rem;
        right: 0.5rem;
    }
}

/* Styles pour la gestion des catégories */
#categoryModal.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
}

#categoryModal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

#categoryModal .modal-content {
    background: var(--background-dark);
    border-radius: 16px;
    padding: 2rem;
    width: 90%;
    max-width: 600px;
    border: 1px solid var(--glass-border);
    position: relative;
}

.close-category {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.close-category:hover {
    color: var(--danger-color);
}

.category-list {
    margin: 1.5rem 0;
    max-height: 300px;
    overflow-y: auto;
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem;
    background: var(--glass-background);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.category-item:hover {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.1);
}

.category-name {
    flex: 1;
    margin-right: 1rem;
}

.category-actions {
    display: flex;
    gap: 0.5rem;
}

.category-actions button {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-actions .edit-btn:hover {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
}

.category-actions .delete-btn:hover {
    background: var(--danger-color);
    color: white;
    border-color: transparent;
}

.add-category-form {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
}

.add-category-form input {
    flex: 1;
    background: var(--glass-background);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0.8rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
}

.add-category-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.add-category-form button {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.add-category-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.3);
}

/* Style des tags dans les cartes médias */
.media-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.8rem;
}

.media-tag {
    background: var(--primary-gradient);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 99px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.media-tag .remove-tag {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 0.8rem;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.media-tag .remove-tag:hover {
    opacity: 1;
}

/* Media Queries */
@media (max-width: 768px) {
    #categoryModal .modal-content {
        width: 95%;
        padding: 1.5rem;
    }

    .add-category-form {
        flex-direction: column;
    }

    .add-category-form button {
        width: 100%;
    }
}

/* Style des tags dans les cartes médias */
.media-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.8rem;
}

.add-tag-btn {
    background: var(--glass-background);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    font-size: 0.8rem;
}

.add-tag-btn:hover {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
}

/* Style du sélecteur de catégories */
.category-select-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.category-select-content {
    background: var(--background-dark);
    border-radius: 16px;
    padding: 1.5rem;
    width: 90%;
    max-width: 400px;
    border: 1px solid var(--glass-border);
}

.category-select-content h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.2rem;
}

.category-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.category-options button {
    background: var(--glass-background);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.category-options button:hover {
    background: var(--primary-gradient);
    border-color: transparent;
}

/* Styles pour le système de notation */
.rating-section {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
}

.rating-container {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.rating-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    min-width: 120px;
}

.stars-container {
    display: flex;
    gap: 0.3rem;
}

.star {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    position: relative;
    user-select: none;
    opacity: 0.3;
}

.star.full {
    color: #fbbf24;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
    opacity: 1;
}

.star.half {
    position: relative;
    background: linear-gradient(90deg, #fbbf24 50%, transparent 50%);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
    opacity: 1;
}

.star.empty {
    color: var(--text-secondary);
    opacity: 0.3;
}

.star:hover {
    transform: scale(1.1);
    opacity: 1;
}

.average-rating {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
    color: var(--text-primary);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.average-rating::before {
    content: '★';
    color: #fbbf24;
    font-size: 1.3rem;
}

/* Media Queries pour le système de notation */
@media (max-width: 768px) {
    .rating-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .rating-label {
        min-width: auto;
    }

    .star {
        font-size: 1.3rem;
    }
}

.already-in-library-btn {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1rem;
    background: var(--glass-background);
    color: var(--text-secondary);
    cursor: not-allowed;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.already-in-library-btn i {
    color: var(--success-color);
}

/* Style des réalisateurs dans la carte détaillée */
.detail-directors {
    margin-bottom: 2rem;
}

.detail-directors h3 {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.directors-list {
    color: var(--text-primary);
    font-size: 1.1rem;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .detail-directors {
        margin-bottom: 1.5rem;
    }
    
    .directors-list {
        font-size: 1rem;
    }
}

/* Styles pour les statistiques de la bibliothèque */
.library-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--glass-background);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    transition: all 0.3s ease;
    background: linear-gradient(
        165deg,
        rgba(255, 255, 255, 0.05),
        transparent
    );
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    animation: float 6s ease-in-out infinite;
    transform-origin: center;
}

.stat-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.stat-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
    background: var(--primary-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.stat-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        transparent,
        rgba(255, 255, 255, 0.05),
        transparent
    );
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.stat-item:hover::before {
    transform: translateX(100%);
}

.stat-item:nth-child(1) { animation-delay: 0s; }
.stat-item:nth-child(2) { animation-delay: 1.5s; }
.stat-item:nth-child(3) { animation-delay: 3s; }
.stat-item:nth-child(4) { animation-delay: 4.5s; }

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0px); }
}

@media (max-width: 1024px) {
    .library-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .library-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-item {
        padding: 0.8rem;
    }

    .stat-value {
        font-size: 1.3rem;
    }
}

.random-media-btn {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    position: relative;
    overflow: hidden;
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 1rem auto;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2);
    background-size: 200% 200%;
    animation: gradientShift 5s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.random-media-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 
        0 10px 25px rgba(139, 92, 246, 0.4),
        0 0 0 2px rgba(139, 92, 246, 0.2);
}

.random-media-btn i {
    font-size: 1.2rem;
}

.random-media-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.2) 0%,
        transparent 50%
    );
    transform: scale(0);
    opacity: 0;
    transition: transform 0.6s ease-out, opacity 0.4s ease;
}

.random-media-btn:hover::after {
    transform: scale(1);
    opacity: 1;
}

@media (max-width: 768px) {
    .random-media-btn {
        width: 100%;
        justify-content: center;
        padding: 0.8rem;
    }
}

/* Animation du chargement */
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.95); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

.media-card::before,
.search-result::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    z-index: -1;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.media-card:hover::before,
.search-result:hover::before {
    opacity: 1;
}

.auth-btn::after,
.nav-btn::after,
.manage-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transform: translateX(-100%) skewX(-15deg);
    transition: transform 0.5s ease;
}

.auth-btn:hover::after,
.nav-btn:hover::after,
.manage-btn:hover::after {
    transform: translateX(100%) skewX(-15deg);
}

/* Styles pour le contenu de la bibliothèque */
.library-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
    min-height: 500px; /* Hauteur minimale pour éviter les sauts de page */
}

/* Amélioration des styles de recherche */
.search-box {
    position: relative;
    max-width: 600px;
    width: 100%;
    margin: 1rem auto;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 3rem 0.75rem 1rem;
    border: 2px solid var(--primary-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    background: transparent !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    box-shadow: none !important;
    outline: none !important;
    border: none;
    color: var(--text-primary);
}

.search-box input:focus {
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

.search-box input:-webkit-autofill,
.search-box input:-webkit-autofill:hover,
.search-box input:-webkit-autofill:focus,
.search-box input:-webkit-autofill:active {
    -webkit-text-fill-color: var(--text-primary) !important;
    -webkit-box-shadow: 0 0 0 30px transparent inset !important;
    box-shadow: 0 0 0 30px transparent inset !important;
    transition: background-color 5000s ease-in-out 0s;
    background: transparent !important;
    caret-color: var(--text-primary);
}

.search-box:focus-within {
    border-color: var(--glass-border);
}

.search-box button {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0.5rem;
}

/* Message pour aucun résultat */
.no-results {
    text-align: center;
    padding: 2rem;
    color: var(--text-color);
    font-size: 1.1rem;
}

.no-results i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    display: block;
}

/* Styles pour les contrôles de pagination */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding: 1rem;
    color: var(--text-primary); /* Utilisation de la couleur de texte claire */
}

.pagination-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
}

.pagination-btn:disabled {
    background: var(--glass-background);
    cursor: not-allowed;
    opacity: 0.5;
}

.pagination-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.3);
}

.page-indicator {
    font-size: 1rem;
    color: var(--text-primary); /* Utilisation de la couleur de texte claire */
    background: var(--glass-background);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--glass-border);
}

/* Amélioration du style des résultats de recherche */
.no-results {
    text-align: center;
    padding: 2rem;
    color: var(--text-color);
    font-size: 1.1rem;
    grid-column: 1 / -1;
}

.no-results i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    display: block;
}
