/* ==========================================================================
   Antigravity Theme - MGMP Portal
   ========================================================================== */

:root {
  /* Colors */
  --bg-dark: #080d2b;
  --bg-mid: #0f1a4a;
  --bg-light: #1a0f2e;
  
  --gold: #f0c040;
  --gold-glow: #ffd700;
  --cyan: #00d4ff;
  --cyan-glow: #00ffff;
  
  --text-main: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.7);
  
  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --glass-inset: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  
  /* Fonts */
  --font-family: 'Inter', sans-serif;
}

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

body {
  font-family: var(--font-family);
  background: radial-gradient(circle at top, var(--bg-mid), var(--bg-dark) 60%, var(--bg-light));
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: var(--cyan);
  border-radius: 4px;
}

/* Particle Canvas */
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
}

/* Typography */
h1, h2, h3, h4 {
  font-weight: 700;
  margin-bottom: 1rem;
}

.gold-glow {
  color: var(--gold);
  text-shadow: 0 0 20px rgba(240, 192, 64, 0.6);
}

.cyan-text {
  color: var(--cyan);
}

a {
  color: var(--cyan);
  text-decoration: none;
  transition: all 0.3s ease;
}
a:hover {
  color: var(--cyan-glow);
  text-shadow: 0 0 10px var(--cyan);
}

/* Layout */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Glassmorphism Mixin Pattern */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow), var(--glass-inset);
  border-radius: 16px;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

/* Light trail effect */
.glass-panel::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(0,212,255,0.1) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
  z-index: 0;
}
.glass-panel:hover::before {
  opacity: 1;
}
.glass-panel > * {
  position: relative;
  z-index: 1;
}

/* Navbar */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  transition: all 0.4s ease;
  padding: 1.5rem 0;
}
nav.scrolled {
  background: rgba(8, 13, 43, 0.8);
  backdrop-filter: blur(15px);
  border-bottom: 1px solid var(--glass-border);
  padding: 1rem 0;
}
.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}
.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 15px var(--gold);
}
.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}
.nav-links a {
  color: var(--text-main);
  font-weight: 600;
}
.nav-links a:hover {
  color: var(--cyan);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.875rem;
}
.btn-primary {
  background: linear-gradient(135deg, var(--cyan), #0056b3);
  color: white;
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
}
.btn-primary:hover {
  box-shadow: 0 0 25px rgba(0, 212, 255, 0.8);
  transform: translateY(-2px);
  color: white;
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold), #b8860b);
  color: #000;
  box-shadow: 0 0 15px rgba(240, 192, 64, 0.4);
}
.btn-gold:hover {
  box-shadow: 0 0 25px rgba(240, 192, 64, 0.8);
  transform: translateY(-2px);
  color: #000;
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--cyan);
  color: var(--cyan);
}
.btn-outline:hover {
  background: rgba(0, 212, 255, 0.1);
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}

/* Hero Section */
#hero {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 2rem;
}
#hero h1 {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: float 6s infinite ease-in-out;
}
#hero p {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 2rem;
  animation: float 8s infinite ease-in-out reverse;
}

/* Search Bar */
.search-container {
  position: relative;
  width: 100%;
  max-width: 500px;
  z-index: 10;
}
.search-input {
  width: 100%;
  padding: 1rem 1.5rem 1rem 3rem;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 1rem;
  backdrop-filter: blur(10px);
  transition: all 0.3s;
}
.search-input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
}
.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}
.search-results {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 100%;
  background: rgba(8, 13, 43, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  display: none;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--glass-shadow);
}
.search-results.active {
  display: flex;
}
.search-item {
  padding: 1rem;
  border-bottom: 1px solid var(--glass-border);
  cursor: pointer;
  transition: background 0.3s;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.search-item:hover {
  background: rgba(255, 255, 255, 0.05);
}
.search-item:last-child {
  border-bottom: none;
}

/* Sections */
section {
  padding: 5rem 0;
}
.section-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 3rem;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}
.stat-card {
  text-align: center;
  animation: float 7s infinite ease-in-out;
}
.stat-card:nth-child(2) { animation-delay: 1s; }
.stat-card:nth-child(3) { animation-delay: 2s; }
.stat-card:nth-child(4) { animation-delay: 3s; }
.stat-icon {
  color: var(--cyan);
  margin-bottom: 1rem;
}
.stat-number {
  font-size: 3rem;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 0 15px var(--gold);
}
.stat-label {
  font-size: 1rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Cards Grid */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}
.card {
  display: flex;
  flex-direction: column;
  height: 100%;
  animation: float 8s infinite ease-in-out;
}
.card:nth-child(even) { animation-delay: 2s; }
.card-img-placeholder {
  height: 200px;
  background: linear-gradient(45deg, var(--bg-dark), var(--bg-mid));
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.card-content {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(240, 192, 64, 0.2);
  color: var(--gold);
  margin-bottom: 1rem;
  align-self: flex-start;
}
.card-title {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}
.card-text {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--glass-border);
  padding-top: 1rem;
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}
.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-muted);
}
.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  font-family: var(--font-family);
  transition: all 0.3s;
}
.form-control:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
}
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1em;
}

/* Auth Panels */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.auth-panel {
  width: 100%;
  max-width: 450px;
}
.register-panel {
  max-width: 600px;
}
.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}
.auth-footer {
  text-align: center;
  margin-top: 2rem;
  font-size: 0.875rem;
}

/* Toasts */
#toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.toast {
  padding: 1rem 1.5rem;
  border-radius: 8px;
  background: rgba(8, 13, 43, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  color: white;
  display: flex;
  align-items: center;
  gap: 1rem;
  transform: translateX(120%);
  animation: slideInRight 0.3s forwards;
}
.toast.success { border-left: 4px solid #28a745; }
.toast.error { border-left: 4px solid #dc3545; }
.toast.info { border-left: 4px solid var(--cyan); }
.toast.fade-out {
  animation: fadeOutRight 0.3s forwards;
}

/* Footer */
footer {
  background: rgba(8, 13, 43, 0.8);
  border-top: 1px solid var(--glass-border);
  padding: 4rem 2rem 2rem;
  margin-top: 4rem;
}
.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}
.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--glass-border);
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Animations */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes slideInRight {
  to { transform: translateX(0); }
}
@keyframes fadeOutRight {
  to { transform: translateX(120%); opacity: 0; }
}

.animate-on-scroll {
  opacity: 0;
}
.animate-on-scroll.visible {
  animation: fadeInUp 0.8s ease forwards;
}

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

@media (max-width: 768px) {
  #hero h1 { font-size: 2.5rem; }
  #hero p { font-size: 1rem; }
  .nav-links { display: none; }
  .nav-links.open { display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: rgba(8,13,43,0.95); backdrop-filter: blur(20px); padding: 1rem 2rem; gap: 1rem; border-bottom: 1px solid var(--glass-border); }
  .section-title { font-size: 2rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-number { font-size: 2rem; }
  .footer-content { grid-template-columns: 1fr; }
  .container { padding: 0 1rem; }
}

@media (max-width: 480px) {
  #hero h1 { font-size: 1.8rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .stat-card { padding: 1.5rem 1rem; }
  .grid-container { grid-template-columns: 1fr; }
  .glass-panel { padding: 1.5rem; }
}

/* Shimmer Loading Animation */
.shimmer {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmerAnim 1.5s infinite;
}
@keyframes shimmerAnim {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Textarea */
textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

/* Utility */
.hidden { display: none !important; }

