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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1db954 0%, #1ed760 100%);
    min-height: 100vh;
    color: #fff;
}

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

header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

#form-section {
    background: rgba(255,255,255,0.1);
    padding: 40px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 30px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 1.1rem;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.15);
}

.form-group input[type="text"]::placeholder {
    color: rgba(255,255,255,0.6);
}

.form-group input[type="text"].error {
    border-color: #ff4444;
    background: rgba(255,68,68,0.1);
}

.spotify-button {
    background: #000;
    color: #fff;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    width: 100%;
}

.spotify-button:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.success-indicator {
    color: #00ff88;
    font-weight: 500;
    padding: 10px;
    text-align: center;
    background: rgba(0,255,136,0.1);
    border-radius: 8px;
    border: 1px solid rgba(0,255,136,0.2);
}

fieldset {
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    padding: 20px;
    background: rgba(255,255,255,0.05);
}

legend {
    padding: 0 10px;
    font-weight: 500;
    color: rgba(255,255,255,0.9);
}

.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.radio-label:hover {
    color: rgba(255,255,255,1);
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #1db954;
}

.submit-button {
    background: #fff;
    color: #1db954;
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    width: 100%;
}

.submit-button:hover:not(:disabled) {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.submit-button:disabled {
    background: rgba(255,255,255,0.3);
    color: rgba(255,255,255,0.6);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.error-message {
    color: #ff4444;
    font-size: 0.9rem;
    margin-top: 5px;
    padding: 8px 12px;
    background: rgba(255,68,68,0.1);
    border-radius: 6px;
    border: 1px solid rgba(255,68,68,0.3);
}

#success-section {
    background: rgba(255,255,255,0.1);
    padding: 40px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.success-content h2 {
    color: #00ff88;
    margin-bottom: 20px;
    font-size: 2rem;
}

.uuid-container {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 20px 0;
}

.uuid-display {
    background: rgba(0,0,0,0.3);
    padding: 15px;
    border-radius: 12px;
    font-family: monospace;
    font-size: 1.1rem;
    letter-spacing: 1px;
    border: 2px solid rgba(255,255,255,0.2);
    word-break: break-all;
    flex: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: all;
}

.uuid-display:hover,
.uuid-display:focus {
    border-color: rgba(255,255,255,0.4);
    background: rgba(0,0,0,0.4);
    outline: none;
}

.copy-button {
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 0;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.3s ease, border-color 0.3s ease;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.copy-button:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.4);
}

.success-message {
    font-size: 1.1rem;
    margin: 20px 0;
    opacity: 0.9;
}

.success-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.disconnect-link {
    color: rgba(255,255,255,0.7);
    text-decoration: underline;
    font-size: 0.9rem;
    transition: color 0.3s ease;
    display: block;
    margin-bottom: 15px;
}

.disconnect-link:hover {
    color: #fff;
}

.thread-link {
    color: rgba(255,255,255,0.9);
    text-decoration: underline;
    transition: color 0.3s ease;
}

.thread-link:hover {
    color: #fff;
}

.credit {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
    margin: 0;
}

.credit-link {
    color: rgba(255,255,255,0.7);
    text-decoration: underline;
    transition: color 0.3s ease;
}

.credit-link:hover {
    color: #fff;
}

.status-message {
    margin-top: 20px;
    font-size: 1rem;
    font-weight: 500;
}

.status-message.success {
    color: #00ff88;
}

.status-message.error {
    color: #ff4444;
}

#tracks-section {
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.timeframe-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.timeframe-btn {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    border: 2px solid transparent;
}

.timeframe-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.timeframe-btn.active {
    background: #fff;
    color: #1db954;
    border-color: #fff;
}

#tracks-container h2 {
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.8rem;
}

.loading {
    text-align: center;
    font-size: 1.1rem;
    padding: 20px;
    opacity: 0.8;
}

.error {
    background: rgba(255,68,68,0.2);
    color: #ff4444;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 20px;
    border: 1px solid rgba(255,68,68,0.3);
}

#tracks-list {
    display: grid;
    gap: 12px;
}

.track-item {
    display: grid;
    grid-template-columns: 40px 60px 1fr auto;
    gap: 15px;
    align-items: center;
    background: rgba(255,255,255,0.1);
    padding: 12px;
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.1);
}

.track-item:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

.track-rank {
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    opacity: 0.8;
}

.track-image {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
}

.track-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-image {
    font-size: 1.5rem;
    opacity: 0.6;
}

.track-info {
    min-width: 0;
}

.track-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-artist {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-album {
    font-size: 0.8rem;
    opacity: 0.6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spotify-link {
    color: #fff;
    text-decoration: none;
    font-size: 1.2rem;
    padding: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.spotify-link:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2.5rem;
    }
    
    .timeframe-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .timeframe-btn {
        width: 200px;
    }
    
    .track-item {
        grid-template-columns: 30px 50px 1fr auto;
        gap: 10px;
        padding: 10px;
    }
    
    .track-image {
        width: 40px;
        height: 40px;
    }
    
    .track-name {
        font-size: 0.9rem;
    }
    
    .track-artist {
        font-size: 0.8rem;
    }
    
    .track-album {
        font-size: 0.7rem;
    }
}