/* Style pour Bonnes Ondes - Plateforme de radios avec player global */

:root {
    --primary-color: #1a1a2e;
    --secondary-color: #16213e;
    --accent-color: #e94560;
    --featured-color: #ffd700;
    --background-color: #0f3460;
    --text-color: #fff;
    --light-text: #ddd;
    --card-bg: #16213e;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --hover-transform: translateY(-5px);
    --player-height: 90px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0 0 var(--player-height) 0; /* Espace pour le player global */
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--background-color) 100%);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ============================
   EN-TÊTE
   ============================ */

.main-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
}

.main-header h1 {
    font-size: 3.5rem;
    margin: 0;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--featured-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
}

.tagline {
    font-size: 1.3rem;
    color: var(--light-text);
    margin: 10px 0 0;
}

/* ============================
   LAYOUT 2 COLONNES
   ============================ */

.main-layout {
    display: grid;
    grid-template-columns: 1fr 600px;
    gap: 30px;
    margin-bottom: 30px;
}

/* ============================
   PANNEAU HISTORIQUE (COLONNE DROITE)
   ============================ */

.history-panel {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px var(--shadow-color);
    height: fit-content;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - var(--player-height) - 40px);
    display: flex;
    flex-direction: column;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(233, 69, 96, 0.2);
}

.history-header h2 {
    margin: 0;
    color: var(--accent-color);
    font-size: 1.8rem;
}

.close-history-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-color);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-history-btn:hover {
    background: var(--accent-color);
    transform: rotate(90deg);
}

.history-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

.nav-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.nav-btn:hover {
    background-color: #ff6b6b;
    transform: translateY(-2px);
}

.history-controls input[type="date"],
.history-controls select {
    padding: 10px 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    min-width: 150px;
}

.history-controls select option {
    background: var(--card-bg);
    color: var(--text-color);
}

.search-container {
    position: relative;
    flex: 1;
    min-width: 200px;
}

#search-input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}

.clear-search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--light-text);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 5px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.clear-search-btn.visible {
    opacity: 0.6;
    pointer-events: auto;
}

.clear-search-btn.visible:hover {
    opacity: 1;
    color: var(--accent-color);
}

.history-content {
    max-height: 700px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* History items - copié de Micro */
.history-item {
    display: flex;
    gap: 15px;
    padding: 25px 10px;
    margin-bottom: 0;
    background: transparent;
    position: relative;
    transition: background 0.2s;
    align-items: flex-start;
    width: 100%;
    max-width: 900px;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.history-item::before {
    content: '';
    position: absolute;
    left: 62px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.1) 45%, 
        transparent 45%, 
        transparent 55%, 
        rgba(255, 255, 255, 0.1) 55%, 
        rgba(255, 255, 255, 0.1) 100%
    );
    background-size: 2px 20px;
}

.history-item:last-child::before {
    display: none;
}

.history-timeline {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 105px;
    position: relative;
    z-index: 1;
    gap: 8px;
    margin-top: -20px;
}

.history-time {
    font-size: 0.8rem;
    color: var(--light-text);
    font-weight: 500;
    background: var(--primary-color);
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    position: relative;
    z-index: 2;
}

.history-artwork {
    flex-shrink: 0;
}

.history-artwork img {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 2px 8px var(--shadow-color);
    cursor: pointer;
    transition: transform 0.2s;
}

.history-artwork img:hover {
    transform: scale(1.05);
}

.history-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 30px;
}

.history-title {
    font-weight: bold;
    font-size: 1rem;
    color: var(--text-color);
    line-height: 1.3;
}

.history-artist {
    font-size: 0.9rem;
    color: var(--accent-color);
    font-weight: bold;
}

.history-album {
    font-size: 0.85rem;
    color: var(--light-text);
    margin-bottom: 8px;
}

.track-details {
    display: none;
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--light-text);
    line-height: 1.6;
}

.track-details.show {
    display: block;
}

.track-label {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}

.track-moods {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
}

.mood-tag {
    background: rgba(233, 69, 96, 0.2);
    color: var(--accent-color);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    border: 1px solid var(--accent-color);
}

.history-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    align-items: flex-start;
    margin-top: 30px;
}

