/* GameHub Pro - Enterprise CSS Framework */
/* ============================================ */

/* CSS Variables */
:root {
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-light: rgba(59, 130, 246, 0.1);
  --secondary: #8b5cf6;
  --secondary-hover: #7c3aed;
  --accent: #f59e0b;
  --accent-hover: #d97706;

  --background: #0f172a;
  --background-alt: #1a1f2e;
  --surface: #1e293b;
  --surface-hover: #273548;
  --surface-light: #334155;
  --surface-lighter: #475569;
  --border: #334155;
  --border-light: #4b5563;

  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;

  --error: #ef4444;
  --error-light: rgba(239, 68, 68, 0.1);
  --success: #22c55e;
  --success-light: rgba(34, 197, 94, 0.1);
  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.1);
  --info: #3b82f6;
  --info-light: rgba(59, 130, 246, 0.1);

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.5);

  --font-sans:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
  --font-mono: "Consolas", "Monaco", "Courier New", monospace;

  --transition: all 0.2s ease;
  --transition-slow: all 0.3s ease;

  --max-width: 1280px;
  --nav-height: 64px;
  --footer-height: auto;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  background: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

body.app-loaded #loading-screen {
  display: none;
}

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

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

img,
video,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

button,
input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

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

p {
  margin-bottom: 0.5rem;
}

/* Layout */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
  padding-top: var(--nav-height);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 48px 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Navigation */
.nav-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 24px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary) !important;
  text-decoration: none !important;
}

.nav-logo-icon {
  font-size: 1.5rem;
}

.nav-logo-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius);
  color: var(--text-muted) !important;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  text-decoration: none !important;
}

.nav-link:hover {
  color: var(--text-primary) !important;
  background: var(--surface-light);
}

.nav-link.active {
  color: var(--primary) !important;
  background: var(--primary-light);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* Mobile Menu */
.nav-mobile-toggle {
  font-size: 1.5rem;
  padding: 4px 8px;
  margin-right: 4px;
}

.mobile-menu {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 12px;
  z-index: 999;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.mobile-menu.open {
  transform: translateX(0);
}

body.menu-open {
  overflow: hidden;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  color: var(--text-secondary) !important;
  font-size: 1rem;
  text-decoration: none !important;
  transition: var(--transition);
}

.mobile-nav-link:hover {
  background: var(--surface-light);
  color: var(--text-primary) !important;
}

/* Hero Section */
.hero {
  padding: 80px 0 60px;
  background: linear-gradient(
    180deg,
    rgba(59, 130, 246, 0.05) 0%,
    transparent 50%
  );
}

.hero-content {
  text-align: center;
  max-width: 800px;
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text-primary), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 32px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  transition: var(--transition);
  text-decoration: none !important;
  white-space: nowrap;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-primary {
  background: var(--primary);
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-secondary) !important;
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary) !important;
  background: var(--primary-light);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted) !important;
}

.btn-ghost:hover {
  background: var(--surface);
  color: var(--text-primary) !important;
}

.btn-danger {
  background: var(--error);
  color: #fff !important;
}

.btn-danger:hover {
  background: #dc2626;
}

/* Cards */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: var(--transition-slow);
}

.card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-image {
  width: 100%;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-light);
  position: relative;
  overflow: hidden;
}

.card-image-icon {
  font-size: 3rem;
  opacity: 0.6;
}

.card-body {
  padding: 16px;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Grid Layouts */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* Auth Pages */
.page-auth {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - var(--nav-height));
  padding: 40px 20px;
}

.auth-container {
  width: 100%;
  max-width: 420px;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg);
}

.auth-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 8px;
  text-align: center;
}

.auth-subtitle {
  text-align: center;
  margin-bottom: 32px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-links {
  margin-top: 24px;
  text-align: center;
}

/* Forms */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.form-input {
  padding: 10px 14px;
  background: var(--background);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

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

/* Auth error */
.auth-error {
  padding: 10px 14px;
  background: var(--error-light);
  border: 1px solid var(--error);
  border-radius: var(--radius);
  color: var(--error);
  font-size: 0.85rem;
  text-align: center;
}

/* Profile page */
.page-profile {
  padding: 48px 0;
}

.profile-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  margin-bottom: 24px;
  display: flex;
  gap: 24px;
  align-items: center;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.profile-info h2 {
  margin-bottom: 4px;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-align: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Settings page */
.page-settings {
  padding: 48px 0;
}

.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  margin-bottom: 24px;
}

.settings-card h3 {
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.setting-item:last-child {
  border-bottom: none;
}

/* Sub-navigation within pages */
.page-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  margin-bottom: 24px;
}

.page-nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  gap: 0;
  overflow-x: auto;
}

.page-nav-link {
  padding: 12px 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  text-decoration: none !important;
  white-space: nowrap;
}

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

.page-nav-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Tab navigation */
.tab-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.tab-btn {
  padding: 10px 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  cursor: pointer;
  background: none;
}

.tab-btn:hover {
  color: var(--text-primary);
}

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

/* Footer */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 40px 0 24px;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 32px;
}

