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

:root {
    --primary: #1db954;
    --primary-dark: #1aa34a;
    --secondary: #191414;
    --text: #ffffff;
    --text-secondary: #b3b3b3;
    --bg: #121212;
    --bg-elevated: #1a1a1a;
    --bg-card: #282828;
    --border: #404040;
    --error: #e74c3c;
    --success: #2ecc71;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    gap: 1rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.screen {
    min-height: 100vh;
}

/* Hero Section */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--secondary) 0%, #1db954 100%);
    padding: 2rem;
}

.hero-content {
    text-align: center;
    max-width: 600px;
}

.logo {
    font-size: 4rem;
    margin-bottom: 1rem;
    font-weight: bold;
}

.logo i {
    color: var(--primary);
}

.tagline {
    font-size: 1.5rem;
    margin-bottom: 3rem;
    color: var(--text-secondary);
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 500px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary);
    color: var(--secondary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.2rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn svg {
    width: 24px;
    height: 24px;
}

.privacy-note {
    margin-top: 2rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Header */
.header {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-small {
    font-size: 1.5rem;
    font-weight: bold;
}

.logo-small i {
    color: var(--primary);
}

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

.header-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
    margin-right: 1rem;
}

.header-profile-image {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
    display: none;
}

.header-profile-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.nav-link {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--text);
    background: var(--bg-card);
}

.nav-link.active {
    color: var(--text);
    background: var(--bg-card);
}

/* Main Content */
.main-content {
    padding: 2rem 0;
    min-height: calc(100vh - 80px);
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.view-header h2 {
    font-size: 2rem;
}

/* Events Grid */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.event-card {
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s;
    cursor: pointer;
}

.event-card:hover {
    transform: translateY(-4px);
}

.event-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--border);
}

.event-content {
    padding: 1.5rem;
}

.event-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.event-artists {
    color: var(--primary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.event-details {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.event-venue, .event-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.event-score {
    display: inline-block;
    background: var(--primary);
    color: var(--secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.event-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    font-size: 1.2rem;
}

/* Profile */
.top-artists {
    margin-top: 0;
}

.time-range-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.time-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.time-btn:hover {
    background: var(--border);
}

.time-btn.active {
    background: var(--primary);
    color: var(--secondary);
    border-color: var(--primary);
}

.artists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.artist-card {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    transition: transform 0.2s;
    position: relative;
}

.artist-card:hover {
    transform: translateY(-4px);
}

.artist-card.has-events {
    border: 2px solid var(--primary);
}

.artist-event-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--primary);
    color: var(--secondary);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(29, 185, 84, 0.4);
}

.artist-image {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 0.5rem;
    background: var(--border);
}

.artist-name {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.artist-genres {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    min-width: 300px;
    animation: slideIn 0.3s ease-out;
}

.toast.success {
    border-color: var(--success);
}

.toast.error {
    border-color: var(--error);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }

    .header-profile {
        margin-left: 0;
        margin-right: 0;
        order: -1;
        width: 100%;
        justify-content: center;
    }

    .view-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .events-grid {
        grid-template-columns: 1fr;
    }

    .artists-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    #toast-container {
        right: 1rem;
        left: 1rem;
        bottom: 1rem;
    }

    .toast {
        min-width: auto;
    }
}

/* Filters Bar */
.filters-bar {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.filter-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.toggle-container {
    display: flex;
    gap: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
}

.toggle-btn {
    background: transparent;
    border: none;
    color: var(--text);
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    border-right: 1px solid var(--border);
    white-space: nowrap;
}

.toggle-btn:last-child {
    border-right: none;
}

.toggle-btn:hover {
    background: var(--border);
}

.toggle-btn.active {
    background: var(--primary);
    color: var(--secondary);
}

/* Show Cards (grouped by artist) */
.show-card {
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s;
}

.show-card:hover {
    transform: translateY(-4px);
}

.show-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--border);
}

.show-content {
    padding: 1.5rem;
}

