/* Custom Modern Academic Styling for Dr. Sarfi's Website */
@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/fonts/webfonts/Vazirmatn-font-face.css');

:root {
  --font-main: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-glass: rgba(255, 255, 255, 0.85);
  --border-color: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --primary: #1e3a8a;
  --primary-hover: #1e40af;
  --primary-light: #eff6ff;
  --accent: #0284c7;
  --accent-teal: #0f766e;
  --accent-teal-light: #f0fdfa;
  --accent-amber: #d97706;
  --card-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.05), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --card-shadow-hover: 0 20px 30px -10px rgba(30, 58, 138, 0.12), 0 10px 15px -5px rgba(30, 58, 138, 0.08);
  --header-height: 76px;
}

[data-theme="dark"] {
  --bg-primary: #090d16;
  --bg-surface: #111827;
  --bg-surface-glass: rgba(17, 24, 39, 0.88);
  --border-color: #1f2937;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-light: rgba(59, 130, 246, 0.12);
  --accent: #38bdf8;
  --accent-teal: #14b8a6;
  --accent-teal-light: rgba(20, 184, 166, 0.12);
  --accent-amber: #f59e0b;
  --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
  --card-shadow-hover: 0 20px 30px -10px rgba(59, 130, 246, 0.25);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 20px);
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.75;
  direction: rtl;
  text-align: right;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* Background Resilience Grid Pattern */
.resilience-bg-pattern {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--border-color) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at 50% 30%, black 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(circle at 50% 30%, black 20%, transparent 80%);
  opacity: 0.7;
  pointer-events: none;
  z-index: 0;
}

/* Header & Navigation */
header.sticky-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 50;
  transition: all 0.3s ease;
}

header.sticky-header.scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Custom badges */
.badge-academic {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-teal {
  background: var(--accent-teal-light);
  color: var(--accent-teal);
  border-color: rgba(20, 184, 166, 0.25);
}

/* Custom Cards */
.academic-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 1.75rem;
  box-shadow: var(--card-shadow);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.academic-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--primary);
}

/* Gradient borders & accents */
.top-gradient-border::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #1e3a8a, #0284c7, #0d9488);
}

/* Resilience Curve Visual Graphic */
.curve-box {
  position: relative;
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.04), rgba(13, 148, 136, 0.06));
  border-radius: 1rem;
  border: 1px dashed var(--border-color);
  padding: 1.5rem;
}

/* Accordion Styling */
.accordion-item {
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  background: var(--bg-surface);
  overflow: hidden;
  transition: all 0.25s ease;
  margin-bottom: 0.75rem;
}

.accordion-item.active {
  border-color: var(--primary);
  box-shadow: 0 4px 15px rgba(30, 58, 138, 0.06);
}

.accordion-trigger {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem;
  text-align: right;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  transition: color 0.2s ease;
}

.accordion-trigger:hover {
  color: var(--primary);
}

.accordion-icon {
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  transition: transform 0.3s ease;
}

.accordion-item.active .accordion-icon {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease-out;
  padding: 0 1.25rem;
  color: var(--text-muted);
}

.accordion-item.active .accordion-content {
  padding-bottom: 1.25rem;
}

/* Tabs */
.tab-btn {
  padding: 0.65rem 1.25rem;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
}

.tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.25);
}

/* Search Box */
.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  padding: 0.85rem 3rem 0.85rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.search-icon-pos {
  position: absolute;
  right: 1.1rem;
  color: var(--text-subtle);
  pointer-events: none;
}

/* Notification banner */
.announcement-banner {
  background: linear-gradient(90deg, #1e3a8a, #0369a1);
  color: #ffffff;
  padding: 0.6rem 1rem;
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-align: center;
}

/* Resilience Model Framework Visual */
.resilience-stage-card {
  border-right: 4px solid var(--accent);
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  border-left: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.25rem;
  transition: all 0.25s ease;
}

.resilience-stage-card:hover {
  transform: translateX(-4px);
  border-right-color: var(--primary);
}

/* Animations */
@keyframes pulseSlow {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.04); opacity: 1; }
}

.animate-pulse-slow {
  animation: pulseSlow 4s infinite ease-in-out;
}

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

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #334155;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Print Styles for Syllabus */
@media print {
  header, footer, .no-print, .accordion-icon {
    display: none !important;
  }
  .accordion-content {
    max-height: none !important;
    display: block !important;
  }
  body {
    background: white !important;
    color: black !important;
  }
  .academic-card {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    break-inside: avoid;
  }
}