.footer-brand {
  max-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-logo {
  font-size: 1.5rem;
  margin-right: 8px;
}

.footer-brand-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-link {
  color: var(--text-muted) !important;
  font-size: 0.9rem;
  padding: 4px 0;
  text-decoration: none !important;
  transition: var(--transition);
}

.footer-link:hover {
  color: var(--text-primary) !important;
}

.footer-copyright {
  width: 100%;
  text-align: center;
  padding-top: 20px;
  margin-top: 20px;
  border-top: 1px solid var(--border);
}

/* Error Page */
.error-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
  padding: 40px;
}

.error-content {
  text-align: center;
}

.error-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

/* Skeleton Loading */
.skeleton {
  animation: pulse 1.5s infinite;
}

.skeleton-block {
  background: var(--surface-light) !important;
  min-height: 180px;
}

.skeleton-line {
  height: 12px;
  background: var(--surface-light);
  border-radius: 4px;
  margin-bottom: 8px;
}

.skeleton-line.w-full {
  width: 100%;
}
.skeleton-line.w-3-4 {
  width: 75%;
}
.skeleton-line.w-1-2 {
  width: 50%;
}

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

/* Utility Classes */
.flex {
  display: flex;
}
.flex-col {
  flex-direction: column;
}
.flex-wrap {
  flex-wrap: wrap;
}
.items-center {
  align-items: center;
}
.items-start {
  align-items: flex-start;
}
.justify-center {
  justify-content: center;
}
.justify-between {
  justify-content: space-between;
}
.justify-end {
  justify-content: flex-end;
}
.gap-1 {
  gap: 4px;
}
.gap-2 {
  gap: 8px;
}
.gap-4 {
  gap: 16px;
}
.gap-6 {
  gap: 24px;
}
.gap-8 {
  gap: 32px;
}

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

.text-xs {
  font-size: 0.75rem;
}
.text-sm {
  font-size: 0.875rem;
}
.text-base {
  font-size: 1rem;
}
.text-lg {
  font-size: 1.125rem;
}
.text-xl {
  font-size: 1.25rem;
}
.text-2xl {
  font-size: 1.5rem;
}
.text-3xl {
  font-size: 1.875rem;
}

.font-normal {
  font-weight: 400;
}
.font-medium {
  font-weight: 500;
}
.font-semibold {
  font-weight: 600;
}
.font-bold {
  font-weight: 700;
}

.text-primary {
  color: var(--primary);
}
.text-muted {
  color: var(--text-muted);
}
.text-secondary {
  color: var(--text-secondary);
}
.text-error {
  color: var(--error);
}
.text-success {
  color: var(--success);
}

.w-full {
  width: 100%;
}
.h-full {
  height: 100%;
}

.mt-2 {
  margin-top: 8px;
}
.mt-4 {
  margin-top: 16px;
}
.mt-6 {
  margin-top: 24px;
}
.mb-2 {
  margin-bottom: 8px;
}
.mb-4 {
  margin-bottom: 16px;
}
.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.p-2 {
  padding: 8px;
}
.p-4 {
  padding: 16px;
}
.p-6 {
  padding: 24px;
}
.px-4 {
  padding-left: 16px;
  padding-right: 16px;
}
.py-2 {
  padding-top: 8px;
  padding-bottom: 8px;
}
.py-4 {
  padding-top: 16px;
  padding-bottom: 16px;
}

.rounded {
  border-radius: var(--radius);
}
.rounded-lg {
  border-radius: var(--radius-lg);
}
.rounded-full {
  border-radius: var(--radius-full);
}

.bg-surface {
  background: var(--surface);
}
.bg-primary {
  background: var(--primary);
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.animate-fade-in {
  animation: fadeIn 0.3s ease-out;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--background);
}

::-webkit-scrollbar-thumb {
  background: var(--surface-light);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--surface-lighter);
}

/* Responsive */
@media (max-width: 1024px) {
  .content-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }

  .hero-title {
    font-size: 2.5rem;
  }
}

@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }

  .container {
    padding: 0 16px;
  }
  .section {
    padding: 32px 0;
  }

  .hero {
    padding: 60px 0 40px;
  }
  .hero-title {
    font-size: 2rem;
  }
  .hero-desc {
    font-size: 1rem;
  }

  .content-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }

  .auth-card {
    padding: 24px;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .footer-brand {
    max-width: 100%;
  }
  .footer-links {
    justify-content: center;
  }
}

@media (min-width: 769px) {
  .hide-desktop {
    display: none !important;
  }
}

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

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
  }
}
