/* ========================================================
   CHÍNH TRỊ & PHÁP LUẬT AI - Design System: Law & Justice Soft UI
   Tông màu: Xanh Tư Pháp (#0E2954), Đỏ Đô (#9A031E), Vàng Kim (#D4AF37)
   ======================================================== */

:root {
  --primary: #0E2954;
  --primary-light: #1F4172;
  --secondary: #2E5A88;
  --accent: #9A031E;
  --accent-light: #C1121F;
  --gold: #D4AF37;
  --gold-light: #FCDC94;
  --bg-color: #F4F7FB;
  --surface: #FFFFFF;
  --success: #198754;
  --warning: #D97706;
  --danger: #DC2626;
  --text-main: #0F172A;
  --text-muted: #64748B;
  
  --glass-bg: rgba(255, 255, 255, 0.82);
  --glass-border: rgba(14, 41, 84, 0.12);
  --glass-shadow: 0 10px 32px 0 rgba(14, 41, 84, 0.1);
  --radius-bubble: 22px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  background-image: 
    radial-gradient(at 0% 0%, rgba(36, 76, 112, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(196, 154, 85, 0.08) 0px, transparent 50%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* Glass Components */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius-bubble);
}

.glass-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  padding: 12px 24px;
}

/* Button & Bubble UI */
.btn-bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 9999px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-decoration: none;
}

.btn-bubble:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(36, 76, 112, 0.15);
}

.btn-bubble:active {
  transform: scale(0.96);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #fff;
}

.btn-outline {
  background: rgba(255, 255, 255, 0.8);
  border: 1.5px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}

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

/* Badges */
.badge-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-student { background: rgba(54, 164, 119, 0.15); color: var(--success); }
.badge-teacher { background: rgba(196, 154, 85, 0.2); color: var(--accent); }

/* Inputs */
.input-glass {
  width: 100%;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.9);
  border: 1.5px solid rgba(36, 76, 112, 0.15);
  border-radius: 14px;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
  color: #2d3748;
  font-family: inherit;
}

/* Fix select dropdown */
select.input-glass {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23244C70' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 44px;
  cursor: pointer;
}

.input-glass:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(36, 76, 112, 0.12);
  background: #fff;
}

/* Modal Liquid Glass */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-content {
  background: #ffffff;
  border-radius: 24px;
  max-width: 650px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px;
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

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

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

@keyframes pulseGold {
  0% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.4); }
  70% { box-shadow: 0 0 0 12px rgba(212, 175, 55, 0); }
  100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
}

.animate-fade {
  animation: fadeIn 0.35s ease-out forwards;
}

/* PWA Install Banner */
.pwa-banner {
  background: linear-gradient(135deg, #0E2954, #1F4172);
  color: #fff;
  padding: 10px 18px;
  border-radius: 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 8px 20px rgba(14,41,84,0.15);
  flex-wrap: wrap;
  gap: 12px;
}

.pwa-install-btn {
  background: linear-gradient(135deg, #FCDC94, #D4AF37);
  color: #0E2954;
  border: none;
  padding: 8px 18px;
  border-radius: 20px;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.pwa-install-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(212, 175, 55, 0.4);
}

/* Game Cards */
.game-card {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(14, 41, 84, 0.12);
  border-radius: 20px;
  padding: 24px;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.game-card:hover {
  transform: translateY(-6px);
  border-color: #0E2954;
  box-shadow: 0 16px 32px rgba(14, 41, 84, 0.15);
}

.badge-law {
  background: rgba(14, 41, 84, 0.1);
  color: #0E2954;
  border: 1px solid rgba(14, 41, 84, 0.2);
}

.badge-crimson {
  background: rgba(154, 3, 30, 0.1);
  color: #9A031E;
  border: 1px solid rgba(154, 3, 30, 0.2);
}

.badge-gold {
  background: rgba(212, 175, 55, 0.15);
  color: #B45309;
  border: 1px solid rgba(212, 175, 55, 0.3);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .grid-cards {
    grid-template-columns: 1fr;
  }
}
