/* ============================================================
   Islamic History — Web UI Stylesheet
   Brand: Islamic History — ইসলামী ইতিহাসের এই দিনে
   Credits: Royal Technologies (https://www.royaltechbd.com/)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=Hind+Siliguri:wght@400;500;600;700&display=swap');

:root {
  --primary: #065f46;
  --primary-dark: #043927;
  --primary-light: #d1fae5;
  --gold: #d4af37;
  --gold-light: #fde68a;
  --gold-dark: #b45309;
  --emerald: #059669;
  --crimson: #be123c;
  --bg: #070e12;
  --card-bg: #0e1920;
  --card-border: #1b2d36;
  --text: #f3f4f6;
  --text-muted: #9ca3af;
  --soft-bg: #15242d;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --radius: 16px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body.light {
  --bg: #f8faf9;
  --card-bg: #ffffff;
  --card-border: #dbe4e0;
  --text: #0f172a;
  --text-muted: #475569;
  --soft-bg: #eef4f1;
  --gold: #b45309;
  --gold-light: #92400e;
  --primary: #065f46;
  --shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Hind Siliguri', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
}

/* ── Hero Section ── */
.hero {
  background: linear-gradient(135deg, #021a12 0%, #053827 45%, #0c1f2e 100%);
  color: #ffffff;
  padding: 52px 20px 44px;
  text-align: center;
  position: relative;
  overflow: hidden;
  border-bottom: 2px solid rgba(212, 175, 55, 0.4);
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.12) 0%, transparent 60%);
  pointer-events: none;
}

.hero-bismillah {
  font-family: 'Amiri', serif;
  font-size: 26px;
  color: var(--gold-light);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.hero-seal {
  font-size: 32px;
  margin-bottom: 6px;
  filter: drop-shadow(0 2px 8px rgba(212, 175, 55, 0.4));
}

.hero-brand {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  font-size: 14px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--gold-light);
  background: rgba(212, 175, 55, 0.14);
  border: 1px solid rgba(212, 175, 55, 0.32);
  padding: 5px 18px;
  border-radius: 999px;
  margin-bottom: 18px;
  font-weight: 600;
}

.hero h1 {
  font-size: clamp(26px, 4.5vw, 42px);
  font-weight: 700;
  margin-bottom: 14px;
  line-height: 1.3;
}

.hero h1 span {
  background: linear-gradient(120deg, var(--gold-light), #ffffff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  max-width: 700px;
  margin: 0 auto 28px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 17px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: var(--transition);
  font-family: inherit;
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #0b0f19;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.35);
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
}

.btn-glass {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  backdrop-filter: blur(8px);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-emerald {
  background: #059669;
  color: #ffffff;
}

.btn-emerald:hover {
  background: #047857;
  transform: translateY(-2px);
}

/* ── Stats Grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 18px;
  margin: 36px 0;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 20px;
  border-radius: var(--radius);
  text-align: center;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
}

.stat-icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.stat-card strong {
  display: block;
  font-size: 30px;
  color: var(--gold);
  line-height: 1.2;
  margin-bottom: 4px;
}

.stat-card span {
  font-size: 13.5px;
  color: var(--text-muted);
}

/* ── Today's Featured Showcase ── */
.today-showcase {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 30px;
  margin-bottom: 40px;
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 34px;
  align-items: center;
  box-shadow: var(--shadow);
}

.today-img-wrap {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  background: var(--soft-bg);
  aspect-ratio: 1 / 1;
}

.today-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.today-img-wrap:hover img {
  transform: scale(1.02);
}

.today-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.badge-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
}

.badge-gold {
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold);
  border-color: rgba(212, 175, 55, 0.4);
}

.badge-emerald {
  background: rgba(5, 150, 105, 0.15);
  color: #10b981;
  border-color: rgba(5, 150, 105, 0.4);
}

.badge-blue {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.4);
}

.badge-amber {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4);
}

body.light .badge-amber {
  color: #b45309;
  border-color: rgba(180, 83, 9, 0.35);
}

body.light .badge-blue {
  color: #0284c7;
  border-color: rgba(2, 132, 199, 0.35);
}

body.light .badge-emerald {
  color: #047857;
  border-color: rgba(4, 120, 87, 0.35);
}

.today-year-pill {
  font-size: 26px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.5px;
}

.today-title {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.35;
}

.today-summary {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.65;
  background: var(--soft-bg);
  padding: 16px 20px;
  border-radius: 10px;
  border-left: 4px solid var(--gold);
}

.today-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* ── Filter & Search Bar ── */
.tools-bar {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
}

.filter-grid-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 16px;
}

.input-group input, .input-group select {
  width: 100%;
  padding: 12px 16px;
  background: var(--soft-bg);
  border: 1px solid var(--card-border);
  color: var(--text);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}

.input-group input:focus, .input-group select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

/* Category Pills Bar */
.category-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--card-border);
}

.pill-btn {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: var(--soft-bg);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.pill-btn:hover, .pill-btn.active {
  background: var(--gold);
  color: #000000;
  border-color: var(--gold);
}

/* ── Event Cards Grid ── */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 24px;
  margin-bottom: 60px;
}

.history-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
}

.history-card:hover {
  transform: translateY(-5px);
  border-color: var(--gold);
}

.history-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.history-year-tag {
  font-size: 20px;
  font-weight: 700;
  color: var(--gold);
}

.history-card h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.4;
}

.history-card p {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
  flex-grow: 1;
  margin-bottom: 18px;
}

.history-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid var(--card-border);
  font-size: 13px;
  color: var(--text-muted);
}

.history-card-actions {
  display: flex;
  gap: 8px;
}

.btn-icon {
  padding: 6px 12px;
  font-size: 13px;
}

/* ── Modal ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal-content {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  max-width: 600px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  padding: 24px 28px;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.modal-box {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  max-width: 540px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  padding: 20px 24px;
  position: relative;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.preview-canvas-wrap {
  width: 100%;
  max-width: 440px;
  margin: 14px auto;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  background: #000;
  aspect-ratio: 1 / 1;
}

.preview-canvas-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.card-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  background: rgba(212, 175, 55, 0.12);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(212, 175, 55, 0.25);
}

.card-sig-box {
  font-size: 13.5px;
  color: var(--gold-light);
  background: var(--soft-bg);
  padding: 10px 14px;
  border-radius: 8px;
  border-left: 3px solid var(--gold);
  margin-bottom: 12px;
  line-height: 1.5;
}

.card-ref-box {
  font-size: 12.5px;
  color: var(--text-muted);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
}

/* ── Toast Notification ── */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #042118;
  color: #ffffff;
  padding: 14px 24px;
  border-radius: 12px;
  border: 1px solid var(--gold);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 1000;
  font-size: 15px;
  font-weight: 500;
}

.toast.show {
  display: block;
  animation: slideUp 0.3s ease;
}

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

/* ── Footer ── */
footer {
  margin-top: auto;
  background: var(--card-bg);
  border-top: 1px solid var(--card-border);
  padding: 30px 20px;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}

footer a {
  color: var(--gold);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .today-showcase {
    grid-template-columns: 1fr;
  }
  .filter-grid-row {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (max-width: 600px) {
  .filter-grid-row {
    grid-template-columns: 1fr !important;
  }
  .hero {
    padding: 40px 16px;
  }
}
