/* 
 * AsanCraft Modern UI Overrides
 * Updated: 2025-11-30
 * Description: Modern, responsive UI styles with neon aesthetics and glassmorphism.
 */

:root {
  /* Color Palette */
  --primary: #00ffff;
  --primary-dark: #00cccc;
  --primary-glow: rgba(0, 255, 255, 0.3);
  --bg: #0f172a;
  --panel: #1e293b;
  --panel-hover: #334155;
  --text: #f8fafc;
  --muted: #94a3b8;
  --ring: #334155;
  
  /* Layout & Spacing */
  --radius: 12px;
  --header-height: 70px;
  --container-width: 1200px;
  
  /* Typography */
  --font-main: 'Vazirmatn', sans-serif;
}

/* Global Styles */
body {
  font-family: var(--font-main);
  background-color: var(--bg);
  color: var(--text);
  margin: 0;
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ring);
  height: var(--header-height);
  display: flex;
  align-items: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.header-wrap {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  height: 40px;
  filter: drop-shadow(0 0 8px var(--primary-glow));
}

.brand-name {
  font-weight: 700;
  font-size: 1.1rem;
  background: linear-gradient(to right, #fff, var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Navigation Menu */
.nav {
  display: flex;
  gap: 24px;
  align-items: center;
}

.nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
  position: relative;
}

.nav a:hover, .nav a.active {
  color: var(--primary);
  text-shadow: 0 0 8px var(--primary-glow);
}

.nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s ease;
}

.nav a:hover::after {
  width: 100%;
}

/* Dropdown */
.dropdown {
  position: relative;
}

.dropdown-toggle {
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
}

.dropdown-toggle:hover {
  color: var(--primary);
  text-shadow: 0 0 8px var(--primary-glow);
}

.dropdown-toggle::after {
  content: '▾';
  font-size: 0.8em;
}

.dropdown-menu {
  position: absolute;
  top: 120%;
  right: 0;
  background: var(--panel);
  border: 1px solid var(--ring);
  border-radius: var(--radius);
  min-width: 200px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.dropdown.open .dropdown-menu,
.dropdown:hover .dropdown-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.dropdown-menu a {
  padding: 10px 16px;
  border-radius: 8px;
  color: var(--text);
  transition: background 0.2s;
}

.dropdown-menu a:hover {
  background: var(--panel-hover);
  color: var(--primary);
}

.dropdown-menu a::after {
  display: none;
}

/* Mobile Navigation Toggle */
.nav-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
}

/* Hero Section */
.hero {
  padding: 80px 0;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 40px;
}

.hero-copy h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 24px;
  line-height: 1.2;
  background: linear-gradient(135deg, #fff 0%, var(--muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-copy p {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 32px;
  max-width: 500px;
}

.hero-actions {
  display: flex;
  gap: 16px;
}

.hero-art img {
  width: 100%;
  max-width: 500px;
  height: auto;
  filter: drop-shadow(0 0 30px rgba(0, 255, 255, 0.2));
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
  100% { transform: translateY(0); }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 32px;
  border-radius: 99px;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  font-family: var(--font-main);
  position: relative;
  overflow: hidden;
}

/* Ripple Effect */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

.btn.primary {
  background: var(--primary);
  color: #000;
  box-shadow: 0 0 20px var(--primary-glow);
}

.btn.primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 0 30px var(--primary-glow);
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--ring);
  color: var(--text);
}

.btn.ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn.secondary {
    background: var(--panel-hover);
    color: var(--text);
}

.btn.secondary:hover {
    background: var(--ring);
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  padding: 40px 0;
}

.card {
  background: var(--panel);
  border: 1px solid var(--ring);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-8px);
  border-color: var(--primary);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.card .icon {
  width: 64px;
  height: 64px;
  background: rgba(0, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  color: var(--primary);
  font-size: 2rem;
}

.card .icon svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
}

.card h3 {
  font-size: 1.5rem;
  margin-bottom: 12px;
  color: var(--text);
}

.card p {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Forms */
.form-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
  padding: 40px 20px;
}

.form-box {
  background: var(--panel);
  padding: 48px;
  border-radius: 24px;
  width: 100%;
  max-width: 450px;
  border: 1px solid var(--ring);
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.form-box h2 {
  text-align: center;
  margin-bottom: 32px;
  font-size: 2rem;
  color: var(--primary);
}

.input-group {
  margin-bottom: 24px;
}

.input-group input {
  width: 100%;
  padding: 16px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--ring);
  border-radius: 12px;
  color: var(--text);
  font-family: var(--font-main);
  transition: all 0.3s ease;
  box-sizing: border-box; /* Ensure padding doesn't affect width */
}

.input-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 255, 255, 0.1);
}

.full-width {
  width: 100%;
}

.form-footer {
  text-align: center;
  margin-top: 24px;
  color: var(--muted);
  font-size: 0.9rem;
}

.form-footer a {
  color: var(--primary);
  font-weight: 600;
}

.error {
  color: #fca5a5;
  background: rgba(127, 29, 29, 0.2);
  border: 1px solid #7f1d1d;
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  margin-bottom: 20px;
}

/* Unity Player Styles */
.unity-container {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  border: 1px solid var(--ring);
}

.unity-canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  background: #000;
  display: block;
}

.unity-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px;
  background: var(--panel);
  border-top: 1px solid var(--ring);
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--ring);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  width: 0;
  height: 100%;
  background: var(--primary);
  transition: width 0.2s ease;
}

.unity-settings {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  background: var(--panel);
  border-top: 1px solid var(--ring);
}

