﻿/* Couleurs de liens */
a:visited {
    color: #b794f6;
}

main {
    flex: 1;
}

body {
    padding-top: 70px;
}

html, body {
    height: 100%;
    min-height: 100%;
    background: linear-gradient(to bottom, #1a0b2e, #2d1b4e, #3d2463);
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-size: cover;
}

body.background {
    background: linear-gradient(to bottom, #1a0b2e, #2d1b4e, #3d2463);
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(26, 11, 46, 0.85);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    padding: 18px 0;
    display: flex;
    justify-content: center;
    gap: 30px;
    border-bottom: 2px solid rgba(183, 148, 246, 0.3);
}

.nav a {
    color: #b794f6;
    text-decoration: none;
    font-weight: bold;
    font-family: 'Quicksand', sans-serif;
    font-size: 1rem;
    padding: 8px 30px;
    border-radius: 10px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.nav a:hover {
    background: rgba(183, 148, 246, 0.15);
    border-color: rgba(183, 148, 246, 0.4);
    color: #d4bfff;
    transform: translateY(-2px);
}

/* Conteneur barre de recherche + compteur */
.search-bar-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    max-width: 900px;
    margin: 30px auto 30px;
    padding: 0 20px;
    flex-wrap: wrap;
}

/* Barre de recherche */
.search-container {
    flex: 1;
    min-width: 300px;
    max-width: 600px;
}

#searchInput {
    width: 100%;
    padding: 16px 24px;
    font-size: 1.05rem;
    border: 2px solid rgba(183, 148, 246, 0.4);
    border-radius: 50px;
    background: rgba(26, 11, 46, 0.7);
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    color: #E8E0F5;
    font-family: 'Quicksand', sans-serif;
    transition: all 0.3s ease;
    text-align: center;
}

#searchInput::placeholder {
    color: #b794f6;
    text-align: center;
}

#searchInput:focus {
    outline: none;
    background: rgba(26, 11, 46, 0.85);
    border-color: #b794f6;
    box-shadow: 0 12px 32px rgba(183, 148, 246, 0.3), 0 0 0 4px rgba(183, 148, 246, 0.15);
    transform: translateY(-2px);
}

/* Compteur total */
.total-count {
    padding: 14px 28px;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    border-radius: 50px;
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    font-family: 'Quicksand', sans-serif;
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
    border: 2px solid rgba(183, 148, 246, 0.3);
    white-space: nowrap;
    transition: all 0.3s ease;
}

.total-count:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.5);
}

.total-count span {
    font-size: 1.3rem;
    font-weight: 900;
    color: #ffd700;
}

/* Compteur de catégorie */
.category-count {
    font-size: 0.8em;
    color: #d4bfff;
    font-weight: normal;
    opacity: 0.9;
    margin-left: 8px;
}

/* Message de succès */
.success-message {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(46, 204, 113, 0.9);
    color: white;
    padding: 15px 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    animation: slideDown 0.3s ease, fadeOut 0.5s ease 2.5s;
    font-weight: 600;
}

@keyframes slideDown {
    from { top: 60px; opacity: 0; }
    to { top: 80px; opacity: 1; }
}

@keyframes fadeOut {
    to { opacity: 0; }
}

/* Fond général */
.background {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Section d'intro */
.intro {
    max-width: 700px;
    margin: 80px auto;
    background: rgba(26, 11, 46, 0.8);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(183, 148, 246, 0.2);
}

.intro h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.6em;
    color: #b794f6;
    margin-bottom: 15px;
    text-shadow: 0 2px 10px rgba(183, 148, 246, 0.4);
}

.intro h2 {
    font-style: italic;
    font-size: 1.3em;
    color: #d4bfff;
    margin-bottom: 25px;
}

.intro p {
    font-size: 1.05em;
    color: #E8E0F5;
    line-height: 1.7;
    margin-bottom: 35px;
}

