/* ========================================
   Directory Styles
   Exact replica of provider design with Chamber colors
   ======================================== */

/* Directory Header */
.dir-header {
  background: linear-gradient(135deg, #1a3a5c 0%, #0f2840 100%);
  color: #fff;
  padding: 40px 20px;
  text-align: center;
  position: relative;
}

.dir-header__content {
  max-width: 800px;
  margin: 0 auto;
}

.dir-header__logo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin-bottom: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.dir-header h1 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.dir-header p {
  font-size: 16px;
  opacity: 0.9;
  margin: 0;
}

.dir-header__stripe {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  display: flex;
}

.dir-header__stripe span {
  flex: 1;
}

.dir-header__stripe span:nth-child(1) { background: #b22234; }
.dir-header__stripe span:nth-child(2) { background: #fff; }
.dir-header__stripe span:nth-child(3) { background: #d4a534; }

/* Directory Layout */
.dir-layout {
  display: flex;
  min-height: calc(100vh - 200px);
  background: #f7f7f7;
}

/* Sidebar */
.dir-sidebar {
  width: 280px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid #e2e8f0;
  padding: 24px;
  position: sticky;
  top: 120px;
  height: calc(100vh - 120px);
  overflow-y: auto;
}

.dir-sidebar__header {
  display: none;
}

/* Search */
.dir-search {
  position: relative;
  margin-bottom: 24px;
}

.dir-search__icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #718096;
  pointer-events: none;
}

.dir-search__input {
  width: 100%;
  padding: 12px 12px 12px 40px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  transition: all 0.2s ease;
}

.dir-search__input:focus {
  outline: none;
  border-color: #1a3a5c;
  box-shadow: 0 0 0 3px rgba(26, 58, 92, 0.1);
}

.dir-search__input::placeholder {
  color: #a0aec0;
}

/* Categories */
.dir-categories__title {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #718096;
  margin-bottom: 12px;
}

.dir-categories__list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
  max-height: 400px;
  overflow-y: auto;
}

/* Category Item */
.dir-category {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.dir-category:hover {
  background: #f7fafc;
}

.dir-category.active {
  background: linear-gradient(135deg, #1a3a5c 0%, #0f2840 100%);
}

.dir-category__check {
  width: 18px;
  height: 18px;
  border: 2px solid #cbd5e0;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.dir-category__check svg {
  opacity: 0;
  color: #1a3a5c;
  transition: opacity 0.2s ease;
}

.dir-category.active .dir-category__check {
  background: #fff;
  border-color: #fff;
}

.dir-category.active .dir-category__check svg {
  opacity: 1;
}

.dir-category__name {
  flex: 1;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  color: #4a5568;
  transition: color 0.2s ease;
}

.dir-category.active .dir-category__name {
  color: #fff;
}

.dir-category__count {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #718096;
  background: #edf2f7;
  padding: 2px 8px;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.dir-category.active .dir-category__count {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* Clear Filters */
.dir-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  color: #718096;
  background: none;
  border: 2px dashed #cbd5e0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dir-clear:hover {
  border-color: #b22234;
  color: #b22234;
}

/* Main Content */
.dir-main {
  flex: 1;
  padding: 24px;
  min-width: 0;
}

/* Filter Toggle (Mobile) */
.dir-filter-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  margin-bottom: 16px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: #1a3a5c;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.dir-filter-toggle:hover {
  background: #0f2840;
}

/* Results Count */
.dir-results {
  margin-bottom: 20px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  color: #718096;
}

/* Business Cards Grid */
.dir-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

/* Business Card */
.dir-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}

.dir-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Featured Card */
.dir-card--featured {
  border: 2px solid #d4a534;
}

.dir-card__featured-banner {
  width: 100%;
  padding: 6px 12px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #0f2840;
  background: linear-gradient(135deg, #c9952c 0%, #f0d264 100%);
  text-align: center;
}

/* Card Logo */
.dir-card__logo {
  height: 140px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
}

.dir-card__logo img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.dir-card__logo--dark {
  background: #1a1a2e;
  border-bottom: none;
}

.dir-card__logo--dark span {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 32px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
}

/* Placeholder (no logo) gets navy background */
.dir-card__logo--placeholder {
  background: #0f2840;
}

/* Card Info */
.dir-card__info {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.dir-card__name {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: #2d3748;
  margin: 0 0 8px 0;
  line-height: 1.3;
}

/* Card Tags */
.dir-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
}

.dir-card__tag {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #1a3a5c;
  background: rgba(26, 58, 92, 0.1);
  padding: 2px 6px;
  border-radius: 10px;
}

/* Card Contact */
.dir-card__contact {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13px;
  color: #718096;
}

.dir-card__contact:last-of-type {
  margin-bottom: 0;
}

.dir-card__contact svg {
  flex-shrink: 0;
  color: #a0aec0;
}

.dir-card__contact a {
  color: #1a3a5c;
  text-decoration: none;
  transition: color 0.15s ease;
}

.dir-card__contact a:hover {
  color: #b22234;
  text-decoration: underline;
}

/* URL with truncation */
.dir-card__url {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
  display: inline-block;
}

/* Overlay */
.dir-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

.dir-overlay.active {
  display: block;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 900px) {
  .dir-sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100%;
    z-index: 1000;
    padding-top: 0;
    transition: left 0.3s ease;
  }

  .dir-sidebar.active {
    left: 0;
  }

  .dir-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    margin-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
  }

  .dir-sidebar__header h3 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
  }

  .dir-sidebar__close {
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: #718096;
    border-radius: 6px;
    transition: all 0.2s ease;
  }

  .dir-sidebar__close:hover {
    background: #f7fafc;
    color: #2d3748;
  }

  .dir-filter-toggle {
    display: flex;
  }

  .dir-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
  }
}

@media (max-width: 600px) {
  .dir-header {
    padding: 30px 16px;
  }

  .dir-header h1 {
    font-size: 22px;
  }

  .dir-header__logo {
    width: 80px;
    height: 80px;
  }

  .dir-main {
    padding: 16px;
  }

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

  .dir-card__logo {
    height: 120px;
  }
}
