/* ===== CSS VARIABLES ===== */
:root {
  --bg-primary: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
  --bg-secondary: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  --bg-card: rgba(255, 255, 255, 0.05);
  --border-glass: rgba(255, 255, 255, 0.1);
  --text-primary: #ffffff;
  --text-secondary: #b3b3b3;
  --accent-primary: #4f46e5;
  --accent-secondary: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --shadow-primary: 0 10px 30px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 50px rgba(79, 70, 229, 0.1);
}

/* ===== GLOBAL STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== NAVIGATION ===== */
.navbar {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 1rem 0;
}

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

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
}

.nav-logo img {
  height: 52px;
  width: auto;
  vertical-align: middle;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
  font-weight: 500;
}

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

.nav-auth {
  display: flex;
  gap: 1rem;
  align-items: center;
}

/* ===== BUTTONS ===== */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 40px rgba(79, 70, 229, 0.4);
}

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

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

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

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

/* ===== MAIN CONTENT ===== */
.main-content {
  padding: 3rem 0;
  min-height: calc(100vh - 80px);
}

.hero {
  text-align: center;
  margin-bottom: 4rem;
}

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

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

/* ===== GAME CARDS ===== */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
}

.game-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  border: 1px solid var(--border-glass);
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-primary);
}

.game-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-glow), var(--shadow-primary);
}

.game-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.game-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.game-description {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

/* ===== FORMS ===== */
.form-container {
  max-width: 400px;
  margin: 0 auto;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  border: 1px solid var(--border-glass);
  padding: 2rem;
  box-shadow: var(--shadow-primary);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Google Sign-In Button */
.btn[style*="background: #4285f4"] {
  transition: all 0.3s ease;
}

.btn[style*="background: #4285f4"]:hover:not(:disabled) {
  background: #3367d6 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}

.btn[style*="background: #4285f4"]:active:not(:disabled) {
  transform: translateY(0);
}

.btn[style*="background: #4285f4"]:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

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

/* ===== ALERTS ===== */
.alert {
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  font-weight: 500;
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--success);
  color: var(--success);
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--error);
  color: var(--error);
}

/* ===== PROFILE ===== */
.profile-container {
  max-width: 800px;
  margin: 0 auto;
}

.profile-header {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  border: 1px solid var(--border-glass);
  padding: 2rem;
  text-align: center;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-primary);
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 2rem;
}

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

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  border: 1px solid var(--border-glass);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-primary);
}

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

.stat-label {
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* ===== LEADERBOARD ===== */
.leaderboard-container {
  max-width: 800px;
  margin: 0 auto;
}

.leaderboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.game-filter {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.9rem;
}

.leaderboard-list {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  border: 1px solid var(--border-glass);
  overflow: hidden;
  box-shadow: var(--shadow-primary);
}

.leaderboard-item {
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-glass);
  transition: background 0.3s ease;
}

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

.leaderboard-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.rank {
  font-size: 1.2rem;
  font-weight: 700;
  margin-right: 1rem;
  min-width: 40px;
}

.rank.gold { color: #ffd700; }
.rank.silver { color: #c0c0c0; }
.rank.bronze { color: #cd7f32; }

.user-info {
  flex: 1;
}

.username {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.user-score {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.score {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-primary);
}

/* ===== ACHIEVEMENTS ===== */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.achievement-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  border: 1px solid var(--border-glass);
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-primary);
}

.achievement-card.unlocked {
  border-color: var(--success);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.achievement-card.locked {
  opacity: 0.5;
  filter: grayscale(1);
}

.achievement-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.achievement-name {
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.achievement-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ===== LOADING ===== */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-glass);
  border-top: 3px solid var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .navbar {
    padding: 0.75rem 0;
  }
  
  .nav-content {
    flex-direction: column;
    gap: 1rem;
  }
  
  .nav-links {
    gap: 1rem;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  .games-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .game-card {
    padding: 1.5rem;
  }
  
  .form-container {
    margin: 0 1rem;
    padding: 1.5rem;
  }
  
  .leaderboard-header {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }
}

@media (max-width: 480px) {
  .main-content {
    padding: 2rem 0;
  }
  
  .hero h1 {
    font-size: 1.75rem;
  }
  
  .game-card {
    padding: 1rem;
  }
  
  .profile-stats {
    grid-template-columns: 1fr;
  }
} 