/* theme.css - Unified Global Color Variables for ReadAgora - Orange/Red Theme */

:root {
  /* ===== PRIMARY COLORS - Orange/Red Gradient Theme ===== */
  --color-primary: #FF6B6B;
  --color-primary-light: #FF8E53;
  --color-primary-dark: #E55A5A;
  --color-primary-darker: #CC4A4A;
  
  /* ===== BACKGROUND COLORS ===== */
  --color-background-light: #ffffff;
  --color-background-dark: #1a0f0f;
  --color-background-alt: #fcf8fa;
  
  /* ===== TEXT COLORS ===== */
  --color-text-primary: #2d3748;
  --color-text-secondary: #718096;
  --color-text-light: #f8fafc;
  --color-text-muted: #a0aec0;
  --color-text-dark: #1f2937;
  
  /* ===== SURFACE COLORS ===== */
  --color-surface-light: #f9fafb;
  --color-surface-medium: #fff5f5;
  --color-surface-dark: #2d3748;
  --color-surface-accent-light: #fed7d7;
  --color-surface-accent-dark: #4b5563;
  
  /* ===== BORDER COLORS ===== */
  --color-border-light: #fed7d7;
  --color-border-medium: #feb2b2;
  --color-border-dark: #4a5568;
  
  /* ===== GRADIENT COLORS ===== */
  --color-gradient-orange-start: #fff5f5;
  --color-gradient-orange-end: #fed7d7;
  --color-gradient-dark-start: #1a202c;
  --color-gradient-dark-end: #2d3748;
  --color-gradient-pink-start: #fdf2f8;
  --color-gradient-pink-end: #faf5ff;
  
  /* ===== GRAY SCALE ===== */
  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-800: #1f2937;
  --color-gray-900: #111827;
  
  /* ===== STATUS COLORS ===== */
  --color-success: #48bb78;
  --color-error: #f56565;
  --color-warning: #ed8936;
  --color-info: #4299e1;
  
  /* ===== ACCENT COLORS ===== */
  --color-yellow: #ed8936;
  --color-red: #f56565;
  --color-green: #48bb78;
  --color-blue: #4299e1;
  
  /* ===== GRADIENT DEFINITIONS ===== */
  --gradient-primary: linear-gradient(to right, var(--color-primary), var(--color-primary-light));
  --gradient-orange: linear-gradient(to bottom right, var(--color-gradient-orange-start), var(--color-gradient-orange-end));
  --gradient-dark: linear-gradient(to bottom right, var(--color-gradient-dark-start), var(--color-gradient-dark-end));
  --gradient-hero: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  --gradient-pink: linear-gradient(to right, var(--color-primary), var(--color-primary-light));
  --gradient-success: linear-gradient(to right, var(--color-success), #68d391);
  --gradient-error: linear-gradient(to right, var(--color-error), #fc8181);
  --gradient-warning: linear-gradient(to right, var(--color-warning), #f6ad55);
}

/* ===== DARK MODE OVERRIDES ===== */
[data-theme="dark"] {
  /* Background Colors */
  --color-background-light: #1a0f0f;
  --color-background-dark: #0f0a0a;
  --color-background-alt: #221019;
  
  /* Text Colors */
  --color-text-primary: #f8fafc;
  --color-text-secondary: #e2e8f0;
  --color-text-muted: #a0aec0;
  --color-text-dark: #f8fafc;
  
  /* Surface Colors */
  --color-surface-light: #2d1e1e;
  --color-surface-medium: #3a2828;
  --color-surface-dark: #1a1414;
  --color-surface-accent-light: #4a2c2c;
  --color-surface-accent-dark: #3a2828;
  
  /* Border Colors */
  --color-border-light: #4a2c2c;
  --color-border-medium: #5a3838;
  --color-border-dark: #3a2828;
  
  /* Gradient Colors */
  --color-gradient-orange-start: #2d1e1e;
  --color-gradient-orange-end: #1a1414;
  --color-gradient-dark-start: #1a0f0f;
  --color-gradient-dark-end: #0f0a0a;
  --color-gradient-pink-start: #1f2937;
  --color-gradient-pink-end: #111827;
  
  /* Gray Scale */
  --color-gray-50: #1a0f0f;
  --color-gray-100: #2d1e1e;
  --color-gray-200: #3a2828;
  --color-gray-300: #4a2c2c;
  --color-gray-400: #5a3838;
  --color-gray-500: #6b4a4a;
  --color-gray-600: #e2e8f0;
  --color-gray-700: #f1f5f9;
  --color-gray-800: #f8fafc;
  --color-gray-900: #ffffff;
}

/* ===== SYSTEM PREFERENCE DETECTION ===== */


/* ===== COMPONENT STYLES ===== */

/* Hero Sections */
.hero-gradient {
  background: var(--gradient-hero);
}

/* Cards & Features */
.feature-card {
  background: var(--color-surface-medium);
  border: 1px solid var(--color-border-light);
  transition: all 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Stats Sections */
.stats-section {
  background: var(--gradient-primary);
}

/* CTA Sections */
.cta-section {
  background: var(--color-surface-light);
}

/* ===== BUTTON STYLES ===== */
.btn-primary {
  background: var(--gradient-primary);
  color: white;
  border: none;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 15px -3px rgba(255, 107, 107, 0.3), 0 4px 6px -2px rgba(255, 107, 107, 0.1);
}

.btn-outline {
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
  background: transparent;
  transition: all 0.3s ease;
}

.btn-outline:hover {
  background: var(--gradient-primary);
  color: white;
  transform: translateY(-1px);
}

/* ===== TEXT EFFECTS ===== */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== UTILITY CLASSES ===== */
.bg-orange-gradient {
  background: var(--gradient-orange);
}

.bg-primary-gradient {
  background: var(--gradient-primary);
}

.bg-pink-gradient {
  background: var(--gradient-pink);
}

.text-primary-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.border-primary-light {
  border-color: var(--color-primary-light);
}

/* ===== TAB STYLES ===== */
.tab-content {
  display: none;
  transition: opacity 0.5s ease-in-out;
}

.tab-content.active {
  display: block;
  opacity: 1;
}

.tab-button.active {
  color: var(--color-text-primary);
  border-bottom-color: var(--color-primary);
}

.dark .tab-button.active {
  color: var(--color-text-light);
}

.tab-button {
  color: var(--color-text-secondary);
  border-bottom-color: transparent;
}

.dark .tab-button {
  color: var(--color-text-secondary);
}

/* Ranking Tabs */
.ranking-tab-content {
  display: none;
}

.ranking-tab-content.active {
  display: block;
}

.ranking-button.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 700;
}

.ranking-button {
  color: var(--color-text-secondary);
  border-bottom-color: transparent;
}

.dark .ranking-button {
  color: var(--color-text-secondary);
}

.dark .ranking-button.active {
  color: var(--color-primary);
}

/* ===== BOTTOM NAVIGATION ===== */
.bottom-nav-active {
  color: var(--color-primary);
}

.bottom-nav-inactive {
  color: var(--color-text-secondary);
}

.dark .bottom-nav-inactive {
  color: var(--color-text-muted);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { 
    transform: translateY(0); 
  }
  40% { 
    transform: translateY(-10px); 
  }
  60% { 
    transform: translateY(-5px); 
  }
}

@keyframes wiggle {
  0%, 7% { 
    transform: rotateZ(0); 
  }
  15% { 
    transform: rotateZ(-5deg); 
  }
  20% { 
    transform: rotateZ(3deg); 
  }
  25% { 
    transform: rotateZ(-3deg); 
  }
  30% { 
    transform: rotateZ(2deg); 
  }
  35% { 
    transform: rotateZ(-1deg); 
  }
  40%, 100% { 
    transform: rotateZ(0); 
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Animation Classes */
.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

.animate-bounce {
  animation: bounce 2s infinite;
}

.animate-wiggle {
  animation: wiggle 0.5s ease-in-out;
}

.loading-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ===== MATERIAL ICONS ===== */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ===== FORM STYLES ===== */
.form-input {
  background: var(--color-surface-light);
  border: 1px solid var(--color-border-light);
  color: var(--color-text-primary);
}

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

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

/* ===== BADGE & REWARD STYLES ===== */
.badge-earned {
  background: var(--gradient-success);
  color: white;
}

.badge-unearned {
  background: var(--color-surface-medium);
  color: var(--color-text-secondary);
  opacity: 0.7;
}

.progress-bar {
  background: var(--color-border-light);
}

.progress-fill {
  background: var(--gradient-primary);
  transition: width 0.5s ease-in-out;
}

/* ===== STORY CARD STYLES ===== */
.story-card {
  background: var(--color-background-light);
  border: 1px solid var(--color-border-light);
  transition: all 0.3s ease;
}

.story-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  border-color: var(--color-primary-light);
}

.dark .story-card {
  background: var(--color-surface-light);
}

/* ===== MODAL STYLES ===== */
.modal-overlay {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  background: var(--color-background-light);
  border: 1px solid var(--color-border-light);
}

.dark .modal-content {
  background: var(--color-surface-light);
}

/* ===== LOADING STATES ===== */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.skeleton-loading {
  background: linear-gradient(90deg, var(--color-border-light) 25%, var(--color-surface-medium) 50%, var(--color-border-light) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ===== RESPONSIVE UTILITIES ===== */
@media (max-width: 640px) {
  .mobile-full-width {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
  
  .mobile-padding {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles for accessibility */
.focus-visible:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --color-primary: #ff0000;
    --color-text-primary: #000000;
    --color-text-secondary: #333333;
    --color-background-light: #ffffff;
  }
  
  [data-theme="dark"] {
    --color-primary: #ff4444;
    --color-text-primary: #ffffff;
    --color-text-secondary: #cccccc;
    --color-background-light: #000000;
  }
/* CSS Variables for Theme */
:root {
  /* Colors */
  --color-primary: #f04299;
  --color-primary-hover: #e03188;
  --color-background-light: #f8f6f7;
  --color-background-dark: #221019;
  --color-text-primary: #181114;
  --color-text-secondary: #896175;
  --color-border: #e6dbe0;
  --color-white: #ffffff;
  --color-gray-100: #f7f7f7;
  
  /* Password Strength Colors */
  --color-weak: #ef4444;
  --color-fair: #f59e0b;
  --color-good: #3b82f6;
  --color-strong: #10b981;
  
  /* Status Colors */
  --color-success: #10b981;
  --color-error: #ef4444;
  --color-warning: #f59e0b;
  --color-info: #3b82f6;
  
  /* Typography */
  --font-family-display: 'Plus Jakarta Sans', 'Noto Sans', sans-serif;
  
  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius: 0.5rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  
  /* Transitions */
  --transition: all 0.3s ease;
  --transition-colors: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

/* Dark Mode Variables */
.dark {
  --color-background-light: #221019;
  --color-text-primary: #ffffff;
  --color-text-secondary: #a78ba0;
  --color-border: #4a3742;
  --color-white: #2d1a25;
}

/* Base Styles */
body {
  font-family: var(--font-family-display);
  background-color: var(--color-background-light);
  color: var(--color-text-primary);
  transition: var(--transition-colors);
}

/* Form Input Styles */
.form-input {
  border: 1px solid var(--color-border);
  background-color: var(--color-white);
  color: var(--color-text-primary);
  transition: var(--transition-colors);
}

.form-input:focus {
  border-color: var(--color-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgb(240 66 153 / 0.1);
}

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

/* Button Styles */
.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-white);
  transition: var(--transition-colors);
}

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

.btn-secondary {
  background-color: var(--color-white);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  transition: var(--transition-colors);
}

.btn-secondary:hover {
  background-color: var(--color-gray-100);
}

/* Custom Dialog Styles */
.custom-dialog {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.custom-dialog.active {
  opacity: 1;
  visibility: visible;
}

.custom-dialog-content {
  background-color: var(--color-white);
  border-radius: var(--radius-xl);
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  box-shadow: var(--shadow-md);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.custom-dialog.active .custom-dialog-content {
  transform: scale(1);
}

.dialog-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

.dialog-icon.error {
  background-color: rgba(239, 68, 68, 0.1);
}

.dialog-icon.success {
  background-color: rgba(16, 185, 129, 0.1);
}

.dialog-icon.warning {
  background-color: rgba(245, 158, 11, 0.1);
}

.dialog-icon.info {
  background-color: rgba(59, 130, 246, 0.1);
}

.dialog-title {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.5rem;
  color: var(--color-text-primary);
}

.dialog-message {
  text-align: center;
  color: var(--color-text-secondary);
  margin-bottom: 2rem;
}

.dialog-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

/* Password Strength */
.password-strength-bar {
  background-color: var(--color-border);
  border-radius: var(--radius-full);
  height: 0.5rem;
  overflow: hidden;
}

.password-strength-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: all 0.3s ease;
}

.password-strength-fill.weak {
  background-color: var(--color-weak);
  width: 25%;
}

.password-strength-fill.fair {
  background-color: var(--color-fair);
  width: 50%;
}

.password-strength-fill.good {
  background-color: var(--color-good);
  width: 75%;
}

.password-strength-fill.strong {
  background-color: var(--color-strong);
  width: 100%;
}

/* Social Buttons */
.social-btn {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  transition: var(--transition-colors);
}

.social-btn:hover {
  background-color: var(--color-gray-100);
}