.track-expand-btn {
    width: 20px;
    height: 20px;
    background: transparent;
    color: var(--light-text);
    border: none;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.track-expand-btn:hover {
    color: var(--accent-color);
    transform: scale(1.2);
}

/* Styles pour LIVESTREAM et SHOW */
.history-livestream {
    background: linear-gradient(90deg, rgba(255, 0, 0, 0.1) 0%, transparent 100%);
    border-left: 4px solid #ff0000;
    min-height: 120px;
}

.history-livestream::before {
    left: 59px !important;
}

.live-icon {
    font-size: 2.5rem;
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

.live-badge {
    display: inline-block;
    background: #ff0000;
    color: white;
    padding: 4px 12px;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: bold;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.history-livestream .history-title {
    font-size: 1.1rem;
    color: #ff6b6b;
}

.history-show {
    background: linear-gradient(90deg, rgba(0, 123, 255, 0.1) 0%, transparent 100%);
    border-left: 4px solid #007bff;
}

.history-show::before {
    left: 59px !important;
}

.show-icon {
    font-size: 2.5rem;
}

.show-badge {
    display: inline-block;
    background: #007bff;
    color: white;
    padding: 4px 12px;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: bold;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.history-show .history-title {
    font-size: 1.2rem;
    color: #4dabf7;
    font-weight: bold;
}

.show-description {
    color: var(--light-text);
    font-size: 0.9rem;
    margin-top: 8px;
    line-height: 1.4;
    font-style: italic;
}

.loading, .error {
    text-align: center;
    padding: 30px;
    color: var(--light-text);
}

.error {
    color: #ff6b6b;
}

/* ============================
   SECTION RADIOS
   ============================ */

.radios-section {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Radios principales (Micro + Tempête) - 2 boutons carrés */
.featured-radios {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.radio-card-square {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 20px;
    color: var(--text-color);
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px var(--shadow-color);
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.radio-card-square:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(233, 69, 96, 0.4);
    border-color: var(--accent-color);
}

.radio-card-square.active {
    border-color: var(--accent-color);
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(233, 69, 96, 0.1) 100%);
    box-shadow: 0 10px 30px rgba(233, 69, 96, 0.6);
}

.radio-card-square .radio-logo {
    width: 140px;
    height: 140px;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: 0 4px 10px var(--shadow-color);
    transition: transform 0.3s ease;
}

.radio-card-square:hover .radio-logo {
    transform: scale(1.05);
}

.radio-card-square .radio-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.5s ease;
}

.radio-card-square .radio-info {
    text-align: center;
    width: 100%;
}

.radio-card-square .radio-info h3 {
    font-size: 1.4rem;
    margin: 0 0 10px 0;
    color: var(--text-color);
}

/* Liste des autres radios - boutons rectangulaires (2 par ligne) */
.radios-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.radio-list-item {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 15px;
    color: var(--text-color);
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px var(--shadow-color);
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    position: relative;
}

.radio-list-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(233, 69, 96, 0.3);
    border-color: rgba(233, 69, 96, 0.5);
}

.radio-list-item.active {
    border-color: var(--accent-color);
    background: linear-gradient(90deg, var(--card-bg) 0%, rgba(233, 69, 96, 0.1) 100%);
    box-shadow: 0 5px 15px rgba(233, 69, 96, 0.6);
}

.radio-list-logo {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.radio-list-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.radio-list-info {
    flex: 1;
    min-width: 0;
}

.radio-list-info h4 {
    font-size: 1.1rem;
    margin: 0 0 5px 0;
    color: var(--text-color);
}

/* Styles communs pour les statuts */
.radio-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--light-text);
    margin: 0;
    min-height: 24px;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #4caf50;
    display: inline-block;
    animation: pulse 2s infinite;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
    flex-shrink: 0;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.now-playing {
    flex: 1;
    line-height: 1.3;
}

.radio-card-square .now-playing {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Les boutons de liste permettent le multiline */
.radio-list-item .now-playing {
    white-space: normal;
    overflow-wrap: break-word;
}

/* ============================
   PLAYER GLOBAL (FIXE EN BAS)
   ============================ */

.global-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--player-height);
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
    display: grid;
    grid-template-columns: 70px 70px 1fr auto;
    gap: 15px;
    align-items: center;
    padding: 0 20px;
    z-index: 900;
    border-top: 2px solid var(--accent-color);
}

.player-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: white;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.player-btn:hover {
    transform: scale(1.1);
    background-color: #ff6b6b;
}

.player-btn.playing {
    background-color: #ff6b6b;
}

.player-artwork {
    width: 65px;
    height: 65px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.player-artwork img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-track-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    overflow: hidden;
}

.player-track-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-track-artist {
    font-size: 0.95rem;
    color: var(--accent-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-track-album {
    font-size: 0.85rem;
    color: var(--light-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-volume {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
}

.volume-icon {
    font-size: 1.3rem;
}

#volume-slider {
    width: 120px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    outline: none;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
}

#volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    border: none;
}

#volume-value {
    font-size: 0.9rem;
    color: var(--light-text);
    min-width: 40px;
}

/* ============================
   SECTIONS INFO ET FOOTER
   ============================ */

.info-section {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px var(--shadow-color);
}

.info-section h2 {
    color: var(--accent-color);
    margin-top: 0;
    font-size: 2rem;
}

.info-section p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--light-text);
}

.tech-info {
    font-size: 0.95rem !important;
    font-style: italic;
    opacity: 0.8;
}

.main-footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--light-text);
    font-size: 0.95rem;
}

