@font-face {
    font-family: "Calibri_W01_Regular.ttf";
    src: url(../font/Calibri_W01_Regular.ttf);
}

html {
    background: url(../images/813730.jpg);
    background-repeat: no-repeat;
    background-position: center center;
    background-attachment: fixed;
    background-size: cover;
    font-family: "Calibri_W01_Regular.ttf", Calibri, Arial, sans-serif;
}

body { margin: 0; padding: 0; }
a { text-decoration: none; color: #000; }
h1 { color: #FFF; }
h2, h4, h5 { color: #000; }
h4 { font-size: 10px; }
p { color: #0000FF; font-size: 20px; }

div#page { text-align: center; margin-bottom: 120px; }
div#corp-page { padding: 1rem 2rem; }

/* ===== HEADER / NAV ===== */
header {
    background: rgb(255, 255, 255);
    border-bottom: 4px solid #EF6000;
    height: 54px;
    display: flex;
    align-items: center;
}

nav#menubar1 {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
    padding: 0 5px;
}

nav#menubar1 > a {
    font-size: 24px;
    padding: 10px 30px;
    color: #000;
    text-decoration: none;
    display: inline-block;
    white-space: nowrap;
}

nav#menubar1 > a:hover { background: rgb(230, 130, 0); color: #FFF; }

/* ===== RECHERCHE ===== */
#search-container { position: relative; margin-left: auto; margin-right: 20px; }

#search-input {
    width: 250px;
    padding: 8px 14px;
    border: 2px solid #ccc;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s, width 0.3s;
    background: rgba(255,255,255,0.9);
}

#search-input:focus { border-color: #EF6000; width: 350px; }

#search-results {
    display: none;
    position: absolute;
    top: 100%; right: 0;
    width: 400px;
    max-height: 400px;
    overflow-y: auto;
    background: rgba(30, 30, 30, 0.97);
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    z-index: 2000;
    margin-top: 5px;
}

.search-result-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transition: background 0.2s;
    display: flex;
    flex-direction: column;
}

.search-result-item:hover { background: rgba(239, 96, 0, 0.3); }
.search-result-title { color: #fff; font-size: 15px; font-weight: 600; }
.search-result-album { color: rgba(255,255,255,0.5); font-size: 12px; margin-top: 2px; }
.search-no-result { padding: 20px; color: rgba(255,255,255,0.5); text-align: center; }

/* ===== FILTRES GENRE ===== */
#genre-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.genre-btn {
    padding: 8px 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 25px;
    background: rgba(30, 30, 30, 0.7);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.genre-btn:hover { background: rgba(239, 96, 0, 0.3); border-color: #EF6000; }
.genre-btn.active { background: #EF6000; border-color: #EF6000; font-weight: bold; }

/* ===== GRILLE ALBUMS ===== */
#album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    justify-items: center;
}

.album-card {
    position: relative;
    width: 280px;
    height: 280px;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.album-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.7) 100%);
    opacity: 0.8;
    transition: opacity 0.3s;
    z-index: 1;
}

.album-card:hover { transform: translateY(-10px) scale(1.05); box-shadow: 0 20px 50px rgba(0,0,0,0.4); }
.album-card:hover::before { opacity: 0.3; }
.album-card:focus { outline: 3px solid #EF6000; outline-offset: 3px; }

.imgal {
    width: 100%; height: 100%;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    position: relative;
}

.album-title {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 1.5rem;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.7) 50%, transparent 100%);
    color: white;
    z-index: 2;
    transition: transform 0.3s;
}

.album-title h1 {
    font-size: 1rem; font-weight: 600; line-height: 1.3; margin: 0;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.album-card:hover .album-title { transform: translateY(-5px); }

.album-genre-tag {
    display: inline-block; font-size: 0.7rem;
    background: rgba(239, 96, 0, 0.7);
    padding: 2px 10px; border-radius: 12px; margin-top: 5px; color: #fff;
}

.badge-flac {
    display: inline-block; font-size: 0.6rem; font-weight: bold;
    background: #1db954; color: #fff;
    padding: 1px 6px; border-radius: 4px; vertical-align: middle; margin-right: 4px;
}

/* ===== ALBUM HEADER BAR (bouton retour + cover + nom) ===== */
#album-header-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
    margin-bottom: 10px;
}

#album-header-cover {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

#album-header-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

#album-header-name {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 6px rgba(0,0,0,0.6);
}

#album-header-count {
    color: rgba(255,255,255,0.55);
    font-size: 13px;
}

/* ===== BOUTON RETOUR (style orange) ===== */
.back-button {
    background: #EF6000;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
}

.back-button:hover { background: #d05400; }

/* ===== ALBUM VIEW ===== */
#album-content { text-align: left; }

#album-view {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

#playlist-container { flex: 1; min-width: 0; }

#cover-container {
    flex-shrink: 0;
    position: sticky;
    top: 80px;
}

#album-cover-img {
    width: 300px; height: 300px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* ===== PLAYLIST ===== */
#playlist {
    list-style-type: none;
    padding: 0; margin: 0;
    background: rgba(20, 20, 20, 0.534);
}

#playlist li { margin-bottom: 0; }

