/*
  Maarif MN - Islamic Institute Website
  Elegant color scheme based on Maarif logo
  Primary: Rangoon Green (#080705) - Deep, sophisticated base
  Secondary: Earls Green (#bca633) - Warm, Islamic gold tone  
  Accent: Gray (#848484) - Subtle neutral balance
  Highlight: Yukon Gold (#d4af37) - Rich accent highlights
  Background: White (#ffffff) - Clean, clear reading experience
*/

:root {
  /* Brand Colors - Directly from Maarif Logo */
  --rangoon-green: #080705;
  --earls-green: #bca633;
  --muted-gray: #848484;
  --yukon-gold: #d4af37;
  --pure-white: #ffffff;
  
  /* Semantic Color System */
  --color-primary: var(--rangoon-green);
  --color-primary-rgb: 8, 7, 5;
  --color-primary-light: #2a2720;
  --color-primary-lighter: #4a453a;
  --color-secondary: var(--earls-green);
  --color-secondary-light: #d4c44a;
  --color-secondary-lighter: #e6d466;
  --color-accent: var(--yukon-gold);
  --color-accent-light: #e6c963;
  --color-muted: var(--muted-gray);
  --color-muted-light: #a8a8a8;
  --color-muted-lighter: #c8c8c8;
  
  /* Background & Text - White-focused for clarity */
  --color-bg: var(--pure-white);
  --color-bg-secondary: #fafafa;
  --color-bg-accent: #f8f8f8;
  --color-text: var(--rangoon-green);
  --color-text-light: var(--muted-gray);
  --color-text-lighter: #a8a8a8;
  --color-text-inverse: var(--pure-white);
  
  /* Surface Colors */
  --color-surface: var(--pure-white);
  --color-surface-elevated: #fdfdfd;
  --color-surface-accent: #f9f9f9;
  --color-border: #e8e8e8;
  --color-border-light: #f2f2f2;
  --color-border-accent: var(--earls-green);
  
  /* Interactive States */
  --color-hover: rgba(188, 166, 51, 0.12);
  --color-active: rgba(188, 166, 51, 0.18);
  --color-focus: var(--earls-green);
  --color-selected: rgba(212, 175, 55, 0.15);
  
  /* Typography - Elegant and readable */
  --font-primary: 'SF Pro Display', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-heading: var(--font-primary);
  --font-body: var(--font-primary);
  
  --font-size-xs: 0.75rem;      /* 12px */
  --font-size-sm: 0.875rem;     /* 14px */
  --font-size-base: 1rem;       /* 16px */
  --font-size-lg: 1.125rem;     /* 18px */
  --font-size-xl: 1.25rem;      /* 20px */
  --font-size-2xl: 1.5rem;      /* 24px */
  --font-size-3xl: 1.875rem;    /* 30px */
  --font-size-4xl: 2.25rem;     /* 36px */
  --font-size-5xl: 3rem;        /* 48px */
  
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  /* Spacing Scale */
  --space-xs: 0.25rem;    /* 4px */
  --space-sm: 0.5rem;     /* 8px */
  --space-md: 1rem;       /* 16px */
  --space-lg: 1.5rem;     /* 24px */
  --space-xl: 2rem;       /* 32px */
  --space-2xl: 3rem;      /* 48px */
  --space-3xl: 4rem;      /* 64px */
  --space-4xl: 6rem;      /* 96px */
  
  /* Layout */
  --max-width: 1200px;
  --max-width-content: 800px;
  --container-padding: var(--space-lg);
  --header-height: 80px;
  
  /* Border Radius */
  --radius-xs: 0.125rem;   /* 2px */
  --radius-sm: 0.25rem;    /* 4px */
  --radius-md: 0.5rem;     /* 8px */
  --radius-lg: 0.75rem;    /* 12px */
  --radius-xl: 1rem;       /* 16px */
  --radius-2xl: 1.5rem;    /* 24px */
  --radius-full: 9999px;
  
  /* Shadows - Soft and elegant */
  --shadow-xs: 0 1px 2px 0 rgba(8, 7, 5, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(8, 7, 5, 0.1), 0 1px 2px 0 rgba(8, 7, 5, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(8, 7, 5, 0.1), 0 2px 4px -1px rgba(8, 7, 5, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(8, 7, 5, 0.1), 0 4px 6px -2px rgba(8, 7, 5, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(8, 7, 5, 0.1), 0 10px 10px -5px rgba(8, 7, 5, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(8, 7, 5, 0.25);
  
  /* Transitions - Removed for smoother experience */
  --transition-fast: 0s;
  --transition: 0s;
  --transition-slow: 0s;
  
  /* Z-index scale */
  --z-dropdown: 50;
  --z-sticky: 60;
  --z-overlay: 70;
  --z-modal: 80;
  --z-popover: 90;
  --z-tooltip: 100;
}

/* Dark Mode Overrides - Sophisticated dark theme - COMMENTED OUT (Light mode only) */
/*
.dark {
  --color-bg: #0a0905;
  --color-bg-secondary: #141210;
  --color-bg-accent: #1c1915;
  --color-text: #f8f8f2;
  --color-text-light: #d1d1c9;
  --color-text-lighter: #a8a89f;
  --color-surface: #141210;
  --color-surface-elevated: #1c1915;
  --color-surface-accent: #242017;
  --color-border: #2d2a1f;
  --color-border-light: #363229;
  --color-hover: rgba(188, 166, 51, 0.2);
  --color-active: rgba(188, 166, 51, 0.3);
  --color-selected: rgba(212, 175, 55, 0.25);
}
*/

/* Reset and Base Styles */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
  margin: 0 0 var(--space-md) 0;
  color: var(--color-text);
}

h1 {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-lg);
}

h2 {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-semibold);
}

h3 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-semibold);
}

