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

body {
    font-family: 'Proxima Nova', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #fafafa;
    padding: 20px 30px;
    overflow: hidden;
    height: 100vh;
    box-sizing: border-box;
}

/* Login Screen */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fafafa;
    z-index: 1000;
}

.login-container {
    text-align: center;
    animation: fadeIn 0.8s ease-out;
}

.login-title {
    font-size: 48px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.login-description {
    font-size: 16px;
    color: #666;
    margin-bottom: 40px;
    font-weight: 300;
}

.spotify-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background-color: #1a1a1a;
    color: white;
    border: none;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.spotify-login-btn:hover {
    background-color: #333;
}

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

.spotify-icon {
    width: 20px;
    height: 20px;
    fill: #1DB954;
}

/* Header */
.main-header {
    text-align: center;
    margin-bottom: 50px;
    animation: fadeIn 0.6s ease-out;
}

.main-title {
    font-size: 48px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 18px;
    font-weight: 300;
    margin-bottom: 20px;
    color: #666;
    font-style: italic;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 40px;
    align-items: flex-start;
    height: calc(100vh - 40px);
}

.grid-section {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.info-section {
    width: 260px;
    flex-shrink: 0;
    height: 100%;
    overflow-y: auto;
}

/* Time Range Selector */
.time-range-selector {
    background-color: white;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 15px;
    animation: fadeIn 0.6s ease-out;
}

.selector-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    font-family: 'Proxima Nova', sans-serif;
}

.time-range-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.time-range-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 14px;
    background: #f5f5f5;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.time-range-btn:hover {
    background: #ebebeb;
}

.time-range-btn.active {
    background: #1a1a1a;
    border-color: #1a1a1a;
}

.time-range-btn.active .range-label {
    color: white;
}

.time-range-btn.active .range-desc {
    color: rgba(255, 255, 255, 0.6);
}

.range-label {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 1px;
}

.range-desc {
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Actions Section */
.actions-section {
    margin-top: 15px;
}

.action-btn {
    width: 100%;
    padding: 12px 20px;
    background: #1a1a1a;
    border: none;
    border-radius: 4px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: #333;
}

/* User Section */
.user-section {
    margin-top: 10px;
    animation: fadeIn 1s ease-out;
}

.logout-btn {
    width: 100%;
    padding: 12px 20px;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
    color: #333;
}

/* Music Grid */
.music-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    background-color: transparent;
    animation: fadeIn 0.6s ease-out;
    flex: 1;
    height: 100%;
}

.year-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    flex: 1;
    min-height: 0;
    background-color: transparent;
}

/* Song Card - Flip Container */
.song-card {
    position: relative;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    perspective: 1000px;
    animation: slideIn 0.4s ease-out backwards;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.song-card:hover {
    transform: scale(1.15);
    z-index: 100 !important;
    filter: brightness(1.05);
}

.song-card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

/* Front and Back faces */
.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    border-radius: 0;
}

.card-front {
    background-color: var(--genre-color);
}

.card-back {
    background-color: #1a1a1a;
    color: white;
    transform: rotateY(180deg);
    flex-direction: column;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.song-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
    max-width: 90%;
    word-wrap: break-word;
}

.artist-name {
    font-size: 13px;
    font-weight: 300;
    opacity: 0.85;
    line-height: 1.3;
    max-width: 90%;
}

/* Genre Colors */
.indie {
    --genre-color: #D663A4;
    background-color: #D663A4;
}

.pop {
    --genre-color: #F9DC5C;
    background-color: #F9DC5C;
}

.rb-soul {
    --genre-color: #E76F51;
    background-color: #E76F51;
}

.hip-hop-rap {
    --genre-color: #6BBF59;
    background-color: #6BBF59;
}

.rock {
    --genre-color: #4A6FA5;
    background-color: #4A6FA5;
}

.others {
    --genre-color: #64748B;
    background-color: #64748B;
}

/* Legend */
.legend {
    background-color: white;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 15px;
    animation: fadeIn 0.8s ease-out;
}

.legend-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    font-family: 'Proxima Nova', sans-serif;
}

.legend-description {
    font-size: 12px;
    line-height: 1.4;
    color: #333;
    margin-bottom: 12px;
}

.genre-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.genre-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
}

.color-box {
    width: 32px;
    height: 20px;
    border-radius: 2px;
}

/* Select Prompt */
.select-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
    animation: fadeIn 0.6s ease-out;
}

.select-prompt h2 {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.select-prompt p {
    font-size: 16px;
    color: #666;
}

/* Loading State */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    font-size: 18px;
    color: #666;
    animation: pulse 1.5s ease-in-out infinite;
}

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

.error {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    font-size: 18px;
    color: #e74c3c;
}

/* Year Labels */
.year-labels {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.year-label {
    height: 140px;
    display: flex;
    align-items: center;
    font-size: 28px;
    font-weight: 300;
    font-style: italic;
    color: #333;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        flex-direction: column;
        gap: 40px;
    }
    
    .info-section {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 20px;
    }
    
    .time-range-selector {
        flex: 1;
        min-width: 280px;
    }
    
    .legend {
        flex: 1;
        min-width: 280px;
        margin-bottom: 0;
    }
    
    .user-section {
        width: 100%;
        margin-top: 0;
    }
    
    .year-labels {
        flex: 1;
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .year-label {
        height: auto;
        width: calc(50% - 10px);
        padding: 10px 0;
    }
}

@media (max-width: 768px) {
    body {
        padding: 20px 20px 40px;
    }
    
    .year-row {
        height: 100px;
    }
    
    .year-label {
        height: 100px;
    }
    
    .song-card:hover {
        transform: scale(1.1);
    }
    
    .login-title {
        font-size: 36px;
    }
    
    .login-description {
        font-size: 16px;
        padding: 0 20px;
    }
    
    .time-range-options {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .time-range-btn {
        flex: 1;
        min-width: 80px;
    }
}

/* Add smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Fade-in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Footer Instructions - Hidden to fit in one screen */
.instructions {
    display: none;
}

.instructions strong {
    color: #333;
}
