/**
 * Resonance - App Styles
 * Minimalist design system for 18-30 demographic
 */

/* ============================================
   CSS VARIABLES (matching landing page)
   ============================================ */
:root {
    --bg: #000000;
    --bg-elevated: #0a0a0a;
    --bg-card: #111111;
    --bg-hover: #1a1a1a;
    --border: #222222;
    --border-light: #333333;
    --text: #ffffff;
    --text-secondary: #888888;
    --text-tertiary: #555555;
    --accent: #c8ff00;
    --accent-dim: rgba(200, 255, 0, 0.1);
    --accent-hover: #d4ff33;
    --success: #22c55e;
    --error: #ef4444;
    --spotify: #1DB954;
    --apple: #fc3c44;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --radius: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
}

/* ============================================
   APP NAVIGATION (Logged In)
   ============================================ */
.app-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.nav-center {
    display: flex;
    gap: 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    position: relative;
}

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

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

.nav-item .badge {
    position: absolute;
    top: 0.15rem;
    right: 0.15rem;
    background: var(--accent);
    color: var(--bg);
    font-size: 0.65rem;
    padding: 0.1rem 0.35rem;
    border-radius: var(--radius-full);
    font-weight: 700;
}

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

.nav-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-icon-btn:hover {
    background: var(--bg-hover);
    color: var(--text);
    border-color: var(--border-light);
}

.nav-avatar {
    text-decoration: none;
}

.avatar-ring {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    padding: 2px;
    background: var(--accent);
}

.avatar-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    font-weight: 600;
    font-size: 0.875rem;
}

/* ============================================
   SIGNUP PAGE
   ============================================ */
.signup-page {
    min-height: 100vh;
    padding: 5rem 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
}

.signup-container {
    max-width: 1000px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 4rem;
    align-items: center;
}

.signup-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
    line-height: 1.1;
}

.signup-header h1 em {
    font-style: normal;
    color: var(--accent);
}

.signup-header p {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.signup-steps {
    margin-top: 2.5rem;
}

.signup-step {
    display: flex;
    gap: 1rem;
    padding: 0.75rem 0;
    opacity: 0.4;
    transition: opacity 0.3s;
}

.signup-step.active {
    opacity: 1;
}

.signup-step.completed {
    opacity: 0.6;
}

.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s;
}

.signup-step.active .step-number {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
}