p {
  margin: 0 0 var(--space-md) 0;
  max-width: 70ch;
}

/* Images and Media */
img, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Accessibility */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Focus styles */
*:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Layout Components */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.container-narrow {
  max-width: var(--max-width-content);
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* Header Styles - Elegant gradient with logo branding */
.site-header {
  background: linear-gradient(135deg, var(--rangoon-green) 0%, var(--color-primary-light) 50%, var(--rangoon-green) 100%);
  color: var(--color-text-inverse);
  padding: var(--space-md) 0;
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(188, 166, 51, 0.2);
}

/* Header Content Layout - Traditional web style: Brand left, Navigation right */
.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  gap: var(--space-lg);
}

/* Brand Name - Left side with proper spacing */
.brand-name {
  flex-shrink: 0;
}

.brand-name a {
  color: var(--color-text-inverse);
  text-decoration: none;
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-xl);
  letter-spacing: 1px;
  transition: var(--transition);
}

.brand-name a:hover {
  color: var(--yukon-gold);
}

/* Navigation positioned to right side of header */
.site-nav {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* Primary Navigation - Right aligned */
.primary-nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  list-style: none;
  margin: 0;
  padding: 0;
}

.primary-nav li {
  position: relative;
}

.primary-nav a {
  display: block;
  color: var(--color-text-inverse);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-base);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  transition: var(--transition);
  position: relative;
}

.primary-nav a:hover,
.primary-nav a.active {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
}

.primary-nav a.active::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  background: var(--yukon-gold);
  border-radius: var(--radius-full);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.6);
}

/* Dropdown Styles - Modern and elegant */
.dropdown {
  position: relative;
}

.dropdown > button {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  background: transparent;
  border: 0;
  font: inherit;
  color: var(--color-text-inverse);
  cursor: pointer;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-medium);
  transition: var(--transition);
}

.dropdown > button:hover {
  background: rgba(255, 255, 255, 0.15);
}

.dropdown-content {
  position: absolute;
  top: calc(100% + var(--space-sm));
  left: 0;
  background: var(--color-surface);
  color: var(--color-text);
  min-width: 240px;
  padding: var(--space-sm);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--color-border);
  display: none;
  z-index: var(--z-dropdown);
  backdrop-filter: blur(20px);
}

.dropdown-content a {
  display: block;
  color: var(--color-text);
  text-decoration: none;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-medium);
  transition: var(--transition);
}

.dropdown-content a:hover,
.dropdown-content a.active {
  background: var(--color-hover);
  color: var(--color-secondary);
}

.dropdown-content a.active {
  background: var(--color-selected);
  font-weight: var(--font-weight-semibold);
}

