@font-face {
  font-family: 'Nastaliq';
  src: url('/fonts/IranNastaliq.ttf') format('truetype');
}

:root {
  --bg-main: #000;
  --panel-bg: linear-gradient(180deg, rgba(8, 12, 24, 0.98) 0%, rgba(3, 7, 18, 0.985) 100%);
  --card-bg: linear-gradient(180deg, rgba(8, 12, 24, 0.98) 0%, rgba(3, 7, 18, 0.985) 100%);
  
  --border-default: rgba(255, 255, 255, 0.1);
  --border-light: rgba(255, 255, 255, 0.22);
  --border-cyan: rgba(0, 210, 255, 0.35);
  --border-cyan-active: #00d2ff;
  --border-cyan-hover: rgba(0, 210, 255, 0.45);

  --accent-cyan: #00d2ff;
  --accent-blue: #0077ff;
  --accent-glow: rgba(0, 210, 255, 0.22);
  --accent-subtle-glow: rgba(0, 210, 255, 0.14);

  --text-primary: #e5eefc;
  --text-secondary: rgba(229, 238, 252, 0.85);
  --text-subtle: #7fdcff;
  --text-muted: rgba(229, 238, 252, 0.58);
  --text-placeholder: rgba(229, 238, 252, 0.45);

  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-pill: 20px;
}

* {
  box-sizing: border-box;
}

html {
  overflow-y: scroll;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-cyan) rgba(8, 12, 24, 0.8);
}

body {
  margin: 0;
  direction: rtl;
  font-family: 'Vazirmatn', sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  padding-bottom: 5px;
  line-height: 1.7;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  margin: 4px 0;
  border-radius: 10px;
  background: rgba(8, 12, 24, 0.85);
}

::-webkit-scrollbar-thumb {
  border: 2px solid rgba(8, 12, 24, 0.9);
  border-radius: 10px;
  background: linear-gradient(180deg, #5ddcff 0%, var(--accent-cyan) 45%, var(--accent-blue) 100%);
  box-shadow: inset 0 0 4px rgba(255, 255, 255, 0.18);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #8ae7ff 0%, var(--accent-cyan) 50%, #2e9bff 100%);
  box-shadow:
    0 0 12px rgba(0, 210, 255, 0.45),
    inset 0 0 6px rgba(255, 255, 255, 0.2);
}

::-webkit-scrollbar-thumb:active {
  background: linear-gradient(180deg, var(--accent-cyan) 0%, var(--accent-blue) 100%);
}

header {
  padding: 8px 8px 8px;
  margin-right: 20px;
  margin-left: 20px;
  border-bottom: 1px solid #444;
  font-family: 'Nastaliq';
  font-size: 34px;
  text-align: center;
}

header h1,
header .pageHeaderTitle {
  margin: 0;
  font-size: inherit;
  font-weight: normal;
  line-height: 2.7;
}

.social-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 2px;
  flex-wrap: wrap;
}

.social-link {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  color: #cdd9ea;
  transition: all 0.3s ease;
  text-decoration: none;
  border: 1px solid var(--border-light);
  -webkit-tap-highlight-color: transparent;
}

.social-link svg {
  width: 20px;
  height: 20px;
  display: block;
}

.social-link:hover {
  transform: translateY(-3px);
  color: #fff;
  border-color: rgba(0, 210, 255, 0.35);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35), 0 0 14px rgba(0, 210, 255, 0.15);
}

.social-link:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 3px;
}