.signup-step.completed .step-number {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.step-line {
    width: 1px;
    flex: 1;
    min-height: 30px;
    background: var(--border);
    margin-top: 0.5rem;
}

.step-content h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.step-content p {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

/* Signup Card */
.signup-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
}

.signup-card-content {
    animation: fadeIn 0.3s ease;
}

.signup-card-content.hidden {
    display: none;
}

.signup-card h2 {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    letter-spacing: -0.01em;
}

.signup-subtitle {
    color: var(--text-secondary);
    margin-bottom: 1.75rem;
    font-size: 0.95rem;
}

.spotify-btn, .apple-music-btn {
    width: 100%;
    padding: 0.9rem 1.25rem;
    border-radius: var(--radius-full);
    border: none;
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    transition: all 0.2s;
}

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

.spotify-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

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

.apple-music-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.service-connected {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1.25rem;
    background: var(--bg-hover);
    border-radius: var(--radius-full);
    color: var(--text);
}

.service-connected .check-icon {
    color: var(--success);
    margin-left: auto;
}

.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading span {
    visibility: hidden;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.25rem 0;
    color: var(--text-tertiary);
    font-size: 0.8rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.signup-terms {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 1.25rem;
}

.signup-terms a {
    color: var(--text-secondary);
    text-decoration: none;
}

.signup-terms a:hover {
    color: var(--text);
}

/* Analysis Animation */
.analysis-animation {
    width: 120px;
    height: 120px;
    margin: 2rem auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.analysis-ring {
    position: absolute;
    inset: 0;
    border: 2px solid transparent;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1.2s linear infinite;
}

.analysis-icon {
    color: var(--accent);
}

.analysis-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.5rem;
}

.analysis-stat {
    text-align: center;
}

.stat-num {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* DNA Result */
.dna-result {
    margin: 1.5rem 0;
    display: flex;
    justify-content: center;
}

.top-traits {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.trait {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
}

/* Profile Form */
.profile-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 0.75rem 1rem;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-tertiary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1rem;
}

.char-count {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    text-align: right;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.checkbox-label:has(input:checked) {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}

.checkbox-label input {
    display: none;
}

.btn-full {
    width: 100%;
}

/* Age Verification */
.age-verification {
    margin: 1.5rem 0;
}

.age-input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
}

.dob-inputs {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 0.5rem;
}

.dob-select {
    padding: 0.75rem 1rem;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.95rem;
    outline: none;
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.dob-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.dob-select option {
    background: var(--bg-card);
    color: var(--text);
}

.age-error {
    color: var(--error);
    font-size: 0.85rem;
    text-align: center;
    padding: 0.6rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.age-error.hidden {
    display: none;
}

/* ============================================
   DISCOVER PAGE
   ============================================ */
.discover-page {
    padding: 5rem 1.5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.discover-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.discover-title h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.2rem;
}

.discover-title p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.discover-filters {
    display: flex;
    gap: 0.4rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
}

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

/* Profile Cards */
.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s;
    cursor: pointer;
}

.profile-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-light);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.card-header {
    position: relative;
    height: 160px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    overflow: hidden;
}

.card-sound-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    padding: 0 1rem;
}

.card-wave-bar {
    width: 2px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 2px;
    transition: height 0.3s;
}

.profile-card:hover .card-wave-bar {
    animation: wave 0.6s ease-in-out infinite;
}

@keyframes wave {
    0%, 100% { transform: scaleY(0.5); }
    50% { transform: scaleY(1); }
}

.compatibility-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.online-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--success);
}

.card-body {
    padding: 1.25rem;
}

.card-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.card-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    border: 2px solid var(--border);
}

.card-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.card-info p {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.card-artists {
    margin-bottom: 1rem;
}

.card-artists-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    margin-bottom: 0.4rem;
}