#playlist li a {
    display: block;
    padding: 14px 2%;
    color: rgba(255,255,255,1);
    text-decoration: none;
    font-weight: 900;
    font-size: 24px;
    position: relative;
    z-index: 900;
    transition: background-color 0.2s;
}

#playlist li a:hover { background-color: rgba(239, 96, 0, 0.2); }

.titre_dir {
    margin-top: 20px;
    text-decoration-line: underline;
    font-size: 1.4em;
    color: #FFF;
    padding: 15px 2%;
    margin-bottom: 10px;
}

.track-album-name {
    display: block; font-size: 0.5em;
    color: rgba(255,255,255,0.4); font-weight: 400; margin-top: 2px;
}

ul { text-align: left; padding-left: 2%; list-style-type: none; text-decoration: none; }

/* ===== BOUTONS ACTION ===== */
.action-button {
    background: rgba(40, 40, 40, 0.9);
    color: white;
    border: 2px solid rgba(255,255,255,0.2);
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.action-button:hover { background: rgba(239, 96, 0, 0.3); border-color: #EF6000; }

.action-button-sm {
    background: rgba(60, 60, 60, 0.8);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}

.action-button-sm:hover { background: #EF6000; }

/* ===== MODE ALÉATOIRE ===== */
#random-controls {
    padding: 0 0 15px 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

#album-select-panel {
    background: rgba(20, 20, 20, 0.85);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    max-height: 400px;
    overflow-y: auto;
}

#album-select-header {
    margin-bottom: 10px; padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}

#album-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 4px;
}

.album-checkbox-label {
    display: flex; align-items: center; gap: 8px;
    color: #fff; font-size: 14px;
    padding: 5px 8px; border-radius: 6px;
    cursor: pointer; transition: background 0.2s;
}

.album-checkbox-label:hover { background: rgba(239, 96, 0, 0.15); }
.album-checkbox { accent-color: #EF6000; width: 16px; height: 16px; }

/* ===== FOOTER / PLAYER ===== */
footer {
    background-color: rgba(20, 20, 20, 0.98);
    height: 100px;
    width: 100%;
    bottom: 0; left: 0; right: 0;
    position: fixed;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 10px;
    box-sizing: border-box;
}

#footer-cover {
    width: 75px; height: 75px; min-width: 75px;
    border-radius: 6px; overflow: hidden;
    background: rgba(50,50,50,0.5);
}

#footer-cover-img {
    width: 100%; height: 100%;
    object-fit: cover; display: none; border-radius: 6px;
}

#audioplayer {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    min-width: 0;
}

#pButton {
    height: 60px; width: 60px; min-width: 60px;
    border: none;
    background-size: 50% 50%;
    background-repeat: no-repeat;
    background-position: center;
    outline: none; cursor: pointer;
    background-color: transparent;
}

.play { background-image: url('../images/play.png'); }
.pause { background-image: url('../images/pause.png'); }

#timeline {
    flex: 1;
    height: 20px;
    border-radius: 15px;
    background: rgba(68, 125, 125, 1);
    min-width: 80px;
    margin: 0 8px;
}

#playhead {
    width: 18px; height: 18px;
    border-radius: 50%; margin-top: 1px;
    background: rgba(255, 255, 255, 1);
}

#now-playing {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 60px;
    margin-top: -2px;
    min-width: 0;
}

#now-playing-title {
    color: #fff; font-size: 13px; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

#now-playing-album {
    color: rgba(255,255,255,0.5); font-size: 12px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

#flac-badge {
    background: #1db954; color: #fff;
    font-size: 10px; font-weight: bold;
    padding: 2px 7px; border-radius: 3px;
    letter-spacing: 1px; flex-shrink: 0;
}

#volume2 {
    display: flex; align-items: center; gap: 5px; flex-shrink: 0;
}

#volume { width: 120px; }
.volm1, .volm2 { outline: none; }

/* ===== RANGE SLIDER ===== */
input[type="range"] {
    -webkit-appearance: none;
    height: 20px;
    background: linear-gradient(to right, #20789A 0%, #00ABED 100%);
    background-size: 100% 10px;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px; height: 20px;
    background: rgb(245, 241, 240);
    position: relative; z-index: 3;
    box-shadow: 0 0 5px 0 rgba(0,0,0,0.3);
}

input[type=range]::-moz-range-track {
    width: 100%; height: 8px;
    cursor: pointer;
    background: linear-gradient(to right, #20789A, #00ABED);
    border-radius: 4px;
}

input[type=range]::-moz-range-thumb {
    border: 1px solid #eaeaea;
    height: 20px; width: 20px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
}

/* ===== MISC ===== */
.loading {
    display: block; width: 40px; height: 40px;
    border: 3px solid #f3f3f3; border-top: 3px solid #EF6000;
    border-radius: 50%; animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.error-msg {
    color: #ff4444; background: rgba(255,0,0,0.1);
    padding: 15px; border-radius: 8px; margin: 20px;
}

@keyframes fadeInUp { to { opacity: 1; transform: translateY(0); } }

@media screen and (max-width: 1100px) , screen and (max-height: 450px) { /* Pour petits ecrans */
    #album-cover-img{
        display: none;
    }
}