/* Modern Regex Quest Styles */
:root {
  --primary: #6366f1;
  --secondary: #8b5cf6;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --dark: #1f2937;
  --light: #f8fafc;
  --gradient: linear-gradient(135deg, var(--primary), var(--secondary));
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  margin: 0;
  color: var(--dark);
}

/* Hero Section */
.hero-section {
  padding: 2rem 0;
  background: var(--gradient);
  color: white;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.3;
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  position: relative;
  z-index: 1;
}

.hero-subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

/* Stats Sidebar */
.stats-sidebar {
  position: sticky;
  top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 1rem;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.3s ease;
  width: 100%;
}

.stat-card:hover {
  transform: translateY(-2px);
}

.stat-icon {
  font-size: 1.8rem;
  opacity: 0.8;
}

.stat-label {
  font-size: 0.875rem;
  opacity: 0.8;
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 700;
}

/* Difficulty Section */
.difficulty-section {
  text-align: center;
  position: relative;
  z-index: 1;
}

.difficulty-section .form-label {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: block;
}

.difficulty-select {
  max-width: 300px;
  margin: 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-weight: 500;
}

.difficulty-select option {
  background: var(--dark);
  color: white;
}

/* Game Section */
.game-section {
  padding: 2rem 0 3rem 0;
  background: var(--light);
  min-height: 70vh;
}

.challenge-card {
  background: white;
  border-radius: 1.5rem;
  box-shadow: var(--shadow-lg);
  margin-bottom: 2rem;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.challenge-header {
  background: var(--gradient);
  color: white;
  padding: 2rem;
  text-align: center;
}

.challenge-word {
  font-size: 2.2rem;
  font-weight: 700;
  margin: 0;
  font-family: 'Fira Code', monospace;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.challenge-body {
  padding: 1.5rem 2rem 2rem;
  text-align: center;
}

.challenge-hint {
  font-size: 1.1rem;
  color: #64748b;
  margin: 0;
  font-style: italic;
}

/* Input Section */
.input-section {
  margin-bottom: 2rem;
}

.input-group {
  box-shadow: var(--shadow);
  border-radius: 0.75rem;
  overflow: hidden;
}

.input-group-text {
  background: var(--primary);
  color: white;
  border: none;
  font-size: 1.1rem;
}

.regex-input {
  border: none;
  font-family: 'Fira Code', monospace;
  font-size: 1rem;
  padding: 0.875rem 1rem;
}

.regex-input:focus {
  box-shadow: none;
  border-color: var(--primary);
}

.submit-btn {
  background: var(--success);
  border: none;
  padding: 0.875rem 1.5rem;
  font-weight: 600;
}

.submit-btn:hover {
  background: #059669;
}

/* Feedback */
.feedback-section {
  text-align: center;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 2rem;
  min-height: 1.5rem;
}

/* Navigation */
.nav-section {
  text-align: center;
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-section .btn {
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  border-radius: 0.75rem;
  transition: all 0.3s ease;
}

.nav-section .btn:hover {
  transform: translateY(-1px);
}

/* Tester Section */
.tester-section {
  padding: 3rem 0;
  background: #f1f5f9;
}

.tester-card {
  background: white;
  border-radius: 1.5rem;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.tester-header {
  text-align: center;
  margin-bottom: 2rem;
}

.tester-header h2 {
  color: var(--dark);
  margin-bottom: 0.5rem;
}

.tester-header p {
  color: #64748b;
  margin: 0;
}

.tester-result {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 0.5rem;
  font-weight: 600;
  text-align: center;
  min-height: 1rem;
}

/* Admin Panel */
.admin-panel {
  display: none;
  padding: 3rem 0;
  background: var(--dark);
  color: white;
}

.admin-card {
  background: #374151;
  border-radius: 1.5rem;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
}

.admin-form {
  margin-bottom: 2rem;
}

.challenge-preview {
  background: #1f2937;
  border: 1px solid #4b5563;
  border-radius: 0.5rem;
  padding: 1rem;
  font-size: 0.875rem;
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 1rem;
}

.admin-actions h3 {
  margin-bottom: 1rem;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.challenge-card {
  animation: fadeIn 0.5s ease;
}

/* Responsive */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }
  
  .stats-sidebar {
    position: static;
    flex-direction: row;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1rem;
  }
  
  .stat-card {
    flex: 1;
    max-width: 180px;
  }
  
  .challenge-word {
    font-size: 1.8rem;
  }
  
  .nav-section {
    flex-direction: column;
    align-items: center;
  }
  
  .nav-section .btn {
    width: 200px;
  }

  .game-section .row {
    flex-direction: column;
  }
  
  .game-section .col-lg-3 {
    order: 2;
  }
  
  .game-section .col-lg-9 {
    order: 1;
  }
}