.card-artists-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.artist-tag {
    background: var(--bg-hover);
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.card-starter {
    background: var(--accent-dim);
    border: 1px solid rgba(200, 255, 0, 0.15);
    border-radius: var(--radius);
    padding: 0.85rem;
    margin-bottom: 1rem;
}

.card-starter-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.card-starter p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

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

.card-btn {
    flex: 1;
    padding: 0.65rem;
    border-radius: var(--radius);
    border: none;
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.card-btn-skip {
    background: var(--bg-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

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

.card-btn-like {
    background: var(--accent);
    color: var(--bg);
}

.card-btn-like:hover {
    background: var(--accent-hover);
    transform: scale(1.02);
}

/* Swipe Animations */
.card-swiping-left {
    animation: swipeLeft 0.4s ease forwards;
}

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

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

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

/* ============================================
   MATCHES PAGE
   ============================================ */
.matches-page {
    padding: 5rem 1.5rem 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.matches-header {
    text-align: center;
    margin-bottom: 2rem;
}

.matches-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.35rem;
}

.matches-header p {
    color: var(--text-secondary);
}

.matches-section {
    margin-bottom: 2rem;
}

.matches-section .section-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.matches-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.match-card {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.match-card:hover {
    background: var(--bg-hover);
    transform: translateX(4px);
}

.match-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text);
    position: relative;
}

.online-indicator {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 12px;
    height: 12px;
    background: var(--success);
    border: 2px solid var(--bg-card);
    border-radius: 50%;
}

.match-info {
    flex: 1;
}

.match-info h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.1rem;
}

.match-info p {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.match-action {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    color: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.match-action:hover {
    transform: scale(1.1);
}

/* Likes Preview */
.likes-preview {
    background: var(--accent-dim);
    border: 1px solid rgba(200, 255, 0, 0.15);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
}

.blurred-avatars {
    display: flex;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.blurred-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    filter: blur(6px);
    margin: 0 -6px;
    border: 2px solid var(--bg-card);
}

.likes-preview p {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

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

/* ============================================
   MESSAGES PAGE
   ============================================ */
.messages-page {
    display: flex;
    height: 100vh;
    padding-top: 54px;
}

.messages-sidebar {
    width: 360px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

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

.messages-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
}

.icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.conversation-list {
    flex: 1;
    overflow-y: auto;
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1.25rem;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.conversation-item:hover {
    background: var(--bg-hover);
}

.conversation-item.unread {
    background: var(--accent-dim);
}

.conv-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
    position: relative;
    flex-shrink: 0;
}

.conv-content {
    flex: 1;
    min-width: 0;
}

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

.conv-header h3 {
    font-size: 0.9rem;
    font-weight: 600;
}

.conv-time {
    font-size: 0.7rem;
    color: var(--text-tertiary);
}

.conv-preview {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.unread-badge {
    background: var(--accent);
    color: var(--bg);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-full);
    min-width: 18px;
    text-align: center;
}

/* Messages Main */
.messages-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

.no-conversation {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
}

.no-conv-icon {
    width: 80px;
    height: 80px;
    background: var(--bg-card);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.no-conversation h2 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

/* Chat */
.chat-header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1.25rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.chat-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    cursor: pointer;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--text);
    position: relative;
}

.chat-user-info h3 {
    font-size: 0.95rem;
    font-weight: 600;
}

.chat-user-info span {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.chat-actions {
    display: flex;
    gap: 0.35rem;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-date {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin: 0.75rem 0;
}

.message {
    max-width: 70%;
    display: flex;
    flex-direction: column;
}

.message.sent {
    align-self: flex-end;
}

.message.received {
    align-self: flex-start;
}

.message-bubble {
    padding: 0.65rem 0.9rem;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.message.sent .message-bubble {
    background: var(--accent);
    color: var(--bg);
    border-bottom-right-radius: 4px;
}

.message.received .message-bubble {
    background: var(--bg-card);
    color: var(--text);
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 0.65rem;
    color: var(--text-tertiary);
    margin-top: 0.2rem;
    padding: 0 0.4rem;
}

.message.sent .message-time {
    text-align: right;
}

/* Chat Input */
.chat-input-area {
    padding: 0.875rem 1.25rem;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
}

.chat-input-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-hover);
    border-radius: var(--radius-full);
    padding: 0.4rem 0.6rem;
}

.emoji-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.chat-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.9rem;
    outline: none;
}

.chat-input::placeholder {
    color: var(--text-tertiary);
}

.send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    color: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.send-btn:hover {
    transform: scale(1.05);
}

.quick-replies {
    display: flex;
    gap: 0.35rem;
    margin-top: 0.6rem;
    flex-wrap: wrap;
}

.quick-reply {
    padding: 0.35rem 0.65rem;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-reply:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
}

/* ============================================
   PROFILE PAGE
   ============================================ */
.profile-page {
    padding-top: 54px;
}

.profile-header-section {
    position: relative;
}

.profile-cover {
    height: 200px;
    position: relative;
    overflow: hidden;
}

.profile-cover-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    padding: 0 2rem;
    opacity: 0.4;
}

.profile-info-card {
    max-width: 800px;
    margin: -60px auto 0;
    padding: 0 1.5rem;
    display: flex;
    align-items: flex-end;
    gap: 1.25rem;
    position: relative;
    z-index: 1;
}

.profile-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: 4px solid var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.75rem;
    font-weight: 600;
    color: var(--text);
    flex-shrink: 0;
}

.profile-details {
    flex: 1;
    padding-bottom: 0.5rem;
}

.profile-details h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.2rem;
}

.profile-location {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
}

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

.profile-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.profile-section {
    margin-bottom: 2rem;
}

.profile-section h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.875rem;
}

