/* Radio Elgean - Radio Player Styles */
/* Brand Colors: Mint #D8F2D5, Forest Green #1F4E23, Teal #38A29D, Calico Orange #EFA63C, Charcoal #231F20, Cream #F5EADA */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --mint: #D8F2D5;
    --forest-green: #1F4E23;
    --teal: #38A29D;
    --calico-orange: #EFA63C;
    --charcoal: #231F20;
    --cream: #F5EADA;
    --white: #FFFFFF;
}

body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--white);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    color: var(--charcoal);
}

.player-container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.player-card {
    background: var(--cream);
    border-radius: 24px;
    padding: 2.5rem 2rem;
    box-shadow: 0 10px 40px rgba(31, 78, 35, 0.1);
    text-align: center;
}

/* Header */
.player-header {
    margin-bottom: 2rem;
}

.player-header h1 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 2.5rem;
    color: var(--forest-green);
    margin-bottom: 0.5rem;
}

.quality-badge {
    display: inline-block;
    background: var(--mint);
    color: var(--forest-green);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Now Playing Section */
.now-playing {
    background: var(--white);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

/* Album Art */
.album-art-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.album-art {
    width: 100%;
    max-width: 280px;
    height: auto;
    aspect-ratio: 1;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(31, 78, 35, 0.15);
    object-fit: cover;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.album-art:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 16px rgba(31, 78, 35, 0.2);
}

.track-info {
    margin-bottom: 1rem;
}

.track-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--charcoal);
    margin-bottom: 0.25rem;
}

.track-artist {
    font-size: 0.95rem;
    color: var(--teal);
}

/* Like Section */
.like-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem 0;
}

.like-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--charcoal);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    padding: 0;
}

.like-btn:hover {
    transform: scale(1.15);
    background: var(--mint);
}

.like-btn:active {
    transform: scale(0.95);
}

.like-btn.liked {
    color: #E63946;
}

.like-icon {
    transition: all 0.3s ease;
}

.like-btn.liked .like-icon {
    fill: #E63946;
    filter: drop-shadow(0 0 3px rgba(230, 57, 70, 0.3));
    animation: heartbeat 0.3s ease;
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

.like-count {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--charcoal);
    min-width: 20px;
    text-align: left;
    line-height: 1;
}

/* Status Indicator */
.status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--teal);
    border-radius: 50%;
    display: inline-block;
}

.status-dot.playing {
    animation: pulse 1.5s ease-in-out infinite;
}

.status-dot.error {
    background: #dc3545;
    animation: none;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

.status-text {
    font-size: 0.85rem;
    color: var(--charcoal);
    opacity: 0.8;
}

/* Player Controls */
.player-controls {
    margin: 2rem 0;
}

.control-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: none;
    background: var(--forest-green);
    color: var(--white);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(31, 78, 35, 0.3);
}

.control-btn:hover {
    background: var(--teal);
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(56, 162, 157, 0.4);
}

.control-btn:active {
    transform: scale(0.98);
}

.control-btn .hidden {
    display: none;
}

.control-btn.streaming .start-icon {
    display: none;
}

.control-btn.streaming .stop-icon {
    display: block;
}

/* Volume Controls */
.volume-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem 1rem;
    background: var(--white);
    border-radius: 16px;
}

.control-btn-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--cream);
    color: var(--charcoal);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.control-btn-small:hover {
    background: var(--mint);
    color: var(--forest-green);
}

.control-btn-small .hidden {
    display: none;
}

.control-btn-small.muted .volume-icon {
    display: none;
}

.control-btn-small.muted .mute-icon {
    display: block;
}

/* Volume Slider */
.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--cream);
    outline: none;
    flex-grow: 1;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--teal);
    cursor: pointer;
    transition: all 0.2s ease;
}

.volume-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--teal);
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: var(--forest-green);
}

.volume-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    background: var(--forest-green);
}

.volume-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--charcoal);
    min-width: 40px;
    text-align: right;
}

/* Responsive Design */
@media (max-width: 640px) {
    body {
        padding: 0.5rem;
    }

    .player-card {
        padding: 2rem 1.5rem;
    }

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

    .quality-badge {
        font-size: 0.7rem;
        padding: 0.35rem 0.85rem;
    }

    .album-art {
        max-width: 240px;
    }

    .track-title {
        font-size: 1.1rem;
    }

    .track-artist {
        font-size: 0.9rem;
    }

    .control-btn {
        width: 70px;
        height: 70px;
    }

    .volume-controls {
        padding: 1rem 0.75rem;
        gap: 0.75rem;
    }

    .volume-value {
        font-size: 0.8rem;
        min-width: 35px;
    }

    .like-section {
        gap: 0.4rem;
    }

    .like-btn {
        width: 40px;
        height: 40px;
    }

    .like-icon {
        width: 24px;
        height: 24px;
    }

    .like-count {
        font-size: 0.9rem;
    }
}

@media (max-width: 400px) {
    .player-header h1 {
        font-size: 1.75rem;
    }

    .control-btn {
        width: 65px;
        height: 65px;
    }

    .control-btn svg {
        width: 28px;
        height: 28px;
    }
}

/* Loading State */
.control-btn.loading {
    opacity: 0.6;
    cursor: not-allowed;
}

.control-btn.loading:hover {
    transform: none;
    background: var(--forest-green);
}

/* Accessibility */
.control-btn:focus,
.control-btn-small:focus,
.volume-slider:focus {
    outline: 3px solid var(--teal);
    outline-offset: 3px;
}

/* Track Update Animation */
.track-title.track-update {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    0% {
        opacity: 0.5;
        transform: translateY(-5px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Recently Played Widget */
.recently-played-widget {
    margin-top: 1.5rem;
}

.widget-toggle {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--white);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.widget-toggle:hover {
    background: var(--mint);
}

.widget-toggle.expanded .toggle-icon {
    transform: rotate(180deg);
}

.widget-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--charcoal);
}

.toggle-icon {
    transition: transform 0.3s ease;
    color: var(--teal);
}

.widget-content {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
}

.widget-content:not(.hidden) {
    max-height: 500px;
    opacity: 1;
    padding-top: 1rem;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--white);
    border-radius: 10px;
    transition: background 0.2s ease;
}

.history-item:hover {
    background: var(--mint);
}

.history-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--teal);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.history-track {
    flex-grow: 1;
    min-width: 0;
}

.history-title {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--charcoal);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-artist {
    font-size: 0.8rem;
    color: var(--teal);
    margin-top: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.loading-message,
.no-history {
    text-align: center;
    padding: 1.5rem;
    color: var(--charcoal);
    opacity: 0.6;
    font-size: 0.9rem;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
