/* Enhanced Theme - QuranAndHadith.org */
/* Modern Islamic Color Palette with Sophisticated Design */

:root {
  /* Primary Colors - Sophisticated Islamic Palette */
  --primary-color: #006b5c;
  --primary-dark: #004d40;
  --primary-light: #4db6ac;
  --primary-lighter: #b2dfdb;

  /* Secondary Colors - Warm Islamic Gold */
  --secondary-color: #d4a574;
  --secondary-dark: #b8860b;
  --secondary-light: #f4e4bc;

  /* Accent Colors */
  --accent-color: #1e3a5f;
  --accent-light: #5c7cfa;

  /* Neutral Colors */
  --white: #ffffff;
  --light-gray: #f8fafc;
  --medium-gray: #e2e8f0;
  --dark-gray: #475569;
  --text-color: #1e293b;
  --text-muted: #64748b;

  /* Islamic Theme Colors */
  --islamic-green: #006b5c;
  --arabic-gold: #d4a574;
  --calligraphy-dark: #1a202c;
  --prayer-blue: #2563eb;

  /* Gradients */
  --gradient-primary: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-dark) 100%
  );
  --gradient-secondary: linear-gradient(
    135deg,
    var(--secondary-color) 0%,
    var(--secondary-dark) 100%
  );
  --gradient-hero: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--accent-color) 100%
  );
  --gradient-card: linear-gradient(
    145deg,
    var(--white) 0%,
    var(--light-gray) 100%
  );

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-islamic: 0 8px 32px rgba(0, 107, 92, 0.15);

  /* Typography */
  --font-primary: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --font-arabic: "Uthmani", "Amiri", serif;
  --font-headings: "Inter", sans-serif;

  /* Font Sizes */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Z-index Scale */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
  --z-toast: 1080;
}

/* Dark Mode Variables */
[data-theme="dark"] {
  --white: #0f172a;
  --light-gray: #1e293b;
  --medium-gray: #334155;
  --text-color: #f1f5f9;
  --text-muted: #cbd5e1;
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3),
    0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3),
    0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--white);
  overflow-x: hidden;
  transition: background-color var(--transition-normal),
    color var(--transition-normal);
}

/* Enhanced Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--light-gray);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* Typography Enhancements */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-headings);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-color);
  margin-bottom: var(--space-4);
}

h1 {
  font-size: var(--text-5xl);
}
h2 {
  font-size: var(--text-4xl);
}
h3 {
  font-size: var(--text-3xl);
}
h4 {
  font-size: var(--text-2xl);
}
h5 {
  font-size: var(--text-xl);
}
h6 {
  font-size: var(--text-lg);
}

p {
  margin-bottom: var(--space-4);
  color: var(--text-muted);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-dark);
  text-decoration: none;
}

/* Enhanced Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-weight: 600;
  font-size: var(--text-sm);
  line-height: 1;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left var(--transition-slow);
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: var(--gradient-primary);
  color: var(--white);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: var(--white);
}

.btn-secondary {
  background: var(--gradient-secondary);
  color: var(--white);
  box-shadow: var(--shadow-md);
}

.btn-outline-primary {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: transparent;
}

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

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
  border-radius: var(--radius-xl);
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  border-radius: var(--radius-md);
}

/* Enhanced Cards */
.card {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--medium-gray);
  transition: all var(--transition-normal);
  overflow: hidden;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.card-modern {
  background: var(--gradient-card);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Islamic Design Elements */
.islamic-pattern {
  position: relative;
}

.islamic-pattern::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23006b5c' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.geometric-border {
  position: relative;
}

.geometric-border::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-secondary);
  clip-path: polygon(0 0, 100% 0, 95% 100%, 5% 100%);
}

/* Hero Section Enhancements */
.hero {
  background: var(--gradient-hero);
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(
      circle at 25% 25%,
      rgba(255, 255, 255, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 75% 75%,
      rgba(255, 255, 255, 0.05) 0%,
      transparent 50%
    );
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  color: var(--white);
  margin-bottom: var(--space-6);
  text-shadow: 2px 4px 8px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
  font-size: var(--text-xl);
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--space-8);
  max-width: 600px;
}

/* Navigation Enhancements */
.navbar {
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  padding: var(--space-4) 0;
}

.navbar-scrolled {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2) 0;
}

.navbar-brand {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--primary-color);
  text-decoration: none;
}