/* DNA Card */
.dna-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2rem;
    align-items: center;
}

.music-dna {
    width: 160px;
    height: 160px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dna-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid;
    animation: rotate 30s linear infinite;
}

.dna-ring-1 {
    width: 100%;
    height: 100%;
    border-color: rgba(200, 255, 0, 0.2);
}

.dna-ring-2 {
    width: 75%;
    height: 75%;
    border-color: rgba(200, 255, 0, 0.15);
    animation-direction: reverse;
    animation-duration: 25s;
}

.dna-ring-3 {
    width: 50%;
    height: 50%;
    border-color: rgba(200, 255, 0, 0.1);
    animation-duration: 20s;
}

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

.dna-core {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--bg);
    box-shadow: 0 0 30px rgba(200, 255, 0, 0.3);
}

.dna-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.dna-stat {
    display: grid;
    grid-template-columns: 90px 1fr 45px;
    gap: 0.875rem;
    align-items: center;
}

.dna-stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.dna-stat-bar {
    height: 6px;
    background: var(--bg-hover);
    border-radius: 3px;
    overflow: hidden;
}

.dna-stat-fill {
    display: block;
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 1s ease;
}

.dna-stat-value {
    font-size: 0.85rem;
    font-weight: 600;
    text-align: right;
}

/* Artists Grid */
.artists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.artist-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.artist-rank {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.artist-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.artist-name {
    font-weight: 500;
    font-size: 0.9rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.75rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-weight: 600;
    font-size: 0.95rem;
}

.stat-info .stat-label {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

/* Settings List */
.settings-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.settings-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    text-align: left;
}

.settings-item:hover {
    background: var(--bg-hover);
}

.settings-item.danger {
    color: var(--error);
}

.settings-item .chevron {
    margin-left: auto;
    color: var(--text-tertiary);
}

/* ============================================
   MATCH NOTIFICATION
   ============================================ */
.match-notification {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
}

.match-notification.show {
    opacity: 1;
}

.match-notification-content {
    text-align: center;
    animation: scaleIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.match-hearts {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

.match-notification h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    color: var(--accent);
}

.match-notification p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.match-avatars {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.match-avatar-item {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text);
    border: 3px solid var(--bg);
}

.match-notification .btn {
    display: block;
    width: 100%;
    max-width: 260px;
    margin: 0 auto 0.6rem;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.875rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s;
    max-width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-error {
    border-color: rgba(239, 68, 68, 0.3);
}

.toast-success {
    border-color: rgba(34, 197, 94, 0.3);
}

.toast span {
    flex: 1;
    font-size: 0.9rem;
}

.toast button {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.toast button:hover {
    color: var(--text);
}

/* ============================================
   MOBILE BOTTOM NAVIGATION
   ============================================ */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 0.4rem 0 calc(0.4rem + env(safe-area-inset-bottom));
    z-index: 100;
}

.mobile-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.4rem 0.875rem;
    color: var(--text-tertiary);
    text-decoration: none;
    font-size: 0.65rem;
    transition: color 0.2s;
}

.mobile-nav-item.active {
    color: var(--accent);
}

.mobile-nav-item svg {
    width: 22px;
    height: 22px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 968px) {
    .signup-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .signup-left {
        text-align: center;
    }

    .signup-steps {
        display: none;
    }

    .nav-center {
        display: none;
    }

    .messages-page {
        flex-direction: column;
    }

    .messages-sidebar {
        width: 100%;
        height: auto;
        max-height: 35vh;
    }

    .profile-info-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-top: -50px;
    }

    .profile-avatar-large {
        width: 100px;
        height: 100px;
        font-size: 2.25rem;
    }

    .dna-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .music-dna {
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .mobile-nav {
        display: flex !important;
        position: fixed !important;
        bottom: 0 !important;
        top: auto !important;
    }

    .app-nav .nav-center {
        display: none;
    }

    .discover-page,
    .matches-page,
    .profile-page,
    .messages-page {
        padding-bottom: calc(70px + env(safe-area-inset-bottom));
    }

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

    .profile-cover {
        height: 140px;
    }

    .dna-card {
        padding: 1.25rem;
    }

    .music-dna {
        width: 130px;
        height: 130px;
    }
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .signup-card {
        padding: 1.75rem 1.25rem;
    }

    .discover-filters {
        flex-wrap: wrap;
    }

    .filter-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* ============================================
   ANIMATIONS & UTILITIES
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

@media (prefers-contrast: high) {
    :root {
        --border: #333333;
        --border-light: #444444;
    }
}

/* Touch interactions */
@media (hover: none) {
    .profile-card:active {
        transform: scale(0.98);
    }

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

/* Safe areas for PWA */
@supports (padding-top: env(safe-area-inset-top)) {
    .app-nav {
        padding-top: calc(0.75rem + env(safe-area-inset-top));
    }

    .signup-page, .discover-page, .matches-page, .profile-page {
        padding-top: calc(5rem + env(safe-area-inset-top));
    }
}

/* ============================================
   OAUTH MODAL
   ============================================ */
.oauth-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.oauth-modal.active {
    opacity: 1;
    visibility: visible;
}

.oauth-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.oauth-modal-content {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.oauth-modal.active .oauth-modal-content {
    transform: scale(1) translateY(0);
}

.oauth-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 1;
}

.oauth-modal-close:hover {
    background: var(--bg);
    color: var(--text);
    border-color: var(--border-light);
}

.oauth-service-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.oauth-service-icon {
    margin-bottom: 1rem;
}

.oauth-service-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.oauth-service-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.oauth-permissions {
    margin-bottom: 1.5rem;
}

.oauth-permission-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.oauth-permission-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.oauth-permission-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.oauth-actions {
    margin-bottom: 1.5rem;
}

.oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-full);
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.oauth-btn-primary {
    background: var(--btn-color, var(--accent));
    color: white;
}

.oauth-btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

.oauth-btn-primary.loading {
    opacity: 0.8;
    pointer-events: none;
}

.oauth-btn .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.oauth-demo-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.oauth-footer {
    text-align: center;
}

.oauth-footer p {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
}

.oauth-footer a {
    color: var(--text-secondary);
    text-decoration: underline;
}

.oauth-footer a:hover {
    color: var(--text);
}

.oauth-secure {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

/* OAuth Connecting Animation */
.oauth-connecting {
    text-align: center;
    padding: 2rem 0;
}

.oauth-connecting-animation {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
}

.connecting-ring {
    position: absolute;
    inset: 0;
    border: 2px solid var(--service-color, var(--accent));
    border-radius: 50%;
    opacity: 0.2;
}

.connecting-ring:nth-child(1) {
    animation: pulse-ring 2s ease-out infinite;
}

.connecting-ring:nth-child(2) {
    animation: pulse-ring 2s ease-out infinite 0.5s;
}

.connecting-ring:nth-child(3) {
    animation: pulse-ring 2s ease-out infinite 1s;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.5);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.connecting-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: var(--bg-card);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.oauth-connecting h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.connecting-status {
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: opacity 0.2s;
}

/* OAuth Success */
.oauth-success {
    text-align: center;
    padding: 2rem 0;
}

.success-checkmark {
    margin-bottom: 1.5rem;
    animation: success-pop 0.5s ease;
}

@keyframes success-pop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.oauth-success h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.oauth-success p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

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

/* Mobile optimizations for OAuth modal */
@media (max-width: 480px) {
    .oauth-modal-content {
        padding: 1.5rem;
        margin: 0.5rem;
        border-radius: var(--radius);
    }

    .oauth-service-header h2 {
        font-size: 1.25rem;
    }

    .oauth-btn {
        padding: 0.875rem 1.25rem;
    }
}
