/**
 * AI Music Player - Frontend CSS
 * Responsive Design für alle Player-Größen
 */

/* === BASE STYLES === */
.aimp-player-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    box-sizing: border-box;
}

.aimp-player-container *,
.aimp-player-container *::before,
.aimp-player-container *::after {
    box-sizing: border-box;
}

.aimp-player {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    color: #ffffff;
    overflow: hidden;
}

.aimp-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.aimp-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.aimp-btn:active {
    transform: scale(0.95);
}

/* === FULL PLAYER === */
.aimp-player-full {
    max-width: 600px;
    margin: 0 auto;
    padding: 24px;
}

.aimp-player-header {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
}

.aimp-cover-art {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
}

.aimp-cover-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.aimp-track-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.aimp-track-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.2;
}

.aimp-track-artist {
    font-size: 16px;
    opacity: 0.8;
}

.aimp-player-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.aimp-player-controls .aimp-play-btn,
.aimp-player-controls .aimp-pause-btn {
    width: 56px;
    height: 56px;
}

.aimp-progress-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.aimp-current-time,
.aimp-duration {
    font-size: 12px;
    font-weight: 500;
    min-width: 40px;
}

.aimp-progress {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
}

.aimp-progress-bar {
    height: 100%;
    background: #ffffff;
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
}

.aimp-volume-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.aimp-volume-slider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    outline: none;
}

.aimp-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
}

.aimp-volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    border: none;
}

/* === PLAYLIST === */
.aimp-playlist {
    margin-top: 24px;
    max-height: 300px;
    overflow-y: auto;
}

.aimp-playlist-header {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.aimp-playlist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.aimp-playlist-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.aimp-playlist-item.active {
    background: rgba(255, 255, 255, 0.15);
}

.aimp-playlist-track-number {
    font-size: 14px;
    font-weight: 600;
    min-width: 24px;
    opacity: 0.6;
}

.aimp-playlist-track-info {
    flex: 1;
}

.aimp-playlist-track-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.aimp-playlist-track-artist {
    font-size: 12px;
    opacity: 0.7;
}

.aimp-playlist-track-duration {
    font-size: 12px;
    opacity: 0.6;
}

/* === COMPACT PLAYER === */
.aimp-player-compact {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    max-width: 500px;
}

.aimp-player-compact .aimp-cover-art {
    width: 60px;
    height: 60px;
}

.aimp-player-compact .aimp-track-info {
    flex: 1;
    min-width: 0;
}

.aimp-player-compact .aimp-track-title {
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aimp-player-compact .aimp-track-artist {
    font-size: 13px;
}

.aimp-controls-compact {
    display: flex;
    gap: 8px;
}

.aimp-player-compact .aimp-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 0;
}

/* === MINI PLAYER === */
.aimp-player-mini {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    height: 60px;
    width: 100%;
    position: relative;
}

.aimp-player-mini .aimp-btn {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.aimp-player-mini .aimp-track-info {
    flex: 1;
    min-width: 0;
}

.aimp-player-mini .aimp-track-title {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.aimp-player-mini .aimp-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.15);
}

.aimp-player-mini .aimp-volume-container {
    flex-shrink: 0;
    width: 80px;
    margin: 0;
}

.aimp-player-mini .aimp-volume-slider {
    height: 4px;
}

/* === FLOATING PLAYER === */
.aimp-player-floating {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 280px;
    padding: 16px;
    z-index: 9999;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.aimp-close-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.3);
    border: none;
    color: #ffffff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aimp-close-btn:hover {
    background: rgba(0, 0, 0, 0.5);
}

.aimp-mini-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* === STICKY HEADER/FOOTER === */
.aimp-sticky-top {
    position: sticky;
    top: 0;
    z-index: 1000;
}

.aimp-sticky-bottom {
    position: sticky;
    bottom: 0;
    z-index: 1000;
}

/* === ERROR MESSAGES === */
.aimp-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 59, 48, 0.95);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
}

/* === LOADING STATE === */
.aimp-loading {
    position: relative;
}

.aimp-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .aimp-player-full {
        padding: 16px;
    }
    
    .aimp-player-header {
        flex-direction: column;
        text-align: center;
    }
    
    .aimp-cover-art {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
        max-width: 200px;
        margin: 0 auto;
    }
    
    .aimp-track-title {
        font-size: 20px;
    }
    
    .aimp-player-floating {
        width: 240px;
        bottom: 10px;
        right: 10px;
    }
}

@media (max-width: 480px) {
    .aimp-player-compact {
        padding: 12px;
    }
    
    .aimp-player-compact .aimp-cover-art {
        width: 48px;
        height: 48px;
    }
    
    .aimp-player-mini {
        padding: 8px 12px;
    }
    
    .aimp-player-mini .aimp-volume-container {
        display: none;
    }
}

/* === SCROLLBAR STYLING === */
.aimp-playlist::-webkit-scrollbar {
    width: 8px;
}

.aimp-playlist::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.aimp-playlist::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.aimp-playlist::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* === ANIMATIONS === */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.aimp-playing .aimp-track-title {
    animation: pulse 2s ease-in-out infinite;
}

/* === DARK MODE SUPPORT === */
@media (prefers-color-scheme: dark) {
    .aimp-player {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    }
}

/* === CUSTOM SCROLLBAR FOR WEBKIT === */
.aimp-player *::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.aimp-player *::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.aimp-player *::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.aimp-player *::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}