.dropdown[aria-expanded="true"] .dropdown-content {
  display: block;
}

/* Mobile Navigation Toggle */
.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  color: var(--color-text-inverse);
  font-size: var(--font-size-xl);
  cursor: pointer;
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Theme Toggle - COMMENTED OUT (Light mode only) */
/*
.theme-toggle {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.theme-toggle button {
  background: var(--yukon-gold);
  color: var(--rangoon-green);
  border: 0;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-full);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-base);
  cursor: pointer;
  box-shadow: var(--shadow-md);  
  transition: var(--transition);
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  min-width: 100px;
}

.theme-toggle button:hover {
  background: var(--color-accent-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.theme-toggle button:active {
  transform: translateY(0);
}
*/

/* Main Content - Clean white space with subtle shadows */
main {
  max-width: var(--max-width);
  margin: var(--space-2xl) auto;
  padding: var(--space-2xl) var(--space-xl);
  background: var(--color-surface);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
  position: relative;
  overflow: hidden;
}

/* Page Header Layout - Content on left, Logo on right */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-2xl);
  margin-bottom: var(--space-lg);
}

/* Special layout for registration and contact pages with forms */
.form-page {
  position: relative;
}

.form-page h1 {
  margin-bottom: var(--space-lg);
}

.form-page p {
  margin-bottom: var(--space-2xl);
}

/* Logo positioning for form pages - clean and consistent */
.form-page .page-logo {
  position: absolute;
  top: var(--space-2xl);
  right: var(--space-2xl);
  width: 160px;
  z-index: 1;
}

/* Adjust form container to avoid logo overlap */
.form-page form {
  margin-right: 200px;
  position: relative;
  z-index: 2;
}

/* Phone number input styling */
input[type="tel"] {
  font-family: monospace;
  letter-spacing: 1px;
}

.page-content {
  flex: 1;
  max-width: 60%;
}

.page-logo {
  flex-shrink: 0;
  width: 200px;
}

.content-logo {
  width: 100%;
  height: auto;
  opacity: 1;
  filter: drop-shadow(0 4px 8px rgba(8, 7, 5, 0.1));
}

/* Mobile responsive layout */
@media (max-width: 768px) {
  .page-header {
    flex-direction: column;
    gap: var(--space-lg);
    text-align: center;
  }
  
  .page-content {
    max-width: 100%;
  }
  
  .page-logo {
    width: 150px;
    align-self: center;
  }
  
  /* Form page mobile adjustments */
  .form-page .page-logo {
    position: static;
    margin: var(--space-xl) auto var(--space-2xl) auto;
    width: 140px;
    text-align: center;
  }
  
  .form-page form {
    margin-right: 0;
    max-width: 100%;
  }
}

main::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--earls-green), var(--yukon-gold), var(--earls-green));
  opacity: 0.8;
}

main h1 {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-xl);
  background: linear-gradient(135deg, var(--rangoon-green), var(--earls-green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

main h2 {
  color: var(--color-secondary);
  border-bottom: 2px solid var(--color-border-light);
  padding-bottom: var(--space-sm);
  margin-bottom: var(--space-lg);
}

main hr {
  border: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-border), transparent);
  margin: var(--space-2xl) 0;
}

/* Page Header with Logo Layout */
.page-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}

.page-content {
  flex: 1;
  min-width: 0; /* Prevents flex item from overflowing */
}

.page-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.content-logo {
  width: 200px;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.content-logo:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Form Styles - Beautiful and functional */
form {
  max-width: 600px;
}

form label {
  display: block;
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  color: var(--color-text);
  margin-bottom: var(--space-xs);
  margin-top: var(--space-lg);
}

form input,
form select,
form textarea {
  width: 100%;
  padding: var(--space-md);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--font-size-base);
  font-family: inherit;
  transition: var(--transition);
  margin-top: var(--space-xs);
}

form input:focus,
form select:focus,
form textarea:focus {
  outline: 0;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(188, 166, 51, 0.1);
  transform: translateY(-1px);
}

form input::placeholder,
form textarea::placeholder {
  color: var(--color-text-lighter);
}

