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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  color: #2d2d2d;
  background: #faf9f7;
}

/* Alert Banner */
.alert-banner {
  background: #f8f4e8;
  border-bottom: 1px solid #d4c9a8;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  position: relative;
}

.alert-banner.hidden {
  display: none;
}

.alert-content {
  font-size: 0.88rem;
  color: #4a4535;
  max-width: 900px;
  line-height: 1.6;
}

.alert-content strong {
  color: #5a4a2a;
}

.alert-content a {
  color: #1e3a5f;
  font-weight: 500;
  margin-left: 4px;
}

.alert-content a:hover {
  text-decoration: none;
}

.alert-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: #8a7a5a;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.alert-close:hover {
  color: #5a4a2a;
}

@media (max-width: 600px) {
  .alert-banner {
    padding: 12px 48px 12px 16px;
  }

  .alert-content {
    font-size: 0.82rem;
  }
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-wide {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
header {
  border-bottom: 1px solid #d8d4cc;
  padding: 14px 0;
  position: sticky;
  top: 0;
  background: #faf9f7;
  z-index: 100;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1100px;
}

.logo {
  font-size: 1.05rem;
  font-weight: 600;
  color: #1e3a5f;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.logo span {
  color: #5a7a9a;
  font-weight: 400;
}

nav a {
  color: #5c5c5c;
  text-decoration: none;
  margin-left: 24px;
  font-size: 0.85rem;
  transition: color 0.2s;
}

nav a:hover {
  color: #1e3a5f;
}

/* Hero */
.hero {
  padding: 36px 0 28px;
  text-align: center;
  background: #f4f2ed;
  border-bottom: 1px solid #d8d4cc;
}

.hero h1 {
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 1.65rem;
  font-weight: 400;
  margin-bottom: 8px;
  color: #1e3a5f;
}

.hero p {
  color: #5c5c5c;
  max-width: 460px;
  margin: 0 auto;
  font-size: 0.92rem;
}

/* Tabs */
.tabs-container {
  background: #f4f2ed;
  border-bottom: 1px solid #d8d4cc;
  padding: 0;
}

.tabs {
  display: flex;
  gap: 0;
}

.tab-btn {
  padding: 14px 24px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #666;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: #1e3a5f;
  background: rgba(30, 58, 95, 0.05);
}

.tab-btn.active {
  color: #1e3a5f;
  border-bottom-color: #1e3a5f;
  background: transparent;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Directory Section */
.directory-section {
  padding: 28px 0;
}

.directory-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.search-box {
  flex: 1;
  max-width: 320px;
}

#institution-search {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.9rem;
  border: 1px solid #c5c0b6;
  border-radius: 3px;
  background: #fff;
  color: #2d2d2d;
}

#institution-search:focus {
  outline: none;
  border-color: #1e3a5f;
  box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.1);
}

#institution-search::placeholder {
  color: #999;
}

.results-count {
  font-size: 0.82rem;
  color: #777;
}

/* Directory Layout */
.directory-layout {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}

/* Filters Sidebar */
.filters-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid #e5e2db;
  border-radius: 4px;
  padding: 20px;
  position: sticky;
  top: 70px;
}

.filter-group {
  margin-bottom: 24px;
}

.filter-group:last-of-type {
  margin-bottom: 20px;
}

