*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:     #1b2a4a;
  --primary-mid: #2a3f6e;
  --accent:      #c9963b;
  --accent-light:#fef6e4;
  --text:        #1a1a1a;
  --text-muted:  #6b7280;
  --bg:          #faf9f6;
  --card-bg:     #ffffff;
  --border:      #e5e2dc;
  --shadow:      0 4px 16px rgba(0,0,0,0.06);
}

body {
  font-family: 'Segoe UI', 'Noto Kufi Arabic', Tahoma, sans-serif;
  direction: rtl;
  text-align: right;
  background: var(--bg);
  color: var(--text);
  transition: background 0.3s, color 0.3s;
  min-height: 100vh;
}

body.night-mode {
  --bg:          #0d1117;
  --card-bg:     #161b22;
  --text:        #e6e6e6;
  --text-muted:  #8b949e;
  --border:      #30363d;
  --shadow:      0 4px 16px rgba(0,0,0,0.3);
}

/* Navbar */
.navbar {
  background: var(--primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2.5rem;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
}
.nav-links { list-style: none; display: flex; gap: 0.5rem; align-items: center; }
.nav-links a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 0.88rem;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  transition: background 0.2s;
}
.nav-links a:hover { background: rgba(255,255,255,0.1); color: #fff; }

#nightModeBtn {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  padding: 0.3rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  transition: background 0.2s;
}
#nightModeBtn:hover { background: var(--accent); color: var(--primary); }

/* Hero */
.hero {
  background: linear-gradient(160deg, #1b2a4a 0%, #0f1a30 60%, #1a1a2e 100%);
  color: #fff;
  text-align: center;
  padding: 5rem 2rem 4rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -40%;
  left: -20%;
  width: 60%;
  height: 180%;
  background: radial-gradient(ellipse, rgba(201,150,59,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.hero-content h1 {
  font-size: 2.6rem;
  margin-bottom: 0.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 30%, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-content p {
  font-size: 1rem;
  opacity: 0.7;
  margin-bottom: 2rem;
}
.hero-text {
  max-width: 600px;
  margin: 0 auto;
}
.hero-text h2 {
  font-size: 1.3rem;
  margin-bottom: 0.8rem;
  font-weight: 600;
  color: var(--accent);
}
.hero-text p { line-height: 1.9; margin-bottom: 1.8rem; opacity: 0.75; font-size: 0.95rem; }

.hero-divider {
  width: 60px;
  height: 3px;
  background: var(--accent);
  margin: 1.5rem auto;
  border-radius: 2px;
}

/* Features section */
.features-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  padding: 3rem 2.5rem;
  max-width: 960px;
  margin: 0 auto;
}
.feature-card {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 1.8rem 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
  border-right: 3px solid var(--accent);
  transition: transform 0.2s;
  position: relative;
}
.feature-card:hover { transform: translateY(-2px); }
.feature-card .feature-num {
  display: inline-block;
  width: 32px;
  height: 32px;
  line-height: 32px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.8rem;
}
body.night-mode .feature-card .feature-num { background: rgba(201,150,59,0.15); }
.feature-card h3 { margin-bottom: 0.4rem; color: var(--primary); font-size: 1.05rem; }
body.night-mode .feature-card h3 { color: var(--accent); }
.feature-card p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.7; }

/* Gallery header */
.gallery-header {
  text-align: center;
  padding: 3rem 2rem 1rem;
}
.gallery-header h1 {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
  font-weight: 700;
}
body.night-mode .gallery-header h1 { color: var(--accent); }
.gallery-header p { color: var(--text-muted); font-size: 0.92rem; }

/* Filter bar */
.filter-bar {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  padding: 1rem 2.5rem 0;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
}
.search-input {
  flex: 1;
  min-width: 200px;
  padding: 0.55rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  direction: rtl;
  background: var(--card-bg);
  color: var(--text);
  transition: border-color 0.2s;
}
.search-input:focus { outline: none; border-color: var(--accent); }
.filter-select {
  padding: 0.55rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  background: var(--card-bg);
  color: var(--text);
  direction: rtl;
}
.filter-select:focus { outline: none; border-color: var(--accent); }
#resultCount { font-size: 0.85rem; color: var(--text-muted); }

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 2rem 2.5rem;
  max-width: 1100px;
  margin: 0 auto;
}
.region-card {
  background: var(--card-bg);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s;
  position: relative;
}
.region-card:hover { transform: translateY(-5px); box-shadow: 0 8px 30px rgba(0,0,0,0.12); }
body.night-mode .region-card:hover { box-shadow: 0 8px 30px rgba(0,0,0,0.4); }
.region-card img { width: 100%; height: 200px; object-fit: cover; }
.card-body { padding: 1rem 1.2rem; }
.card-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.3rem; }
.card-category {
  font-size: 0.75rem;
  background: var(--accent-light);
  color: var(--accent);
  padding: 0.2rem 0.7rem;
  border-radius: 4px;
  display: inline-block;
  font-weight: 600;
}
body.night-mode .card-category { background: rgba(201,150,59,0.15); }
.card-body p { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.5rem; line-height: 1.6; }

/* Details page */
.details-hero { position: relative; }
.details-hero img { width: 100%; max-height: 420px; object-fit: cover; display: block; }
.details-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(transparent, var(--bg));
  pointer-events: none;
}
.details-body { max-width: 780px; margin: -2rem auto 2rem; padding: 0 1.5rem; position: relative; z-index: 1; }
.details-body h1 { font-size: 2rem; margin-bottom: 0.3rem; font-weight: 700; }
.details-body .card-category { margin-bottom: 1rem; }
.details-body h2 { color: var(--primary); font-size: 1.15rem; margin-top: 2rem; margin-bottom: 0.5rem; font-weight: 700; }
body.night-mode .details-body h2 { color: var(--accent); }
.details-body ul { padding-right: 1.3rem; margin-top: 0.5rem; }
.details-body li { margin-bottom: 0.4rem; line-height: 1.7; color: var(--text-muted); }
.gallery-strip { display: flex; gap: 0.6rem; margin-top: 1rem; }
.gallery-strip img { width: calc(33.33% - 0.4rem); border-radius: 8px; object-fit: cover; height: 150px; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.3rem; font-weight: 600; font-size: 0.9rem; }
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: var(--card-bg);
  color: var(--text);
  font-size: 0.9rem;
  direction: rtl;
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { outline: none; border-color: var(--accent); }

/* Buttons */
.btn {
  padding: 0.6rem 1.5rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: none;
  display: inline-block;
  font-weight: 600;
  transition: opacity 0.2s;
}
.btn:hover { opacity: 0.88; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-danger  { background: #dc2626; color: #fff; }

/* Alert messages */
.alert { padding: 0.8rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-size: 0.9rem; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-error   { background: #fee2e2; color: #991b1b; }

/* Footer */
footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-top: 3rem;
  border-top: 1px solid var(--border);
}