.social-link.insta:hover { background: #E1306C; }
.social-link.telegram:hover { background: #0088cc; }
.social-link.whatsapp:hover { background: #25d366; }
.social-link.eitaa:hover { background: #ff6b00; }

.management-note {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
  margin-top: 10px;
  line-height: 1.7;
}

.page-container {
  width: 100%;
  max-width: 1400px;
  margin: auto;
  padding: 20px 20px 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.search-wrapper {
  position: sticky;
  top: 20px;
  z-index: 4;
  height: 35px;
  width: 640px;
  max-width: 100%;
  margin: 0 auto 20px;
  border: 1px solid var(--border-cyan);
  border-radius: var(--radius-pill);
  background: var(--panel-bg);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.8), inset 0 0 8px rgba(0, 0, 0, 0.92);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#search {
  position: relative;
  z-index: 2;
  width: 100%;
  margin: 0;
  display: block;
  padding: 8px 14px;
  border: none;
  outline: none;
  border-radius: var(--radius-pill);
  background: transparent;
  text-align: center;
  color: var(--text-primary);
  font-size: 17px;
  box-shadow: none;
  transition: color 0.3s ease;
}

#search::placeholder {
  text-align: center;
  color: var(--text-placeholder);
}

.search-wrapper:focus-within {
  border-color: var(--border-cyan-active);
  box-shadow: 0 0 14px var(--accent-glow), inset 0 0 8px rgba(0, 0, 0, 0.95);
}

mark.search-highlight,
.search-highlight {
  display: inline;
  padding: 0 4px;
  border-radius: 4px;
  background: var(--accent-cyan);
  color: #07111f;
  font-weight: 500;
  line-height: inherit;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.search-empty {
  width: 100%;
  text-align: center;
  color: rgba(229, 238, 252, 0.65);
  font-size: 15px;
  padding: 30px 0;
}

.user-guide-badge {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    color: #e5e7eb;
    font-size: 0.9rem;
}

.guide-icon {
    font-size: 1.2rem;
}

.doctor-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 16px;
  padding: 0 10px 110px;
  width: 100%;
  box-sizing: border-box;
}

.doctor-card {
  position: relative;
  flex: 0 1 160px;
  width: 160px;
  min-width: 0;
  box-sizing: border-box;
  padding: 10px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  cursor: pointer;
  text-align: center;
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.6),
    inset 0 0 8px rgba(0, 0, 0, 0.88);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.doctor-card:hover {
  border-color: var(--border-cyan-hover);
  transform: translateY(-4px);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.7),
    0 0 12px var(--accent-subtle-glow);
}

.doctor-card a {
  position: relative;
  z-index: 2;
  display: block;
  min-width: 0;
  width: 100%;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
}

.doctor-cover {
  position: relative;
  z-index: 2;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
}

.doctor-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.doctor-card:hover .doctor-cover img {
  transform: scale(1.08);
}

.doctor-name {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  max-width: 100%;
  margin-top: 6px;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 14px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.doctor-meta {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  max-width: 100%;
  margin-top: 4px;
  color: var(--text-subtle);
  font-size: 12px;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doctor-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;

  margin-top: 10px;
  padding: 5px 8px;

  border-radius: var(--radius-pill);

  color: #04101e;
  background: linear-gradient(
    135deg,
    #00d2ff 0%,
    #0077ff 100%
  );

  font-size: 12px;
  font-weight: 700;

  box-shadow: 0 2px 8px rgba(0, 210, 255, 0.35);

  user-select: none;

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

.doctor-card:hover .doctor-action-btn {
  filter: brightness(1.08);
  box-shadow: 0 4px 14px rgba(0, 210, 255, 0.6);
}

.btn-arrow {
  font-size: 12px;
  line-height: 1;
  transition: transform 0.2s ease;
}

.doctor-card:hover .btn-arrow {
  transform: translateX(-3px);
}

@keyframes touch-pulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.22);
  }
}

.btn-hand-icon {
  display: inline-block;

  font-size: 13px;
  line-height: 1;

  animation: touch-pulse 1.8s infinite ease-in-out;
}

.cinematic-logo-box {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;

  display: flex;
  align-items: center;
  gap: 16px;

  background: rgba(0, 0, 0, 0.35);
  padding: 8px 18px;
  border-radius: 14px;
  backdrop-filter: blur(8px);

  border: 1px solid rgba(255,255,255,0.07);

  transition: background 0.4s ease, border 0.4s ease, box-shadow 0.3s ease;
}

.cinematic-logo-box a,
.cinematic-logo-box > div {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
}

.cinematic-logo-box img,
#zibal-trust,
#zibal-trust img,
#zibal-trust svg {
  display: block;
  height: 52px !important;
  width: auto !important;
  max-width: 110px;
  object-fit: contain;
  transition: transform 0.25s ease, filter 0.25s ease;
  filter: drop-shadow(0 0 4px rgba(255,255,255,0.18));
}

.cinematic-logo-box img:hover,
#zibal-trust:hover,
#zibal-trust img:hover,
#zibal-trust svg:hover {
  transform: scale(1.06);
  filter: drop-shadow(0 0 8px rgba(255,255,255,0.32));
}

.eanjoman-logo img {
  height: 50px !important;
}

.enamad-logo img {
  height: 54px !important;
}

.nasr-logo img {
  height: 52px !important;
}

#zibal-trust,
#zibal-trust img,
#zibal-trust svg {
  height: 48px !important;
}

@media (max-width: 768px) {
  .page-container {
    padding: 20px 8px 2px;
  }

  .doctor-grid {
    gap: 12px;
    padding: 0 4px 100px;
    justify-content: center;
  }

  .doctor-card {
    flex: 0 1 calc(50% - 12px);
    width: calc(50% - 12px);
    max-width: 170px;
    padding: 10px;
  }

  .search-wrapper {
    width: 250px;
  }

  #search {
    font-size: 15px;
  }

  .social-wrapper {
    gap: 10px;
  }

  .social-link {
    width: 38px;
    height: 38px;
  }

  .management-note {
    font-size: 11px;
  }

  .cinematic-logo-box {
    justify-content: center;
    margin-right: auto;
    margin-left: auto;
    gap: 12px;
    padding: 10px 14px;
  }
}
