/* 
    UEVR Hub v2.0 - Design System
    Focus: Premium, Fluid, Glassmorphic
*/

:root {
    /* Color Palette - Deep Slate & Cyber Cyan */
    --bg-dark: hsl(220, 25%, 5%);
    --bg-card: hsla(220, 25%, 10%, 0.6);
    --border-color: hsla(220, 25%, 20%, 0.5);
    
    --accent: hsl(190, 80%, 50%);
    --accent-glow: hsla(190, 80%, 50%, 0.2);
    --accent-dim: hsl(190, 40%, 40%);
    
    --text-primary: hsl(220, 10%, 95%);
    --text-secondary: hsl(220, 10%, 75%);
    --text-muted: hsl(220, 10%, 50%);
    
    --glass-blur: 16px;
    --card-radius: 16px;
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    
    --max-width: 1200px;
}

/* Base Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    background: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background Atmosphere */
body::before {
    content: '';
    position: fixed;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    background: radial-gradient(circle at 75% 15%, var(--accent-glow) 0%, transparent 50%),
                radial-gradient(circle at 25% 85%, hsla(280, 80%, 50%, 0.05) 0%, transparent 40%);
    z-index: -1;
    pointer-events: none;
}

/* Typography */
h1, h2, h3 {
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

/* Layout */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header & Nav */
header {
    padding: 2rem 0;
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

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

.logo-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
}

.logo-group h1 {
    font-size: 1.5rem;
    background: linear-gradient(to right, #fff, var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Hero Section */
.hero {
    padding: 4rem 0;
    text-align: center;
}

.hero h2 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(to bottom, #fff, var(--text-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

/* Stats */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 3rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent);
}

.stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

/* Search Controls */
.controls-container {
    position: sticky;
    top: 80px;
    z-index: 90;
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.search-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    backdrop-filter: blur(var(--glass-blur));
    transition: var(--transition-smooth);
}

.search-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

#search-input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
}

/* Game Grid */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 2rem;
    padding-bottom: 4rem;
}

/* Game Card */
.game-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    overflow: hidden;
    backdrop-filter: blur(var(--glass-blur));
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.game-card {
    cursor: pointer;
}

.game-card .profiles-stack {
    display: none; /* Hidden in card, shown in modal */
}

/* Modal System */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none; /* Toggle via JS */
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--bg-dark);
    background-image: radial-gradient(circle at top right, var(--accent-glow), transparent);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.close-btn:hover {
    background: rgba(255,255,255,0.1);
    transform: rotate(90deg);
}

.modal-header {
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
    padding-bottom: 2rem;
}

.modal-header h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.modal-header code {
    color: var(--accent);
    background: var(--accent-glow);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
}

.modal-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 600px;
    margin: 1.5rem auto 0;
}

.modal-section-title {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-section-title::after {
    content: '';
    flex-grow: 1;
    height: 1px;
    background: var(--border-color);
}

.card-banner {
    height: 180px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.card-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 40%, var(--bg-card));
}

.card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.game-meta {
    margin-bottom: 1.5rem;
}

.game-title {
    font-size: 1.4rem;
    margin-bottom: 0.25rem;
}

.title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.profile-count {
    background: var(--accent);
    color: var(--bg-dark);
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    letter-spacing: 0.05em;
}

.exe-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-family: 'Fira Code', monospace;
    color: var(--accent);
    opacity: 0.8;
}

.description-box {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.5;
    position: relative;
    max-height: 4.5em;
    overflow: hidden;
    cursor: pointer;
    transition: max-height 0.3s ease;
}

.description-box.expanded {
    max-height: 1000px;
}

/* Tags */
.tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tag-pill {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    transition: var(--transition-smooth);
}

.tag-pill:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.1);
}

/* Profiles List */
.profiles-stack {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    margin-top: auto;
}

.profile-entry {
    background: rgba(255,255,255,0.03);
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-smooth);
}

.profile-entry:hover {
    background: rgba(255,255,255,0.05);
    border-color: var(--border-color);
}

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

.author-name {
    font-size: 0.85rem;
    font-weight: 700;
}

.update-date {
    font-size: 0.7rem;
    color: var(--text-muted);
}

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

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: var(--transition-smooth);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-dark);
}

.btn-primary:hover {
    filter: brightness(1.2);
    box-shadow: 0 0 15px var(--accent-glow);
}

.btn-secondary {
    background: rgba(255,255,255,0.05);
    color: #fff;
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.1);
}

/* Loading & Empty States */
#loading-state {
    text-align: center;
    padding: 8rem 0;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--bg-card);
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    animation: spin 1s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .hero h2 { font-size: 2.5rem; }
    .stats-bar { flex-wrap: wrap; gap: 1.5rem; }
    .game-grid { grid-template-columns: 1fr; }
}
