/**
 * Hauptstyles für musik.lauritzwiebusch.de
 * Spotify-inspiriertes dunkles Design, mobile-first
 */

/* Reset und Grundeinstellungen */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(180deg, #191414 0%, #121212 100%);
    color: #ffffff;
    min-height: 100vh;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #282828;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-item {
    flex: 1;
    display: flex;
    align-items: center;
}

.nav-item.center {
    justify-content: center;
}

.nav-item.right {
    justify-content: flex-end;
}

.home-icon {
    color: #1DB954;
    font-size: 1.5rem;
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 4px;
    padding: 0.25rem;
}

.home-icon:hover {
    transform: scale(1.1);
    filter: brightness(1.2);
    background: rgba(29, 185, 84, 0.1);
}

.spotify-logo {
    width: 32px;
    height: 32px;
    transition: transform 0.2s ease;
}

.spotify-logo:hover {
    transform: scale(1.05);
}

.profile-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #1DB954;
    transition: all 0.2s ease;
    cursor: pointer;
    object-fit: cover;
}

.profile-img:hover {
    border-color: #1ed760;
    transform: scale(1.05);
    box-shadow: 0 0 0 3px rgba(29, 185, 84, 0.2);
}

/* Main Content */
.main-content {
    max-width: 400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    flex: 1;
}

/* Alert Messages */
.alert {
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    width: 100%;
    text-align: center;
    font-weight: 500;
}

.alert.success {
    background: rgba(29, 185, 84, 0.2);
    border: 1px solid #1DB954;
    color: #1ed760;
}

.alert.error {
    background: rgba(229, 62, 62, 0.2);
    border: 1px solid #e53e3e;
    color: #fc8181;
}

