/**
 * Songlingo Portal - Main Stylesheet
 * Dark theme matching songlingo.io brand
 * 
 * Color Palette:
 * - Background: Deep dark (#0A0A0B, #111113, #18181B)
 * - Primary: Electric purple (#9333EA, #A855F7)
 * - Accent: Warm coral/orange (#F97316, #FB923C)
 * - Success: Spotify green (#1DB954)
 * - Text: Soft whites and grays
 */

/* ============================================
   CSS Variables / Design Tokens
   ============================================ */
:root {
    /* Background Colors - Dark Theme */
    --bg-primary: #0A0A0B;
    --bg-secondary: #111113;
    --bg-tertiary: #18181B;
    --bg-elevated: #1F1F23;
    --bg-card: rgba(24, 24, 27, 0.8);
    --bg-card-hover: rgba(31, 31, 35, 0.9);
    
    /* Primary Colors - Purple */
    --primary: #9333EA;
    --primary-light: #A855F7;
    --primary-dark: #7E22CE;
    --primary-glow: rgba(147, 51, 234, 0.4);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #9333EA 0%, #7C3AED 50%, #6366F1 100%);
    --gradient-accent: linear-gradient(135deg, #F97316 0%, #FB923C 100%);
    --gradient-hero: radial-gradient(ellipse at 50% 0%, rgba(147, 51, 234, 0.15) 0%, transparent 50%);
    --gradient-card: linear-gradient(145deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
    --gradient-glow: radial-gradient(ellipse at center, var(--primary-glow) 0%, transparent 70%);
    --gradient-border: linear-gradient(135deg, rgba(147, 51, 234, 0.5), rgba(99, 102, 241, 0.3));
    
    /* Accent Colors */
    --accent: #F97316;
    --accent-light: #FB923C;
    --success: #1DB954;
    --success-light: #22C55E;
    --warning: #F59E0B;
    --error: #EF4444;
    --error-light: #FCA5A5;
    
    /* Text Colors */
    --text-primary: #FAFAFA;
    --text-secondary: #A1A1AA;
    --text-muted: #71717A;
    --text-inverse: #09090B;
    
    /* Border Colors */
    --border-primary: rgba(255, 255, 255, 0.1);
    --border-secondary: rgba(255, 255, 255, 0.05);
    --border-accent: rgba(147, 51, 234, 0.3);
    
    /* Typography */
    --font-display: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 40px rgba(147, 51, 234, 0.3);
    --shadow-glow-lg: 0 0 80px rgba(147, 51, 234, 0.4);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
    --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================
   Reset & Base Styles
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
}

/* Noise texture overlay for depth */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.02;
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    letter-spacing: -0.01em;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

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

a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--text-primary);
}

/* ============================================
   Layout Components
   ============================================ */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    position: relative;
    z-index: 1;
}

.container-sm {
    max-width: 640px;
}

.container-md {
    max-width: 768px;
}

/* ============================================
   Header / Navigation
   ============================================ */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 11, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-primary);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

nav ul {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    list-style: none;
}

nav li a {
    display: inline-flex;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

nav li a:hover {
    color: var(--text-primary);
    background: var(--bg-elevated);
}

nav li:last-child a {
    background: var(--gradient-primary);
    color: var(--text-primary);
    padding: var(--space-sm) var(--space-lg);
    box-shadow: var(--shadow-glow);
}

nav li:last-child a:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(147, 51, 234, 0.5);
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .header-content {
        height: 64px;
    }
    
    nav ul {
        gap: 0;
    }
    
    nav li a {
        padding: var(--space-sm);
        font-size: 0.85rem;
    }
    
    nav li:last-child a {
        padding: var(--space-sm) var(--space-md);
    }
}

/* ============================================
   Footer
   ============================================ */
footer {
    margin-top: auto;
    padding: var(--space-2xl) 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-primary);
}

footer .container {
    text-align: center;
}

footer p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

footer a {
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

footer a:hover {
    color: var(--primary-light);
}

footer .footer-links {
    margin-top: var(--space-md);
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    border: 1px solid var(--border-primary);
    backdrop-filter: blur(10px);
    transition: all var(--transition-base);
}

.card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-accent);
    box-shadow: var(--shadow-lg);
}

.card-glow {
    position: relative;
}

.card-glow::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: var(--gradient-border);
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.card-glow:hover::before {
    opacity: 1;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--text-primary);
    box-shadow: 0 4px 20px rgba(147, 51, 234, 0.4);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(147, 51, 234, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Shimmer effect */
.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-tertiary);
    border-color: var(--border-accent);
}