.main-footer a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.main-footer a:hover {
    color: var(--featured-color);
    text-decoration: underline;
}

/* ============================
   MODAL ARTWORK
   ============================ */

.artwork-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.artwork-modal.show {
    display: flex;
}

.artwork-modal img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ============================
   RESPONSIVE
   ============================ */

@media (max-width: 1024px) {
    .global-player {
        grid-template-columns: 60px 60px 1fr;
        gap: 10px;
        padding: 0 15px;
    }
    
    .player-volume {
        display: none;
    }
}

@media (max-width: 1200px) {
    .main-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .history-panel {
        position: relative;
        top: 0;
        max-height: 600px;
    }
}

@media (max-width: 768px) {
    .main-header h1 {
        font-size: 2.5rem;
    }

    .tagline {
        font-size: 1.1rem;
    }

    .featured-radios {
        grid-template-columns: 1fr;
    }
    
    .radio-card-square .radio-logo {
        width: 120px;
        height: 120px;
    }
    
    .radio-list-logo {
        width: 50px;
        height: 50px;
    }

    .history-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .history-controls input,
    .history-controls select,
    .nav-btn {
        width: 100%;
    }

    .global-player {
        grid-template-columns: 50px 55px 1fr;
        padding: 0 10px;
        gap: 8px;
    }

    .player-btn {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }

    .player-artwork {
        width: 50px;
        height: 50px;
    }

    .player-track-title {
        font-size: 0.95rem;
    }

    .player-track-artist {
        font-size: 0.85rem;
    }

    .player-track-album {
        display: none;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    .main-header h1 {
        font-size: 2rem;
    }

    .featured-badge {
        font-size: 0.75rem;
        padding: 4px 10px;
    }

    .history-item {
        flex-direction: column;
        padding: 20px 10px;
        gap: 8px;
        align-items: center;
        text-align: center;
    }

    .history-timeline {
        flex-direction: column;
        align-items: center;
        min-width: auto;
        width: 100%;
        gap: 8px;
        margin-top: 0;
    }

    .history-item::before {
        display: none;
    }

    .history-actions {
        position: absolute;
        top: 10px;
        right: 10px;
        margin-top: 0;
    }
}

/* Animation d'entrée pour les cartes */
.radio-card {
    animation: fadeInUp 0.5s ease-out;
}

.radio-card:nth-child(1) { animation-delay: 0.1s; }
.radio-card:nth-child(2) { animation-delay: 0.2s; }
.radio-card:nth-child(3) { animation-delay: 0.3s; }
.radio-card:nth-child(4) { animation-delay: 0.4s; }
.radio-card:nth-child(5) { animation-delay: 0.5s; }
.radio-card:nth-child(6) { animation-delay: 0.6s; }

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