/* Conteneur de boutons */
.btn-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* Boutons */
.btn-galerie {
    padding: 14px 32px;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: bold;
    font-size: 1.05em;
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
    transition: all 0.3s ease;
    border: 2px solid rgba(183, 148, 246, 0.3);
}

.btn-galerie:hover {
    background: linear-gradient(135deg, #6d28d9, #7c3aed);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.5);
}

.btn-pez {
    background: linear-gradient(135deg, #e91e63, #c2185b);
    box-shadow: 0 6px 20px rgba(233, 30, 99, 0.4);
}

.btn-pez:hover {
    background: linear-gradient(135deg, #c2185b, #e91e63);
    box-shadow: 0 8px 25px rgba(233, 30, 99, 0.5);
}

.btn-piece {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.4);
}

.btn-piece:hover {
    background: linear-gradient(135deg, #f57c00, #ff9800);
    box-shadow: 0 8px 25px rgba(255, 152, 0, 0.5);
}

.btn-bd {
    background: linear-gradient(135deg, #3498db, #2980b9);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.btn-bd:hover {
    background: linear-gradient(135deg, #2980b9, #3498db);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.5);
}

/* Sélecteur de type */
.type-selector {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 40px auto 20px;
    max-width: 600px;
    padding: 0 20px;
}

.type-btn {
    padding: 12px 28px;
    background: rgba(26, 11, 46, 0.7);
    color: #b794f6;
    border: 2px solid rgba(183, 148, 246, 0.3);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: bold;
    font-family: 'Quicksand', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.type-btn:hover {
    background: rgba(183, 148, 246, 0.15);
    border-color: rgba(183, 148, 246, 0.5);
    transform: translateY(-2px);
}

.type-btn.active {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

/* Bouton de déconnexion */
.btn-logout {
    padding: 8px 16px;
    background: rgba(231, 76, 60, 0.15);
    color: #ff6b6b;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 2px solid rgba(231, 76, 60, 0.3);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-logout:hover {
    background: rgba(231, 76, 60, 0.25);
    border-color: rgba(231, 76, 60, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

/* Popup */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    cursor: pointer;
}

.popup img {
    max-width: 80%;
    max-height: 80%;
    border-radius: 12px;
    box-shadow: 0 0 40px rgba(183, 148, 246, 0.5);
}

/* Galerie */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 25px;
    max-width: 1200px;
    margin: 40px auto;
    padding: 30px;
    background: rgba(26, 11, 46, 0.6);
    backdrop-filter: blur(8px);
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    place-items: center;
}

/* Carte standard (Pez/Monnaie) */
.carte {
    background: rgba(26, 11, 46, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    max-width: 220px;
    padding: 24px;
    border: 2px solid rgba(183, 148, 246, 0.2);
}

.carte:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(183, 148, 246, 0.3);
    border-color: rgba(183, 148, 246, 0.4);
}

.carte img {
    width: 170px;
    height: 260px;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.carte img:hover {
    transform: scale(1.05);
}

.carte h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #b794f6;
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
}

/* Carte BD spécifique */
.carte-bd {
    max-width: 200px;
    gap: 10px;
    padding: 20px;
}

.carte-bd img {
    width: 160px;
    height: 240px;
    object-fit: cover;
}

.carte-bd h3 {
    margin: 8px 0 5px;
    font-size: 1.1rem;
    line-height: 1.4;
}

.carte .numero {
    display: inline-block;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 6px;
    box-shadow: 0 3px 10px rgba(52, 152, 219, 0.4);
    letter-spacing: 0.5px;
}

.carte .auteur {
    font-size: 0.85rem;
    color: #d4bfff;
    margin: 0;
    font-style: italic;
}

.carte .annee {
    font-size: 0.8rem;
    color: #E8E0F5;
    margin: 0;
}

/* Titre de section */
.collection h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.2em;
    text-align: center;
    margin-bottom: 25px;
    color: #b794f6;
    text-shadow: 0 2px 10px rgba(183, 148, 246, 0.3);
}

/* Formulaire */
.formulaire {
    max-width: 500px;
    margin: 60px auto;
    padding: 35px;
    background: rgba(26, 11, 46, 0.85);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 18px;
    color: #E8E0F5;
    font-family: 'Quicksand', sans-serif;
    border: 2px solid rgba(183, 148, 246, 0.2);
}

.form-title {
    color: #b794f6;
    text-align: center;
    margin-bottom: 10px;
}

.formulaire label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #b794f6;
    font-size: 0.95rem;
}

.formulaire input,
.formulaire select {
    padding: 12px;
    border: 2px solid rgba(183, 148, 246, 0.3);
    border-radius: 10px;
    background: rgba(26, 11, 46, 0.5);
    color: #E8E0F5;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.formulaire input:focus,
.formulaire select:focus {
    outline: none;
    border-color: #b794f6;
    background: rgba(26, 11, 46, 0.7);
    box-shadow: 0 0 0 3px rgba(183, 148, 246, 0.15);
}

.formulaire input::placeholder {
    color: #b794f6;
    opacity: 0.6;
}

.formulaire button {
    padding: 14px;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: bold;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}

.formulaire button:hover {
    background: linear-gradient(135deg, #6d28d9, #7c3aed);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.5);
}

/* Input file */
.formulaire input[type="file"] {
    padding: 12px;
    border: 2px dashed rgba(183, 148, 246, 0.5);
    border-radius: 10px;
    background: rgba(26, 11, 46, 0.5);
    color: #E8E0F5;
    cursor: pointer;
}

.formulaire input[type="file"]::file-selector-button {
    padding: 8px 16px;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    margin-right: 10px;
    transition: all 0.3s ease;
}

.formulaire input[type="file"]::file-selector-button:hover {
    background: linear-gradient(135deg, #6d28d9, #7c3aed);
    transform: translateY(-1px);
}

/* Bouton de suppression */
.btn-delete {
    padding: 6px 12px;
    background: rgba(231, 76, 60, 0.15);
    color: #ff6b6b;
    border: 2px solid rgba(231, 76, 60, 0.3);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
    font-family: 'Quicksand', sans-serif;
}

.btn-delete:hover {
    background: rgba(231, 76, 60, 0.25);
    border-color: rgba(231, 76, 60, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

/* Popup de suppression */
.delete-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease;
}

.delete-popup-content {
    background: linear-gradient(135deg, #1a0b2e 0%, #2d1b4e 100%);
    border-radius: 20px;
    padding: 35px 40px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    text-align: center;
    border: 2px solid rgba(183, 148, 246, 0.3);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.delete-popup-icon {
    font-size: 4em;
    margin-bottom: 15px;
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.delete-popup-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.8em;
    color: #b794f6;
    margin-bottom: 15px;
}

.delete-popup-message {
    font-family: 'Quicksand', sans-serif;
    font-size: 1.1em;
    color: #E8E0F5;
    margin-bottom: 10px;
    line-height: 1.6;
}

.delete-popup-message span {
    color: #b794f6;
    font-weight: bold;
}

.delete-popup-warning {
    font-size: 0.95em;
    color: #ff6b6b;
    margin-bottom: 25px;
    font-style: italic;
}

.delete-popup-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-cancel,
.btn-confirm {
    padding: 12px 28px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: bold;
    font-family: 'Quicksand', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel {
    background: rgba(183, 148, 246, 0.15);
    color: #b794f6;
    border: 2px solid rgba(183, 148, 246, 0.3);
}

.btn-cancel:hover {
    background: rgba(183, 148, 246, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(183, 148, 246, 0.3);
}

.btn-confirm {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: 2px solid rgba(231, 76, 60, 0.3);
}

.btn-confirm:hover {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.5);
}

.btn-confirm:active,
.btn-cancel:active {
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .search-bar-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .search-container {
        width: 100%;
    }
    
    .total-count {
        width: 100%;
        text-align: center;
    }
}