.unity-warning {
    display: none;
    color: #fca5a5;
    padding: 12px;
    text-align: center;
}

.input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-wrapper label {
  font-size: 0.8rem;
  color: var(--muted);
}

.input-wrapper input,
.input-wrapper select,
.input-wrapper textarea {
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--ring);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-main);
  width: 100%;
  box-sizing: border-box;
}

.input-wrapper textarea {
  resize: vertical;
  min-height: 100px;
}

/* Additional Form Styles */
.add-form {
  background: var(--panel);
  padding: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--ring);
  max-width: 600px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 24px;
}

.form-actions {
  display: flex;
  gap: 16px;
  justify-content: flex-end;
  margin-top: 32px;
}

/* Question Form */
.question-form {
  text-align: center;
  margin-top: 40px;
  background: var(--panel);
  padding: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--ring);
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.question-form h3 {
  color: var(--primary);
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.question-form p {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.question-form form {
  display: flex;
  justify-content: center;
  gap: 0;
  max-width: 400px;
  margin: 0 auto;
}

.question-form input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--ring);
  border-radius: 0 12px 12px 0; /* RTL: input on right */
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  outline: none;
  transition: border-color 0.3s;
}

.question-form input:focus {
  border-color: var(--primary);
}

.question-form button {
  padding: 12px 24px;
  background: var(--primary);
  color: #000;
  border: none;
  border-radius: 12px 0 0 12px; /* RTL: button on left */
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-main);
  transition: background 0.3s;
}

.question-form button:hover {
  background: var(--primary-dark);
}

/* Section Titles */
.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 40px;
  text-align: center;
  position: relative;
  padding-bottom: 16px;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
  box-shadow: 0 0 10px var(--primary-glow);
}

/* Typewriter Effect */
.typing-cursor::after {
  content: '|';
  animation: blink 1s step-start infinite;
  color: var(--primary);
  margin-right: 2px;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* Generic Section Spacing */
section {
  padding: 60px 0;
}

/* Footer */
.site-footer {
  background: var(--panel);
  border-top: 1px solid var(--ring);
  padding: 60px 0 20px;
  margin-top: 80px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  margin-bottom: 60px;
}

.footer-section h4 {
  color: var(--text);
  font-size: 1.1rem;
  margin-bottom: 24px;
  font-weight: 700;
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-nav a {
  color: var(--muted);
  font-size: 0.95rem;
}

.footer-nav a:hover {
  color: var(--primary);
  transform: translateX(-4px);
}

.footer-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
}

.social-icons {
  display: flex;
  gap: 16px;
}

.social-icons img {
  width: 24px;
  height: 24px;
  opacity: 0.7;
  transition: all 0.3s ease;
}

.social-icons a:hover img {
  opacity: 1;
  transform: scale(1.2);
  filter: drop-shadow(0 0 8px var(--primary));
}

.footer-bottom {
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid var(--ring);
  color: var(--muted);
  font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .hero-copy h1 {
    font-size: 2.5rem;
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--panel);
    flex-direction: column;
    padding: 20px;
    border-bottom: 1px solid var(--ring);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
  }

  .nav.show {
    display: flex;
  }

  .dropdown-menu {
    position: static;
    transform: none;
    opacity: 1;
    background: transparent;
    border: none;
    box-shadow: none;
    padding-right: 20px;
    display: none;
  }
  
  .dropdown.open .dropdown-menu {
      display: flex;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-copy p {
    margin: 0 auto 32px;
  }

  .hero-actions {
    justify-content: center;
  }
  
  .hero-art {
      margin-top: 40px;
  }

  .unity-settings {
    grid-template-columns: 1fr 1fr !important;
  }

  /* Mobile Form Styles */
  .question-form form {
    flex-direction: column;
    gap: 12px;
  }

  .question-form input,
  .question-form button {
    width: 100%;
    border-radius: 12px;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .form-actions .btn {
    width: 100%;
  }

  .section-title {
      font-size: 1.75rem;
  }
}

@media (max-width: 480px) {
  .unity-settings {
    grid-template-columns: 1fr !important;
  }
  
  .hero-copy h1 {
      font-size: 2rem;
  }
  
  .form-box {
      padding: 24px;
  }
}

/* Dashboard Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--ring);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.stat-icon {
  font-size: 2.5rem;
  background: rgba(0, 255, 255, 0.1);
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}

.stat-info h3 {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.stat-number {
  margin: 4px 0 0;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
}

.action-card {
  justify-content: center;
  padding: 0;
  background: transparent;
  border: none;
}

.action-card .btn {
  height: 100%;
  width: 100%;
  border-radius: var(--radius);
  font-size: 1.1rem;
}

/* User Summary */
.user-summary {
    background: var(--panel);
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--ring);
    margin-bottom: 30px;
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.summary-item strong {
    color: var(--primary);
    margin-left: 8px;
}

/* Latest Games */
.games-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.game-preview-card {
    background: var(--panel);
    border-radius: var(--radius);
    border: 1px solid var(--ring);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.game-preview-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.preview-image {
    height: 180px;
    background-size: cover;
    background-position: center;
}

.preview-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.preview-content h4 {
    margin: 0 0 10px;
    font-size: 1.2rem;
    color: var(--text);
}

.preview-content .rating {
    font-size: 0.9rem;
    color: #fbbf24;
    margin-bottom: 10px;
}

.preview-content p {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
    flex: 1;
}

.btn.small {
    padding: 8px 20px;
    font-size: 0.9rem;
    align-self: flex-start;
}
