/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --hot-color: #ff6b6b;
    --cold-color: #4ecdc4;
    --skip-color: #95a5a6;
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --background-dark: #1a1a2e;
    --background-card: #16213e;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --danger-color: #e74c3c;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, var(--background-dark) 0%, #0f0f23 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* App Container */
.app-container {
    max-width: 420px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    padding: 20px 0;
}

.header h1 {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--hot-color), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 5px;
}

/* Progress Bar */
.progress-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--cold-color), var(--primary-color), var(--hot-color));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Card Container */
.card-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
    min-height: 400px;
}

/* Loading State */
.loading-state {
    text-align: center;
    color: var(--text-secondary);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Song Card */
.song-card {
    width: 100%;
    max-width: 350px;
    background: var(--background-card);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.song-card.swipe-left {
    animation: swipeLeft 0.4s ease forwards;
}

.song-card.swipe-right {
    animation: swipeRight 0.4s ease forwards;
}

.song-card.swipe-up {
    animation: swipeUp 0.3s ease forwards;
}

@keyframes swipeLeft {
    to {
        transform: translateX(-150%) rotate(-20deg);
        opacity: 0;
    }
}

@keyframes swipeRight {
    to {
        transform: translateX(150%) rotate(20deg);
        opacity: 0;
    }
}

@keyframes swipeUp {
    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

.card-image {
    position: relative;
    width: 100%;
    padding-top: 100%;
    background: #2a2a4a;
}

.card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(transparent, rgba(22, 33, 62, 0.9));
}

.card-info {
    padding: 20px;
}

.song-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.artist-name {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 3px;
}

.album-name {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Streaming Links */
.streaming-links {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.listen-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-right: 4px;
}

.stream-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.stream-link:hover {
    transform: scale(1.15);
}

.stream-link.spotify:hover {
    background: #1DB954;
    color: white;
}

.stream-link.apple:hover {
    background: linear-gradient(135deg, #FA233B, #FB5C74);
    color: white;
}

.stream-link.youtube:hover {
    background: #FF0000;
    color: white;
}

.stream-link.deezer:hover {
    background: linear-gradient(135deg, #FF0092, #A238FF);
    color: white;
}

.stream-link svg {
    width: 16px;
    height: 16px;
}

/* Audio Player */
.audio-player {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.2);
}

.play-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: transform 0.2s, background 0.2s;
}

.play-btn:hover {
    transform: scale(1.1);
    background: var(--secondary-color);
}

.audio-progress {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
}

.audio-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--primary-color);
    border-radius: 3px;
    transition: width 0.1s linear;
}

.audio-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Feedback Buttons */
.feedback-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 30px 0;
}

.feedback-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.feedback-btn:hover {
    transform: scale(1.1);
}

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

.btn-icon {
    font-size: 24px;
}

.btn-label {
    font-size: 0.7rem;
    margin-top: 2px;
    font-weight: 500;
}

.cold-btn {
    background: linear-gradient(135deg, var(--cold-color), #26a69a);
    color: white;
}

.cold-btn:hover {
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
}

.skip-btn {
    background: linear-gradient(135deg, var(--skip-color), #7f8c8d);
    color: white;
    width: 55px;
    height: 55px;
}

.skip-btn .btn-icon {
    font-size: 18px;
}

.hot-btn {
    background: linear-gradient(135deg, var(--hot-color), #ee5a5a);
    color: white;
}

.hot-btn:hover {
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

/* Results Screen */
.results-screen {
    text-align: center;
    padding: 20px;
    width: 100%;
}

.results-screen h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--hot-color), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.results-screen > p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.top-songs {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
}

.top-song-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--background-card);
    padding: 10px;
    border-radius: 12px;
    text-align: left;
}

.top-song-item img {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
}

.top-song-info {
    flex: 1;
    overflow: hidden;
}

.top-song-info .title {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-song-info .artist {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.top-song-rank {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    width: 30px;
}

.top-song-links {
    display: flex;
    gap: 8px;
}

.mini-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.mini-link:hover {
    transform: scale(1.1);
}

.mini-link.spotify:hover {
    background: #1DB954;
    color: white;
}

.mini-link.youtube:hover {
    background: #FF0000;
    color: white;
}

/* Error State */
.error-state {
    text-align: center;
}

.error-message {
    color: var(--danger-color);
    margin-bottom: 15px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border-radius: 25px;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

.btn:hover {
    opacity: 0.9;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

/* Footer */
.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.reset-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: color 0.2s;
}

.reset-btn:hover {
    color: var(--danger-color);
}

.interaction-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: var(--background-card);
    padding: 30px;
    border-radius: 20px;
    max-width: 350px;
    text-align: center;
}

.modal-content h3 {
    margin-bottom: 10px;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 25px;
    font-size: 0.9rem;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Onboarding Screen */
.onboarding-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--background-dark) 0%, #0f0f23 100%);
}

.onboarding-container {
    max-width: 500px;
    width: 100%;
    text-align: center;
}

.onboarding-container h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--hot-color), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.onboarding-subtitle {
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.onboarding-step {
    animation: fadeIn 0.3s ease;
}

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

.onboarding-step h2 {
    font-size: 1.4rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.step-hint {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 30px;
}

.chip {
    padding: 10px 18px;
    border-radius: 25px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chip:hover {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
}

.chip.selected {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.onboarding-nav {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Micro-Feedback Modal */
.micro-feedback-modal .modal-content {
    max-width: 400px;
}

.feedback-content h3 {
    font-size: 1.3rem;
}

.feedback-content p {
    margin-bottom: 20px;
}

.feedback-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 25px;
}

.feedback-chip {
    padding: 8px 14px;
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.feedback-chip:hover {
    border-color: var(--primary-color);
}

.feedback-chip.selected {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

/* Hot feedback specific */
#hotFeedbackModal .feedback-chip.selected {
    border-color: var(--hot-color);
    background: var(--hot-color);
}

/* Cold feedback specific */
#coldFeedbackModal .feedback-chip.selected {
    border-color: var(--cold-color);
    background: var(--cold-color);
}

/* Responsive */
@media (max-width: 420px) {
    .app-container {
        padding: 15px;
    }

    .header h1 {
        font-size: 1.7rem;
    }

    .song-card {
        max-width: 100%;
    }

    .feedback-btn {
        width: 60px;
        height: 60px;
    }

    .skip-btn {
        width: 48px;
        height: 48px;
    }
}

/* Keyboard focus styles */
.feedback-btn:focus,
.btn:focus,
.play-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Disabled state */
.feedback-btn:disabled,
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}
