/* StreamPartyGames - Main Stylesheet */

:root {
    /* Colors */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #10b981;
    --accent: #f59e0b;
    --danger: #ef4444;
    
    --bg-dark: #0f0f1a;
    --bg-card: #1a1a2e;
    --bg-input: #252540;
    
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    
    --border: #3f3f5a;
    --border-light: #52526a;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Poppins', var(--font-family);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

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

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

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p { margin-bottom: var(--space-md); }

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

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

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

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

/* 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-family);
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

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

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

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

.btn-success:hover {
    background: #059669;
}

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

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

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

.btn-block {
    display: flex;
    width: 100%;
}

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

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

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

.form-input {
    width: 100%;
    padding: var(--space-md);
    font-family: var(--font-family);
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

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

.form-input-lg {
    padding: var(--space-lg);
    font-size: 1.25rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
}

.card-title {
    margin-bottom: var(--space-md);
}

/* Game Cards */
.game-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: transform var(--transition-base), border-color var(--transition-base);
    cursor: pointer;
}

.game-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
}

.game-card-image {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    background: var(--bg-input);
}

.game-card-content {
    padding: var(--space-lg);
}

.game-card-title {
    font-size: 1.25rem;
    margin-bottom: var(--space-sm);
}

.game-card-meta {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Player List */
.player-list {
    list-style: none;
}

.player-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-input);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
}

.player-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.player-name {
    flex: 1;
    font-weight: 500;
}

.player-host {
    font-size: 0.75rem;
    padding: var(--space-xs) var(--space-sm);
    background: var(--accent);
    color: black;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.player-score {
    font-weight: 700;
    color: var(--secondary);
}

/* Room Code Display */
.room-code {
    font-family: 'Fira Code', monospace;
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-align: center;
    color: var(--primary-light);
    background: var(--bg-input);
    padding: var(--space-lg) var(--space-xl);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--border);
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-md);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-full);
}

.status-waiting {
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent);
}

.status-playing {
    background: rgba(16, 185, 129, 0.2);
    color: var(--secondary);
}

.status-finished {
    background: rgba(113, 113, 122, 0.2);
    color: var(--text-muted);
}

/* Header */
.header {
    padding: var(--space-lg) 0;
    border-bottom: 1px solid var(--border);
}

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

.logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}

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

.nav {
    display: flex;
    gap: var(--space-lg);
}

.nav a {
    color: var(--text-secondary);
    font-weight: 500;
}

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

/* Hero Section */
.hero {
    padding: var(--space-2xl) 0;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: var(--space-lg);
}

.hero h1 span {
    color: var(--primary);
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto var(--space-xl);
}

.hero-buttons {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
}

/* Grid */
.grid {
    display: grid;
    gap: var(--space-lg);
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 768px) {
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .room-code {
        font-size: 2rem;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: var(--space-md); }
.mt-2 { margin-top: var(--space-lg); }
.mt-3 { margin-top: var(--space-xl); }
.mb-1 { margin-bottom: var(--space-md); }
.mb-2 { margin-bottom: var(--space-lg); }
.mb-3 { margin-bottom: var(--space-xl); }

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    z-index: 1000;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    margin-top: var(--space-sm);
    animation: slideIn 0.3s ease;
}

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

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

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

/* Mobile adjustments */
@media (max-width: 480px) {
    .container {
        padding: 0 var(--space-md);
    }
    
    .btn-lg {
        padding: var(--space-md) var(--space-lg);
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
}