/* Auth Section */
.auth-section {
    background: linear-gradient(135deg, #282828 0%, #181818 100%);
    border-radius: 20px;
    padding: 2rem;
    width: 100%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
}

.auth-section h2 {
    margin-bottom: 1rem;
    color: #1DB954;
    font-size: 1.5rem;
}

.auth-section p {
    color: #b3b3b3;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.auth-info {
    margin-top: 1rem;
}

.auth-info small {
    color: #888;
    font-size: 0.8rem;
}

.auth-button {
    background: linear-gradient(135deg, #1DB954 0%, #1ed760 100%);
    color: #ffffff;
    border: none;
    border-radius: 25px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 16px rgba(29, 185, 84, 0.3);
    position: relative;
    overflow: hidden;
}

.auth-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(29, 185, 84, 0.4);
}

.auth-button:active {
    transform: translateY(0);
}

/* Now Playing Card */
.now-playing {
    background: linear-gradient(135deg, #282828 0%, #181818 100%);
    border-radius: 20px;
    padding: 2rem;
    width: 100%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
    position: relative;
}

.album-cover {
    width: 200px;
    height: 200px;
    border-radius: 12px;
    margin: 0 auto 1.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    background: linear-gradient(45deg, #1DB954, #1ed760);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background-size: cover;
    background-position: center;
    transition: transform 0.2s ease;
    position: relative;
    overflow: hidden;
}

.album-cover:hover {
    transform: scale(1.02);
}

.album-cover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.album-cover:hover::after {
    opacity: 1;
}

.track-info h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.track-info p {
    color: #b3b3b3;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

/* Progress Bar */
.progress-container {
    width: 100%;
    margin-bottom: 1.5rem;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: #404040;
    border-radius: 2px;
    overflow: hidden;
    margin: 0.5rem 0;
    cursor: pointer;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1DB954, #1ed760);
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s ease;
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #b3b3b3;
    font-variant-numeric: tabular-nums;
}

/* Control Buttons - Modern Player Style */
.controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.control-btn {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    position: relative;
}

.control-btn:hover:not(:disabled) {
    color: #1DB954;
    transform: scale(1.1);
    background: rgba(29, 185, 84, 0.1);
}

.control-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.control-btn.loading {
    opacity: 0.6;
    pointer-events: none;
}

.control-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid #1DB954;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.play-pause-btn {
    background: linear-gradient(135deg, #1DB954, #1ed760);
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(29, 185, 84, 0.3);
}

.play-pause-btn:hover {
    background: linear-gradient(135deg, #1ed760, #22f662);
    color: #ffffff;
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(29, 185, 84, 0.4);
}

.play-pause-btn.loading {
    background: linear-gradient(135deg, #1DB954, #1ed760);
    opacity: 0.8;
}

/* Player Icons using CSS */
.icon-previous::before {
    content: '';
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 12px 8px 0;
    border-color: transparent currentColor transparent transparent;
    margin-right: 2px;
}

.icon-previous::after {
    content: '';
    width: 2px;
    height: 16px;
    background: currentColor;
    position: absolute;
    left: 12px;
}

.icon-next::before {
    content: '';
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 0 8px 12px;
    border-color: transparent transparent transparent currentColor;
    margin-left: 2px;
}

.icon-next::after {
    content: '';
    width: 2px;
    height: 16px;
    background: currentColor;
    position: absolute;
    right: 12px;
}

.icon-play::before {
    content: '';
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 16px;
    border-color: transparent transparent transparent currentColor;
    margin-left: 3px;
}

.icon-pause::before {
    content: '';
    width: 4px;
    height: 18px;
    background: currentColor;
    box-shadow: 6px 0 0 currentColor;
    margin-left: 1px;
}

/* Next Track Preview */
.next-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.next-track:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(29, 185, 84, 0.3);
}

.next-track-cover {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: linear-gradient(45deg, #404040, #606060);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.next-track-info {
    flex: 1;
    text-align: left;
}

.next-track-info h4 {
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
    color: #ffffff;
    font-weight: 600;
}

.next-track-info p {
    font-size: 0.8rem;
    color: #b3b3b3;
    margin: 0;
}

.next-label {
    font-size: 0.7rem;
    color: #1DB954;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 0.2rem;
}

/* Big Party Controls - Enhanced */
.big-controls {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 1rem;
    margin: 2rem 0;
}

.big-control-btn {
    background: rgba(29, 185, 84, 0.1);
    border: 2px solid rgba(29, 185, 84, 0.3);
    border-radius: 20px;
    padding: 1.5rem;
    color: #1DB954;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    position: relative;
}

.big-control-btn:hover:not(:disabled) {
    background: rgba(29, 185, 84, 0.2);
    border-color: rgba(29, 185, 84, 0.5);
    transform: scale(1.02);
}

.big-control-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.big-control-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

.big-control-btn.loading::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    border: 3px solid transparent;
    border-top: 3px solid #1DB954;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.big-play-btn {
    background: linear-gradient(135deg, #1DB954, #1ed760);
    border-color: #1DB954;
    color: white;
}

.big-play-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #1ed760, #22f662);
    transform: scale(1.05);
}

.big-play-btn.loading::after {
    border-top-color: white;
}

/* Big control icons */
.big-icon-previous {
    font-size: 2rem;
    position: relative;
}

.big-icon-previous::before {
    content: '';
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 12px 18px 12px 0;
    border-color: transparent currentColor transparent transparent;
    margin-right: 3px;
}

.big-icon-previous::after {
    content: '';
    width: 3px;
    height: 24px;
    background: currentColor;
    position: absolute;
    left: -2px;
    top: 50%;
    transform: translateY(-50%);
}

.big-icon-next {
    font-size: 2rem;
    position: relative;
}

.big-icon-next::before {
    content: '';
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 12px 0 12px 18px;
    border-color: transparent transparent transparent currentColor;
    margin-left: 3px;
}

.big-icon-next::after {
    content: '';
    width: 3px;
    height: 24px;
    background: currentColor;
    position: absolute;
    right: -2px;
    top: 50%;
    transform: translateY(-50%);
}

.big-icon-play {
    font-size: 3rem;
    position: relative;
}

.big-icon-play::before {
    content: '';
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 18px 0 18px 28px;
    border-color: transparent transparent transparent currentColor;
    margin-left: 4px;
}

.big-icon-pause {
    font-size: 3rem;
    position: relative;
}

.big-icon-pause::before {
    content: '';
    width: 8px;
    height: 32px;
    background: currentColor;
    box-shadow: 14px 0 0 currentColor;
}

/* Divider */
.divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #404040, transparent);
    margin: 1rem 0;
}

/* Jam Section */
.jam-section {
    text-align: center;
    width: 100%;
}

.jam-text {
    color: #b3b3b3;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.jam-button {
    background: linear-gradient(135deg, #1DB954 0%, #1ed760 100%);
    color: #ffffff;
    border: none;
    border-radius: 25px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 16px rgba(29, 185, 84, 0.3);
}

.jam-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(29, 185, 84, 0.4);
}

/* User Controls */
.user-controls {
    text-align: center;
    width: 100%;
    margin-top: 1rem;
}

.logout-link {
    color: #b3b3b3;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

.logout-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

/* Footer */
.footer {
    margin-top: auto;
    padding: 2rem 1.5rem 1rem;
    text-align: center;
    border-top: 1px solid #282828;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: #b3b3b3;
    text-decoration: none;
    transition: color 0.2s ease;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.footer-links a:hover {
    color: #1DB954;
    background: rgba(29, 185, 84, 0.1);
}

.footer-credit {
    margin-top: 0.5rem;
}

.footer-credit small {
    color: #666;
    font-size: 0.7rem;
}

/* Loading States */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #b3b3b3;
    flex-direction: column;
    gap: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #404040;
    border-top: 3px solid #1DB954;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.no-music {
    margin-top: 1rem;
    text-align: center;
}

.no-music p {
    color: #888;
    font-size: 0.9rem;
    font-style: italic;
}

/* Party Header */
.party-header {
    text-align: center;
    margin-bottom: 2rem;
}

.party-header h1 {
    color: #1DB954;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.party-header p {
    color: #b3b3b3;
    font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 480px) {
    .main-content {
        padding: 1.5rem 1rem;
        gap: 1.5rem;
    }

    .now-playing, 
    .auth-section {
        padding: 1.5rem;
    }

    .album-cover {
        width: 180px;
        height: 180px;
        font-size: 2.5rem;
    }

    .controls {
        gap: 1rem;
    }
    
    .control-btn {
        width: 40px;
        height: 40px;
    }
    
    .play-pause-btn {
        width: 52px;
        height: 52px;
    }

    .big-controls {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .big-control-btn {
        min-height: 60px;
    }
    
    .big-icon-play,
    .big-icon-pause {
        font-size: 2rem;
    }
    
    .big-icon-play::before {
        border-width: 14px 0 14px 22px;
    }
    
    .big-icon-pause::before {
        width: 6px;
        height: 24px;
        box-shadow: 10px 0 0 currentColor;
    }

    .navbar {
        padding: 0.75rem 1rem;
    }

    .track-info h2 {
        font-size: 1.2rem;
    }

    .footer-links {
        gap: 1rem;
        flex-direction: row;
        flex-wrap: wrap;
    }
}

@media (max-width: 360px) {
    .album-cover {
        width: 160px;
        height: 160px;
    }

    .main-content {
        padding: 1rem 0.75rem;
    }

    .navbar {
        padding: 0.5rem 0.75rem;
    }
    
    .big-control-btn {
        min-height: 50px;
        padding: 1rem;
    }
}

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

@media (prefers-color-scheme: light) {
    .auth-section p,
    .jam-text,
    .track-info p {
        color: #a0a0a0;
    }
}

/* Focus states für Barrierefreiheit */
.control-btn:focus,
.jam-button:focus,
.auth-button:focus,
.home-icon:focus,
.profile-img:focus,
.logout-link:focus {
    outline: 2px solid #1DB954;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .now-playing,
    .auth-section {
        border: 2px solid #1DB954;
    }
    
    .progress-bar {
        border: 1px solid #666;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .control-btn {
        width: 48px;
        height: 48px;
    }
    
    .play-pause-btn {
        width: 60px;
        height: 60px;
    }
    
    .big-control-btn {
        min-height: 70px;
        padding: 1.2rem;
    }
    
    .icon-previous,
    .icon-next,
    .icon-play,
    .icon-pause {
        display: block;
        width: 24px;
        height: 24px;
    }
    
    .big-icon-previous,
    .big-icon-next,
    .big-icon-play,
    .big-icon-pause {
        display: block;
        width: 40px;
        height: 40px;
    }
}