/* Button Styles - Elegant with brand colors */
.btn,
form button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border: 0;
  border-radius: var(--radius-lg);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
  margin-top: var(--space-lg);
  letter-spacing: 0.3px;
}

.btn:hover,
form button[type="submit"]:hover {
  background: var(--color-primary-light);
}

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

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

.btn.secondary {
  background: var(--color-secondary);
  color: var(--rangoon-green);
}

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

/* Utility Classes */
.flow > * + * {
  margin-top: var(--flow-space, var(--space-md));
}

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

.text-muted {
  color: var(--color-text-light);
}

.highlight {
  color: var(--color-accent);
  font-weight: var(--font-weight-semibold);
}

/* Links */
a {
  color: var(--color-secondary);
  text-decoration: underline;
  text-decoration-color: rgba(188, 166, 51, 0.3);
  text-underline-offset: 3px;
  transition: var(--transition);
}

a:hover {
  color: var(--color-secondary-light);
  text-decoration-color: var(--color-secondary-light);
}

/* Footer - Elegant and understated */
footer {
  margin: var(--space-2xl) auto var(--space-xl);
  padding: var(--space-xl) var(--container-padding);
  max-width: var(--max-width);
  text-align: center;
  font-size: var(--font-size-sm);
  color: var(--color-text-lighter);
  border-top: 1px solid var(--color-border-light);
}

footer a {
  color: var(--color-secondary);
}

/* Dark Mode Specific Adjustments - COMMENTED OUT (Light mode only) */
/*
.dark main {
  box-shadow: var(--shadow-2xl);
  border-color: var(--color-border);
}

.dark .dropdown-content {
  background: var(--color-surface-elevated);
  border-color: var(--color-border);
  backdrop-filter: blur(20px);
}

.dark a {
  color: var(--color-secondary-light);
}

.dark a:hover {
  color: var(--color-secondary);
}
*/

/* Responsive Design - Mobile-first approach */
@media (max-width: 768px) {
  :root {
    --space-2xl: 2rem;
    --space-xl: 1.5rem;
    --container-padding: var(--space-md);
  }
  
  .nav-toggle {
    display: block;
    z-index: 20;
  }
  
  .header-content {
    justify-content: space-between;
  }
  
  .site-nav {
    position: relative;
  }
  
  .primary-nav {
    position: absolute;
    top: calc(100% + var(--space-md));
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--color-primary-light);
    padding: var(--space-lg) 0;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: none;
    z-index: var(--z-dropdown);
    justify-content: flex-start;
  }
  
  .primary-nav.open {
    display: flex;
  }
  
  .primary-nav li {
    width: 100%;
  }
  
  .primary-nav a {
    padding: var(--space-md) var(--space-xl);
    border-radius: 0;
  }
  
  .dropdown-content {
    position: static;
    box-shadow: none;
    border: 0;
    background: var(--color-primary-lighter);
    backdrop-filter: none;
    border-radius: 0;
    margin-top: 0;
    min-width: auto;
  }
  
  .dropdown-content a {
    color: var(--color-text-inverse);
    padding: var(--space-sm) var(--space-2xl);
  }
  
  .dropdown-content a:hover,
  .dropdown-content a.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text-inverse);
    transform: none;
  }
  
  main {
    margin: var(--space-xl) auto;
    padding: var(--space-xl) var(--space-lg);
    border-radius: var(--radius-xl);
  }
  
  main h1 {
    font-size: var(--font-size-3xl);
  }
  
  /* Page header responsive - stack logo below content on mobile */
  .page-header {
    flex-direction: column;
    align-items: center;
    gap: var(--space-xl);
    text-align: center;
  }
  
  .content-logo {
    width: 150px;
  }
  
  /* Theme toggle mobile styles - COMMENTED OUT (Light mode only)
  .theme-toggle {
    margin-left: var(--space-md);
  }
  
  .theme-toggle button {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-sm);
    min-width: 80px;
  }
  */
}

@media (max-width: 480px) {
  main h1 {
    font-size: var(--font-size-2xl);
  }
  
  .site-header .container {
    gap: var(--space-sm);
  }
  
  .logo-link {
    font-size: var(--font-size-base);
  }
  
  .logo-image {
    height: 36px;
  }
}

/* Animations - Removed for smoother experience */

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
