/* Core Styles and Custom Design System - Truth or Lie */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --bg-gradient-start: #0f0c1b;
    --bg-gradient-end: #05020c;
    --primary-gradient: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
    --secondary-gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --accent-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --lie-gradient: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    
    --card-bg: rgba(25, 18, 44, 0.45);
    --card-border: rgba(168, 85, 247, 0.15);
    --card-border-hover: rgba(236, 72, 153, 0.35);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --primary-color: #a855f7;
    --secondary-color: #3b82f6;
    --lie-color: #ef4444;
    --truth-color: #10b981;
    
    --glass-blur: blur(16px);
    --shadow-glow: 0 8px 32px 0 rgba(168, 85, 247, 0.1);
    --shadow-btn: 0 4px 15px rgba(168, 85, 247, 0.3);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    background: radial-gradient(circle at 50% 0%, #1e113a 0%, var(--bg-gradient-start) 50%, var(--bg-gradient-end) 100%);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    letter-spacing: -0.02em;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

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

/* Glassmorphism Container */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: var(--shadow-glow);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-gradient);
    opacity: 0.8;
}

.glass-card.card-hover:hover {
    border-color: var(--card-border-hover);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px 0 rgba(236, 72, 153, 0.15);
}

/* Form inputs */
.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-control {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.875rem 1.25rem;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.form-control:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.75rem;
    border-radius: 12px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: var(--shadow-btn);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5);
    opacity: 0.95;
}

.btn-secondary {
    background: var(--secondary-gradient);
    color: #fff;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    opacity: 0.95;
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-primary);
}

.btn-danger {
    background: var(--lie-gradient);
    color: #fff;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
    opacity: 0.95;
}

.btn-disabled, .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Header/Navbar */
header {
    background: rgba(15, 12, 27, 0.8);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--card-border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    font-size: 1.8rem;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    background: rgba(255, 255, 255, 0.1);
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
}

/* Lobby Page */
.lobby-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .lobby-layout {
        grid-template-columns: 1fr;
    }
}

.player-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.player-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.player-card.is-host {
    border-color: rgba(168, 85, 247, 0.3);
    background: rgba(168, 85, 247, 0.05);
}

.player-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.player-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.player-card.is-host .player-avatar {
    border-color: var(--primary-color);
}

.player-details {
    display: flex;
    flex-direction: column;
}

.player-display-name {
    font-weight: 600;
    font-size: 1.05rem;
}

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

.player-score-tag {
    background: var(--primary-gradient);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.875rem;
    font-family: var(--font-heading);
}

/* Game Views */
.game-container {
    max-width: 800px;
    margin: 0 auto;
}

.game-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.75rem 1.5rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.round-indicator {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
}

/* Statements list */
.statement-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.statement-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.01);
}

.statement-card.selected-lie {
    border-color: var(--lie-color);
    background: rgba(239, 68, 68, 0.08);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.15);
}

.statement-badge {
    align-self: flex-start;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.statement-badge.truth {
    background: rgba(16, 185, 129, 0.15);
    color: var(--truth-color);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.statement-badge.lie {
    background: rgba(239, 68, 68, 0.15);
    color: var(--lie-color);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.statement-card.is-revealed.is-correct-lie {
    border-color: var(--truth-color);
    background: rgba(16, 185, 129, 0.08);
}

.statement-card.is-revealed.is-incorrect-lie {
    border-color: var(--lie-color);
    background: rgba(239, 68, 68, 0.08);
}

/* Results panel */
.results-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .results-grid {
        grid-template-columns: 1fr;
    }
}

.voters-avatars {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.voter-avatar-mini {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* Dashboard views */
.dashboard-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

@media (max-width: 640px) {
    .dashboard-actions {
        grid-template-columns: 1fr;
    }
}

/* Auth Cards */
.auth-container {
    max-width: 450px;
    width: 100%;
    margin: 0 auto;
}

.auth-tabs {
    display: flex;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 1rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.auth-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

/* Room code display */
.room-code-box {
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed var(--primary-color);
    border-radius: 16px;
    padding: 1rem;
    text-align: center;
    font-size: 2.5rem;
    font-family: var(--font-heading);
    font-weight: 800;
    letter-spacing: 0.1em;
    margin: 1.5rem 0;
    color: #fff;
    text-shadow: 0 0 15px rgba(168, 85, 247, 0.3);
}

/* Micro-animations */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

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