.show-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.show-score {
    display: inline-block;
    background: var(--primary);
    color: var(--secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.show-thumbs {
    display: flex;
    gap: 0.5rem;
}

.thumb-btn {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumb-btn:hover {
    background: var(--border);
    color: var(--text);
}

.thumb-up.active {
    background: var(--primary);
    color: var(--secondary);
    border-color: var(--primary);
}

.thumb-down.active {
    background: var(--error);
    color: var(--text);
    border-color: var(--error);
}

.thumbs-down-show {
    opacity: 0.6;
    border: 2px solid var(--error);
}

.show-thumbs-btn {
    margin-left: auto;
    white-space: nowrap;
}

.show-thumbs-btn.active {
    background: var(--primary);
    color: var(--secondary);
}

.show-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.show-tour-name {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* Show Dates Section */
.show-dates-section {
    margin-top: 1.5rem;
}

.dates-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.show-date {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s;
}

.show-date:hover {
    border-color: var(--primary);
    background: var(--bg-elevated);
}

/* Nearby dates - bigger and bolder */
.nearby-date {
    border: 2px solid var(--primary);
    background: var(--bg-elevated);
    padding: 1.25rem;
}

.nearby-date .date-when {
    font-size: 1.1rem;
    font-weight: 700;
}

.nearby-date .date-where {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
}

.date-info {
    flex: 1;
}

.date-main {
    display: flex;
    gap: 0.75rem;
    align-items: baseline;
    margin-bottom: 0.25rem;
    flex-wrap: wrap;
}

.date-when {
    font-weight: 600;
    font-size: 0.95rem;
}

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

.date-venue {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.event-source {
    font-size: 0.65rem;
    color: var(--text-secondary);
    opacity: 0.5;
    font-style: italic;
    margin-left: 0.5rem;
}

.date-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

.date-price {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.9rem;
    min-width: 70px;
    text-align: right;
}

/* Responsive updates */
@media (max-width: 768px) {
    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }

    .toggle-container {
        width: 100%;
    }

    .toggle-btn {
        flex: 1;
        text-align: center;
    }

    .show-date {
        flex-direction: column;
        align-items: stretch;
    }

    .date-main {
        flex-direction: column;
        gap: 0.25rem;
    }

    .date-actions {
        justify-content: space-between;
        margin-top: 0.75rem;
    }
}


/* Artist Modal */
.artist-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.artist-modal-content {
    background: var(--bg-elevated);
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.artist-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.artist-modal-header h2 {
    font-size: 1.5rem;
    margin: 0;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s;
}

.modal-close-btn:hover {
    color: var(--primary);
}

.artist-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.artist-event-item {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
}

.artist-event-item:last-child {
    margin-bottom: 0;
}

.artist-event-info h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.artist-event-date,
.artist-event-venue,
.artist-event-lineup {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.artist-event-date i,
.artist-event-venue i,
.artist-event-lineup i {
    color: var(--primary);
    width: 16px;
}

.artist-event-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.event-price {
    font-weight: 600;
    color: var(--primary);
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .artist-modal-content {
        max-height: 95vh;
    }

    .artist-modal-header h2 {
        font-size: 1.2rem;
    }

    .artist-event-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .artist-event-actions .btn {
        width: 100%;
    }
}

/* Progress Widget (Corner) */
.progress-modal {
    display: none;
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 10000;
}

.progress-modal-content {
    background: var(--bg-card);
    padding: 1.25rem;
    border-radius: 12px;
    width: 320px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
    border: 1px solid var(--border);
}

.progress-modal-content h3 {
    margin-bottom: 1rem;
    color: var(--primary);
    font-size: 1rem;
    font-weight: 600;
}

.progress-info {
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-artist {
    font-size: 1rem;
    color: var(--text);
    font-weight: 500;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.progress-counter {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-left: 1rem;
    white-space: nowrap;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    transition: width 0.3s ease;
    width: 0%;
}

@media (max-width: 768px) {
    .progress-modal-content {
        min-width: auto;
        width: 90%;
        padding: 1.5rem;
    }

    .progress-artist {
        font-size: 0.9rem;
    }
}

.loading-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
}
