/* ========== VARIABLES ========== */
:root {
    --primary-color: #f8f9fa;
    --dark-bg: #212529;
    --card-bg: #2c3034;
    --border-color: #495057;
    --transition: all 0.3s ease;
}

/* ========== GLOBAL (Mode Dark) ========== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--dark-bg);
    color: #f8f9fa;
    min-height: 100vh;
}


.notification-icon {
    position: relative;  /* Pour positionner le badge en absolu */
    font-size: 24px;
}

.notification-icon .badge {
    position: absolute;  /* Sort du flux normal */
    top: -5px;          /* 5px au-dessus */
    right: -10px;       /* 10px à droite */
    background-color: #ef4444;  /* Rouge */
    color: white;
    border-radius: 50%; /* Rond */
    padding: 2px 6px;
    font-size: 12px;
    font-weight: bold;
}

/* ========== NAVBAR ========== */
.navbar {
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.3rem;
}

.navbar-brand img {
    /* Garde l'image originale sans filtre */
    object-fit: contain;
}

/* Nav-link styling - Spécificité augmentée pour surcharger Bootstrap */
.navbar-dark .nav-link {
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 0.75rem;
    margin: 0.25rem 0.125rem;
    border-radius: 0.375rem;
    color: rgba(255, 255, 255, 0.75);
}

.navbar-dark .nav-link:hover {
    color: #fff !important;
    transform: translateY(-2px);
}

/* Nav-link active - Surcharge Bootstrap avec spécificité élevée */
.navbar-dark .navbar-nav .nav-link.active,
.navbar-dark .navbar-nav .nav-link.active:hover,
.navbar-dark .navbar-nav .nav-link.active:focus {
    background-color: #ffffff !important;
    color: #000000 !important;
    border-radius: 0.375rem;
}

/* Dropdown toggle active */
.navbar-dark .navbar-nav .dropdown .nav-link.dropdown-toggle.active {
    background-color: #ffffff !important;
    color: #000000 !important;
    border-radius: 0.375rem;
}

/* Dropdown items styling */
.dropdown-menu-dark .dropdown-item {
    padding: 0.5rem 1rem;
    transition: var(--transition);
}

.dropdown-menu-dark .dropdown-item:hover,
.dropdown-menu-dark .dropdown-item:focus {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Mobile responsive adjustments */
@media (max-width: 991.98px) {
    .navbar-dark .nav-link {
        padding: 0.5rem 0.75rem;
        margin: 0.125rem 0;
    }

    .dropdown-menu {
        margin-top: 0.25rem;
    }

    .dropdown-menu-dark .dropdown-item {
        padding: 0.5rem 1rem;
    }
}

/* ========== BARRE DE RECHERCHE DANS NAVBAR ========== */
#search-input {
    background-color: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    transition: var(--transition);
}

#search-input::placeholder {
    color: rgba(255,255,255,0.6);
}

#search-input:focus {
    background-color: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.5);
    box-shadow: 0 0 0 0.2rem rgba(173, 181, 189, 0.25);
    color: white;
}

#filters-toggle-btn {
    border-color: rgba(255,255,255,0.3);
}

#filters-toggle-btn:hover {
    background-color: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.5);
}

/* ========== CARDS ========== */
.track-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: var(--transition);
    background: var(--card-bg);
    max-width: 600px;
    margin-right: auto;
    margin-left: auto;
}

.track-card:hover {
    box-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Éclaircir le titre au hover de la carte */
.track-card:hover h6 a,
.track-card:hover h6 a.text-white,
.track-card:hover h6 a.text-decoration-none {
    color: #ffffff !important;
    filter: brightness(1.4);
    transition: all 0.2s ease;
}

/* Souligner le nom du compositeur au hover */
.track-card small.text-muted a:hover {
    text-decoration: underline !important;
    color: #f8f9fa !important;
}

/* ========== IMAGE WRAPPER ========== */
.image-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.music-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
    cursor:pointer;
}

.image-wrapper:hover .play-overlay {
    opacity: 1;
}

.image-wrapper:hover .music-card-img {
    transform: scale(1.05);
}

/* ========== PLAY ICON ========== */
.play-icon {
    width: 0;
    height: 0;
    border-left: 20px solid white;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    transition: var(--transition);
}

.play-icon.playing {
    border-left: 8px solid white;
    border-right: 8px solid white;
    border-top: 0;
    border-bottom: 0;
    width: 6px;
    height: 24px;
}

/* ========== TAGS COMPACTS ========== */
.tag {
    display: inline-block;
    background: #495057;
    border: 1px solid #6c757d;
    color: #ffffff;
    font-size: 0.65rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
    font-weight: 500;
    line-height: 1.2;
    transition: all 0.2s ease;
}

.tag:hover {
    background: #5a6268;
    border-color: #7d858d;
    transform: translateY(-1px);
}

/* Les couleurs par catégorie sont chargées dynamiquement via category_colors.js */

/* ========== TEXTES ========== */

/* ========== TEXTES ========== */
h6, .text-muted {
    color: #f8f9fa !important;
}

small.text-muted {
    color: #adb5bd !important;
}

em.text-muted {
    color: #adb5bd !important;
}

/* Tags sélectionnables pour l'admin AVEC COULEURS */
.selectable-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 1rem;
    background: #1a1d20;
    border-radius: 8px;
    border: 1px solid #495057;
}

.selectable-tag {
    display: inline-block;
    padding: 0.3rem 0.7rem;
    background: #495057;
    border: 2px solid #495057;
    color: #ffffff;
    font-size: 0.7rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    user-select: none;
}

.selectable-tag:hover {
    transform: translateY(-1px);
    filter: brightness(1.15);
}

.selectable-tag.selected {
    border-width: 2px;
    border-style: solid;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* Les couleurs par catégorie sont chargées dynamiquement via category_colors.js */

.selected-tags-preview {
    min-height: 50px;
    padding: 0.8rem;
    background: #2c3034;
    border-radius: 6px;
    border: 1px solid #495057;
    margin-top: 1rem;
}

.selected-tags-preview-title {
    font-size: 0.8rem;
    color: #adb5bd;
    margin-bottom: 0.5rem;
}

.selected-tag-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    color: #ffffff;
    font-size: 0.65rem;
    border-radius: 4px;
    margin-right: 0.3rem;
    margin-bottom: 0.3rem;
    font-weight: 500;
}

/* Les couleurs pour les badges sélectionnés sont chargées dynamiquement via category_colors.js */

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .track-card {
        flex-direction: column !important;
        text-align: center;
    }
    
    .image-wrapper {
        margin: 0 auto 1rem !important;
        width: 150px;
        height: 150px;
    }
}