.filter-group h3 {
  font-size: 0.72rem;
  font-weight: 600;
  color: #1e3a5f;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}

.filter-checkbox {
  display: flex;
  align-items: center;
  padding: 6px 0;
  cursor: pointer;
  font-size: 0.85rem;
  color: #444;
}

.filter-checkbox input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.checkmark {
  width: 16px;
  height: 16px;
  border: 1px solid #c5c0b6;
  border-radius: 3px;
  margin-right: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  transition: all 0.15s;
}

.filter-checkbox input:checked ~ .checkmark {
  background: #1e3a5f;
  border-color: #1e3a5f;
}

.filter-checkbox input:checked ~ .checkmark::after {
  content: "";
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

.filter-checkbox:hover .checkmark {
  border-color: #1e3a5f;
}

.label-text {
  flex: 1;
}

.filter-count {
  font-size: 0.75rem;
  color: #999;
  margin-left: 6px;
}

.clear-filters {
  width: 100%;
  padding: 8px 12px;
  font-size: 0.8rem;
  color: #666;
  background: #f5f4f2;
  border: 1px solid #ddd;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
}

.clear-filters:hover {
  background: #eee;
  color: #333;
}

/* Results Container */
.results-container {
  flex: 1;
  min-width: 0;
}

.mobile-filter-btn {
  display: none;
  width: 100%;
  padding: 10px;
  margin-bottom: 16px;
  font-size: 0.85rem;
  color: #1e3a5f;
  background: #fff;
  border: 1px solid #d8d4cc;
  border-radius: 3px;
  cursor: pointer;
}

/* Institution List */
.institution-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.institution-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #e5e2db;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.institution-item:hover {
  border-color: #1e3a5f;
  box-shadow: 0 2px 6px rgba(30, 58, 95, 0.06);
}

.institution-item.selected {
  border-color: #1e3a5f;
  border-left: 3px solid #1e3a5f;
  background: #f8f7f5;
}

.inst-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.inst-badge {
  min-width: 52px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e3a5f 0%, #2d4a6f 100%);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 4px;
  flex-shrink: 0;
  padding: 0 6px;
}

.institution-item.type-applied .inst-badge {
  background: linear-gradient(135deg, #4a6741 0%, #5a7751 100%);
}

.institution-item.type-arts .inst-badge {
  background: linear-gradient(135deg, #6b4c7a 0%, #7b5c8a 100%);
}

.institution-item.type-specialized .inst-badge {
  background: linear-gradient(135deg, #7a5c41 0%, #8a6c51 100%);
}

.inst-name {
  font-weight: 500;
  color: #2d2d2d;
  font-size: 0.92rem;
}

.inst-short {
  display: none;
}

.inst-type {
  font-size: 0.7rem;
  color: #999;
  background: #f0efed;
  padding: 3px 8px;
  border-radius: 3px;
  flex-shrink: 0;
}

.inst-arrow {
  color: #bbb;
  font-size: 1rem;
  margin-left: 12px;
  transition: all 0.15s;
}

.institution-item:hover .inst-arrow {
  color: #1e3a5f;
  transform: translateX(2px);
}

/* No Results */
.no-results {
  padding: 40px 20px;
  text-align: center;
  color: #888;
  font-size: 0.92rem;
}

/* Services Section */
.services-section {
  padding: 28px 0 36px;
  display: none;
  background: #f4f2ed;
  border-top: 1px solid #d8d4cc;
}

.services-section.active {
  display: block;
}

.services-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.services-info {
  flex: 1;
}

.services-type {
  font-size: 0.7rem;
  font-weight: 600;
  color: #5a7a9a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.services-header h2 {
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 1.2rem;
  font-weight: 500;
  color: #1e3a5f;
  margin-bottom: 4px;
}

.services-header p {
  font-size: 0.85rem;
  color: #666;
}

.website-link {
  color: #5a7a9a;
  text-decoration: none;
  font-size: 0.8rem;
  padding: 6px 12px;
  border: 1px solid #d8d4cc;
  border-radius: 3px;
  background: #fff;
  transition: all 0.15s;
}

.website-link:hover {
  color: #1e3a5f;
  border-color: #1e3a5f;
}

/* Contact Person Card */
.contact-person-card {
  background: #fff;
  border: 1px solid #d8d4cc;
  border-left: 3px solid #1e3a5f;
  border-radius: 4px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

.contact-person-header {
  font-size: 0.7rem;
  font-weight: 600;
  color: #5a7a9a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.contact-person-name {
  font-size: 1rem;
  font-weight: 600;
  color: #1e3a5f;
  margin-bottom: 2px;
}

.contact-person-role {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 10px;
}

.contact-person-email,
.contact-person-phone {
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.contact-person-email a,
.contact-person-phone a {
  color: #5a7a9a;
  text-decoration: none;
}

.contact-person-email a:hover,
.contact-person-phone a:hover {
  color: #1e3a5f;
  text-decoration: underline;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (max-width: 600px) {
  .service-grid {
    grid-template-columns: 1fr;
  }
}

.service-card {
  background: #fff;
  border: 1px solid #d8d4cc;
  border-radius: 4px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.15s;
}

.service-card:hover {
  border-color: #1e3a5f;
  box-shadow: 0 2px 6px rgba(30, 58, 95, 0.06);
}

.service-card.unavailable {
  opacity: 0.4;
  cursor: not-allowed;
}

.service-card.unavailable:hover {
  border-color: #d8d4cc;
  box-shadow: none;
}

.service-card .icon {
  font-size: 0.65rem;
  margin-bottom: 6px;
  color: #1e3a5f;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.service-card h3 {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 4px;
  color: #2d2d2d;
}

.service-card p {
  font-size: 0.78rem;
  color: #666;
  line-height: 1.4;
}

/* Service Detail */
.service-detail {
  display: none;
  padding: 28px 0 36px;
  background: #f4f2ed;
}

.service-detail.active {
  display: block;
}

.back-button {
  color: #5a7a9a;
  font-size: 0.85rem;
  margin-bottom: 16px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  transition: color 0.2s;
}

.back-button:hover {
  color: #1e3a5f;
}

.detail-card {
  background: #fff;
  border: 1px solid #d8d4cc;
  border-radius: 4px;
  padding: 24px;
}

.detail-card h2 {
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 1.15rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: #1e3a5f;
}

.detail-card .description {
  color: #555;
  margin-bottom: 20px;
  line-height: 1.6;
}

.detail-card .info-row {
  display: flex;
  margin-bottom: 10px;
  font-size: 0.85rem;
}

.detail-card .info-label {
  font-weight: 500;
  min-width: 80px;
  color: #666;
}

.detail-card .info-value a {
  color: #5a7a9a;
  text-decoration: none;
  word-break: break-all;
}

.detail-card .info-value a:hover {
  color: #1e3a5f;
  text-decoration: underline;
}

.visit-button {
  display: inline-block;
  margin-top: 20px;
  padding: 10px 20px;
  background: #1e3a5f;
  color: #fff;
  text-decoration: none;
  border-radius: 3px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.2s;
}

.visit-button:hover {
  background: #2a4a73;
}

.badge {
  display: inline-block;
  padding: 3px 8px;
  font-size: 0.65rem;
  font-weight: 500;
  border-radius: 2px;
  margin-left: 8px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
}

.badge-free {
  background: #e8f0e8;
  color: #3d6b3d;
}

/* National Resources */
.national-resources {
  padding: 40px 0;
  background: #fff;
  border-top: 1px solid #d8d4cc;
}

.national-resources h2 {
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 4px;
  text-align: center;
  color: #1e3a5f;
}

.national-resources > .container > p {
  text-align: center;
  color: #666;
  margin-bottom: 24px;
  font-size: 0.88rem;
}

.resources-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (max-width: 600px) {
  .resources-grid {
    grid-template-columns: 1fr;
  }
}

.resource-card {
  background: #faf9f7;
  border: 1px solid #e5e2db;
  border-radius: 4px;
  padding: 16px;
}

.resource-card.emergency {
  border-left: 3px solid #9b3c3c;
  background: #fdfbfb;
}

.resource-card.crisis {
  border-left: 3px solid #8b6914;
  background: #fdfcf8;
}

.resource-card h3 {
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 4px;
  color: #2d2d2d;
}

.resource-card .phone {
  font-size: 1.05rem;
  font-weight: 600;
  color: #1e3a5f;
  margin-bottom: 4px;
}

.resource-card p {
  font-size: 0.78rem;
  color: #666;
  margin-bottom: 8px;
  line-height: 1.4;
}

.resource-card a {
  color: #5a7a9a;
  text-decoration: none;
  font-size: 0.78rem;
}

.resource-card a:hover {
  color: #1e3a5f;
  text-decoration: underline;
}

/* Footer */
footer {
  border-top: 1px solid #d8d4cc;
  padding: 28px 0;
  text-align: center;
  background: #f4f2ed;
}

footer p {
  color: #666;
  font-size: 0.78rem;
  margin-bottom: 4px;
}

footer a {
  color: #5a7a9a;
  text-decoration: none;
}

footer a:hover {
  color: #1e3a5f;
  text-decoration: underline;
}

.footer-heart {
  margin-top: 12px;
  color: #8a7a6a;
  font-size: 0.82rem;
}

.footer-contact {
  margin-top: 8px;
  font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 800px) {
  .directory-layout {
    flex-direction: column;
  }

  .filters-sidebar {
    display: none;
    width: 100%;
    position: static;
    margin-bottom: 20px;
  }

  .filters-sidebar.active {
    display: block;
  }

  .mobile-filter-btn {
    display: block;
  }
}

@media (max-width: 600px) {
  .hero h1 {
    font-size: 1.35rem;
  }

  .hero p {
    font-size: 0.88rem;
  }

  header .container {
    flex-direction: column;
    gap: 10px;
  }

  nav {
    display: flex;
    gap: 16px;
  }

  nav a {
    margin-left: 0;
  }

  .directory-header {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box {
    max-width: none;
  }

  .services-header {
    flex-direction: column;
  }

  .detail-card .info-row {
    flex-direction: column;
  }

  .detail-card .info-label {
    margin-bottom: 2px;
  }
}

/* Accessibility */
*:focus-visible {
  outline: 2px solid #1e3a5f;
  outline-offset: 2px;
}

/* Iran Support Page */
.support-hero {
  padding: 48px 0 36px;
  text-align: center;
  background: #f4f2ed;
  border-bottom: 1px solid #d8d4cc;
}

.support-hero h1 {
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 1.8rem;
  font-weight: 400;
  color: #1e3a5f;
  margin-bottom: 8px;
}

.support-hero .subtitle {
  font-size: 1.1rem;
  color: #5a7a9a;
}

.support-content {
  padding: 36px 0 48px;
}

.message-card {
  background: #fff;
  border: 1px solid #d8d4cc;
  border-radius: 6px;
  padding: 32px;
  margin-bottom: 36px;
  max-width: 700px;
}

.message-card p {
  color: #3d3d3d;
  line-height: 1.7;
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.message-card p:last-child {
  margin-bottom: 0;
}

.message-card .highlight {
  font-weight: 600;
  color: #1e3a5f;
  font-size: 1.05rem;
}

.action-section {
  margin-bottom: 40px;
}

.action-section h2 {
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 1.2rem;
  font-weight: 500;
  color: #1e3a5f;
  margin-bottom: 8px;
}

.action-section p {
  color: #5c5c5c;
  margin-bottom: 16px;
  font-size: 0.92rem;
}

.action-button {
  display: inline-block;
  background: #1e3a5f;
  color: #fff;
  padding: 12px 24px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.2s;
}

.action-button:hover {
  background: #2d4a6f;
}

.contacts-section {
  margin-bottom: 40px;
}

.contacts-section h2 {
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 1.2rem;
  font-weight: 500;
  color: #1e3a5f;
  margin-bottom: 8px;
}

.contacts-section > p {
  color: #5c5c5c;
  margin-bottom: 20px;
  font-size: 0.92rem;
}

.contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.contact-card {
  background: #fff;
  border: 1px solid #d8d4cc;
  border-radius: 6px;
  padding: 20px;
}

.contact-university {
  font-size: 0.75rem;
  color: #5a7a9a;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 8px;
}

.contact-name {
  font-weight: 600;
  color: #2d2d2d;
  font-size: 1rem;
  margin-bottom: 2px;
}

.contact-role {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 12px;
}

.contact-links a {
  font-size: 0.85rem;
  color: #1e3a5f;
  text-decoration: none;
}

.contact-links a:hover {
  text-decoration: underline;
}

.contacts-note {
  font-size: 0.85rem;
  color: #888;
  font-style: italic;
}

.contacts-note a {
  color: #5a7a9a;
}

.crisis-section {
  background: #fef8f5;
  border: 1px solid #e8d8d0;
  border-radius: 6px;
  padding: 24px;
  max-width: 500px;
}

.crisis-section h2 {
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 1.1rem;
  font-weight: 500;
  color: #8a5a4a;
  margin-bottom: 8px;
}

.crisis-section p {
  color: #5c5c5c;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.crisis-section ul {
  list-style: none;
}

.crisis-section li {
  font-size: 0.9rem;
  color: #3d3d3d;
  margin-bottom: 6px;
}

@media (max-width: 600px) {
  .support-hero {
    padding: 36px 0 28px;
  }

  .support-hero h1 {
    font-size: 1.4rem;
  }

  .message-card {
    padding: 24px;
  }

  .contacts-grid {
    grid-template-columns: 1fr;
  }
}