.btn-outline {
    background: transparent;
    color: var(--primary-light);
    border: 2px solid var(--primary);
}

.btn-outline:hover:not(:disabled) {
    background: var(--primary);
    color: var(--text-primary);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: var(--space-sm) var(--space-md);
}

.btn-ghost:hover:not(:disabled) {
    color: var(--primary-light);
    background: rgba(147, 51, 234, 0.1);
}

.btn-accent {
    background: var(--gradient-accent);
    color: var(--text-primary);
    box-shadow: 0 4px 20px rgba(249, 115, 22, 0.4);
}

.btn-accent:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(249, 115, 22, 0.5);
}

.btn-lg {
    padding: var(--space-lg) var(--space-2xl);
    font-size: 1.05rem;
    border-radius: var(--radius-lg);
}

.btn-sm {
    padding: var(--space-sm) var(--space-md);
    font-size: 0.85rem;
}

.btn-block {
    width: 100%;
}

/* Button Loading State */
.btn .spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn.loading .spinner {
    display: block;
}

.btn.loading .btn-text {
    opacity: 0.7;
}

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

/* ============================================
   Form Elements
   ============================================ */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--space-sm);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    outline: none;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
    background: var(--bg-elevated);
}

.form-input.error {
    border-color: var(--error);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2);
}

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

.form-help {
    margin-top: var(--space-sm);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.form-error {
    margin-top: var(--space-sm);
    font-size: 0.85rem;
    color: var(--error);
    font-weight: 500;
}

/* ============================================
   Alerts
   ============================================ */
.alert {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: var(--space-lg);
    animation: slideIn 0.3s ease;
}

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

.alert-success {
    background: rgba(29, 185, 84, 0.15);
    color: var(--success);
    border: 1px solid rgba(29, 185, 84, 0.3);
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    color: #FCA5A5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #FCD34D;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.alert-info {
    background: rgba(147, 51, 234, 0.15);
    color: var(--primary-light);
    border: 1px solid rgba(147, 51, 234, 0.3);
}

.alert-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* ============================================
   Badges
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-primary {
    background: rgba(147, 51, 234, 0.2);
    color: var(--primary-light);
}

.badge-success {
    background: rgba(29, 185, 84, 0.2);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.badge-vip {
    background: var(--gradient-accent);
    color: var(--text-primary);
}

.badge-free {
    background: rgba(29, 185, 84, 0.2);
    color: var(--success);
}

/* ============================================
   Utility Classes
   ============================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--primary-light); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }
.text-muted { color: var(--text-muted); }
.text-white { color: var(--text-primary); }

.font-mono { font-family: var(--font-mono); }
.font-display { font-family: var(--font-display); }

.mt-1 { margin-top: var(--space-sm); }
.mt-2 { margin-top: var(--space-md); }
.mt-3 { margin-top: var(--space-lg); }
.mt-4 { margin-top: var(--space-xl); }
.mt-5 { margin-top: var(--space-2xl); }

.mb-1 { margin-bottom: var(--space-sm); }
.mb-2 { margin-bottom: var(--space-md); }
.mb-3 { margin-bottom: var(--space-lg); }
.mb-4 { margin-bottom: var(--space-xl); }
.mb-5 { margin-bottom: var(--space-2xl); }

.py-1 { padding-top: var(--space-sm); padding-bottom: var(--space-sm); }
.py-2 { padding-top: var(--space-md); padding-bottom: var(--space-md); }
.py-3 { padding-top: var(--space-lg); padding-bottom: var(--space-lg); }
.py-4 { padding-top: var(--space-xl); padding-bottom: var(--space-xl); }
.py-5 { padding-top: var(--space-2xl); padding-bottom: var(--space-2xl); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-sm); }
.gap-2 { gap: var(--space-md); }
.gap-3 { gap: var(--space-lg); }
.gap-4 { gap: var(--space-xl); }

.hidden { display: none; }

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes glow {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(147, 51, 234, 0.3);
    }
    50% { 
        box-shadow: 0 0 40px rgba(147, 51, 234, 0.5);
    }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

/* Staggered animations */
.stagger-1 { animation-delay: 0.1s; opacity: 0; }
.stagger-2 { animation-delay: 0.2s; opacity: 0; }
.stagger-3 { animation-delay: 0.3s; opacity: 0; }
.stagger-4 { animation-delay: 0.4s; opacity: 0; }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 640px) {
    .container {
        padding: 0 var(--space-md);
    }
    
    .card {
        padding: var(--space-lg);
        border-radius: var(--radius-md);
    }
    
    .btn-lg {
        padding: var(--space-md) var(--space-xl);
    }
}