.navbar-brand:hover {
  color: var(--primary-dark);
}

.nav-link {
  font-weight: 500;
  color: var(--text-color);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-color);
  background: var(--primary-lighter);
}

/* Section Layouts */
.section-padding {
  padding: var(--space-20) 0;
}

.section-title {
  font-size: var(--text-4xl);
  font-weight: 800;
  color: var(--text-color);
  text-align: center;
  margin-bottom: var(--space-4);
  position: relative;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -var(--space-2);
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: var(--gradient-secondary);
  border-radius: var(--radius-full);
}

.section-description {
  font-size: var(--text-lg);
  color: var(--text-muted);
  text-align: center;
  max-width: 700px;
  margin: 0 auto var(--space-12);
}

/* Grid Layouts */
.grid-auto-fit {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-8);
}

.grid-auto-fill {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-6);
}

/* Loading States */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.loading-overlay.active {
  opacity: 1;
  visibility: visible;
}

.loading-spinner {
  text-align: center;
}

.spinner-ring {
  width: 60px;
  height: 60px;
  border: 4px solid var(--light-gray);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto var(--space-4);
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loading-text {
  color: var(--text-muted);
  font-weight: 500;
}

/* Progress Bar */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--gradient-secondary);
  z-index: var(--z-sticky);
  transition: width var(--transition-fast);
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  width: 50px;
  height: 50px;
  background: var(--gradient-primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  z-index: var(--z-fixed);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

/* Skip Link for Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--primary-color);
  color: var(--white);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  text-decoration: none;
  z-index: 100;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 6px;
}

/* Accessibility Toolbar */
.accessibility-toolbar {
  position: fixed;
  left: var(--space-6);
  bottom: var(--space-6);
  z-index: var(--z-fixed);
}

.accessibility-toggle {
  width: 50px;
  height: 50px;
  background: var(--accent-color);
  color: var(--white);
  border: none;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.accessibility-panel {
  position: absolute;
  bottom: 60px;
  left: 0;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: var(--space-4);
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--transition-normal);
}

.accessibility-toolbar:hover .accessibility-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* PWA Install Banner */
.install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  box-shadow: var(--shadow-xl);
  padding: var(--space-4);
  z-index: var(--z-toast);
  transform: translateY(100%);
  animation: slideUp var(--transition-normal) forwards;
}

@keyframes slideUp {
  to {
    transform: translateY(0);
  }
}

.install-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
}

/* Form Enhancements */
.form-control {
  padding: var(--space-3) var(--space-4);
  border: 2px solid var(--medium-gray);
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  transition: all var(--transition-fast);
  background: var(--white);
}

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

.form-label {
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: var(--space-2);
}

/* Responsive Design */
@media (max-width: 1200px) {
  .container {
    max-width: 1140px;
  }
}

@media (max-width: 992px) {
  .container {
    max-width: 960px;
  }
  .section-padding {
    padding: var(--space-16) 0;
  }
  .hero {
    min-height: 80vh;
  }
}

@media (max-width: 768px) {
  .container {
    max-width: 720px;
  }
  .section-padding {
    padding: var(--space-12) 0;
  }
  .hero {
    min-height: 70vh;
    padding-top: 80px;
  }
  .grid-auto-fit {
    grid-template-columns: 1fr;
  }
  .grid-auto-fill {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

@media (max-width: 576px) {
  .container {
    max-width: 540px;
  }
  .section-padding {
    padding: var(--space-10) 0;
  }
  .hero {
    min-height: 60vh;
  }

  .btn {
    padding: var(--space-3) var(--space-5);
    font-size: var(--text-sm);
  }

  .section-title {
    font-size: var(--text-3xl);
  }

  .back-to-top,
  .accessibility-toggle {
    width: 45px;
    height: 45px;
    bottom: var(--space-4);
  }

  .back-to-top {
    right: var(--space-4);
  }

  .accessibility-toolbar {
    left: var(--space-4);
  }
}

/* Print Styles */
@media print {
  .navbar,
  .back-to-top,
  .accessibility-toolbar,
  .install-banner {
    display: none !important;
  }

  .hero {
    min-height: auto;
    padding: var(--space-8) 0;
  }

  body {
    font-size: 12pt;
    line-height: 1.4;
  }

  h1 {
    font-size: 18pt;
  }
  h2 {
    font-size: 16pt;
  }
  h3 {
    font-size: 14pt;
  }
}
