/*
   ASC Catalog — v4.0 styles
   Минималистичный и современный дизайн для каталога специалистов
*/

:root {
  --asc-primary-color: #181923;
  --asc-primary-hover: #111216;
  --asc-border-color: #e4e7eb;
  --asc-bg-light: #f9fafb;
  --asc-text-dark: #1f2937;
  --asc-text-light: #6b7280;
  --asc-success-bg: #f0fdf4;
  --asc-success-text: #166534;
  --asc-error-bg: #fef2f2;
  --asc-error-text: #b91c1c;
}

/* Base */
#specialists-catalog-wrapper {
  width: 100%;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--asc-text-dark);
}

/* Ошибки валидации */
.asc-has-error {
  border-color: #b91c1c !important;
  box-shadow: 0 0 0 3px rgba(185,28,28,.15) !important;
}
.social-icon-link.instagram:hover { background: #E4405F; border-color: #E4405F; }

/* Add button */
.asc-add-button-wrapper { display: flex; justify-content: flex-end; margin-bottom: 20px; }
.asc-open-modal-btn {
  padding: 12px 24px; font-size: 15px; font-weight: 600; color: #fff;
  background-color: var(--asc-primary-color); border: none; border-radius: 8px; cursor: pointer;
  transition: background-color .2s, box-shadow .2s;
}
.asc-open-modal-btn:hover { background: var(--asc-primary-hover); box-shadow: 0 4px 10px rgba(0,86,179,.2); }

/* Filters */
.specialists-filters {
  display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 30px; padding: 20px;
  background: #fff; border-radius: 12px; border: 1px solid var(--asc-border-color);
  box-shadow: 0 4px 15px rgba(0,0,0,.03);
}
.filter-group.filter-taxonomies { flex-grow: 1; display: flex; gap: 16px; flex-wrap: wrap; }
.filter-group.filter-sorting { flex-shrink: 0; }
.filter-select {
  min-width: 200px; flex-basis: 200px; flex-grow: 1;
  padding: 12px 15px; font-size: 15px; color: var(--asc-text-dark);
  border: 1px solid var(--asc-border-color); border-radius: 8px; background: #fff; cursor: pointer;
  appearance: none;
  background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%208l5%205%205-5z%22%20fill%3D%22%239ca3af%22%2F%3E%3C%2Fsvg%3E');
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
  transition: border-color .2s, box-shadow .2s;
}
.filter-select:focus { outline: none; border-color: var(--asc-primary-color); box-shadow: 0 0 0 3px rgba(0,86,179,.1); }

/* Results container */
#specialists-results-container { position: relative; min-height: 200px; transition: opacity .3s; }
#specialists-results-container.loading { opacity: .5; }
.specialists-loader {
  display: none; position: absolute; top: 50px; left: 50%; transform: translateX(-50%);
  font-size: 16px; color: var(--asc-text-light);
  padding: 15px 25px; background: #fff; border-radius: 8px; box-shadow: 0 5px 15px rgba(0,0,0,.1); z-index: 10;
}
.specialists-no-results {
  font-size: 16px; color: var(--asc-text-light);
  text-align: center; padding: 40px 20px; background: var(--asc-bg-light); border-radius: 12px;
}

/* Cards */
.specialist-card {
  border: 1px solid var(--asc-border-color); border-radius: 12px; margin-bottom: 20px; background: #fff; overflow: hidden;
  transition: all .3s;
}
.specialist-card.active, .specialist-card:hover {
  box-shadow: 0 8px 25px rgba(0,0,0,.07); border-color: #d1d5db; transform: translateY(-3px);
}
.card-header { display: flex; padding: 24px; gap: 24px; cursor: pointer; align-items: center; }
.card-photo { width: 100px; height: 100px; flex-shrink: 0; }
.card-photo img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
  border: 3px solid #fff; box-shadow: 0 2px 4px rgba(0,0,0,.05);
}
.card-summary { flex-grow: 1; }
.card-name { margin: 0 0 4px; font-size: 22px; font-weight: 700; color: var(--asc-text-dark); }
.card-spec { display: block; font-size: 15px; color: var(--asc-primary-color); font-weight: 600; margin-bottom: 12px; }
.card-short-desc { margin: 0; font-size: 16px; color: var(--asc-text-light); line-height: 1.5; }

/* Details (подробный блок) */
.card-details {
  display: none; padding: 28px; border-top: 1px solid var(--asc-border-color); background: #fafafb;
}
.details-layout {
  display: grid; grid-template-columns: 320px 1fr; gap: 28px; align-items: start;
}
.details-sidebar { width: 100%; }
.details-photo-large {
  width: 100%; aspect-ratio: 4/5; position: relative; border-radius: 12px; overflow: hidden;
  box-shadow: 0 8px 22px rgba(0,0,0,.06); background: #fff; margin: 0;
}
.details-photo-large img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.details-main-content { flex-grow: 1; }
.details-name-large { margin: 0 0 12px; font-size: 26px; font-weight: 800; color: var(--asc-text-dark); text-align: left; }

/* Метаданные (таксономии) */
.meta-list { display: flex; flex-direction: column; gap: 10px; margin: 0 0 18px; }
.meta-line { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; font-size: 15px; }
.meta-line strong { min-width: 120px; font-weight: 700; color: var(--asc-text-dark); }
.meta-line span { color: var(--asc-text-light); }

/* Секции деталей */
.details-section { margin-bottom: 22px; }
.details-section:last-child { margin-bottom: 0; }
.details-section h4 {
  font-size: 16px; font-weight: 800; margin: 0 0 10px; padding-bottom: 8px;
  border-bottom: 2px solid var(--asc-primary-color); display: inline-block;
}
.details-content { color: #374151; font-size: 15px; line-height: 1.7; }

/* Контакты */
.details-contact-links { display: flex; flex-direction: column; gap: 12px; }
.contact-link-text {
  display: inline-flex; align-items: center; gap: 10px; font-size: 15px;
  color: var(--asc-primary-color); text-decoration: none; font-weight: 600; transition: color .2s;
}
.contact-link-text:hover { color: var(--asc-primary-hover); }
.contact-link-text svg { width: 20px; height: 20px; flex-shrink: 0; fill: currentColor; }

.details-hr { margin: 18px 0; border: 0; border-top: 1px solid var(--asc-border-color); }

/* Соцсети */
.details-social-icons { display: flex; flex-wrap: wrap; gap: 12px; }
.social-icon-link {
  display: flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; background: #fff; border: 1px solid var(--asc-border-color);
  border-radius: 50%; color: var(--asc-text-light); transition: all .2s;
}
.social-icon-link:hover { color: #fff; transform: scale(1.1); }
.social-icon-link svg { width: 20px; height: 20px; fill: currentColor; }
.social-icon-link.telegram:hover { background: #0088cc; border-color: #0088cc; }
.social-icon-link.facebook:hover { background: #1877F2; border-color: #1877F2; }
.social-icon-link.whatsapp:hover { background: #25D366; border-color: #25D366; }

/* Мобильная адаптация */
@media (max-width: 980px) {
  .details-layout { grid-template-columns: 1fr; gap: 20px; }
  .details-photo-large { aspect-ratio: 4/5; border-radius: 12px; max-width: 100%; margin: 0; }
  .details-name-large { text-align: left; font-size: 24px; }
  .meta-line strong { min-width: 110px; }
}

@media (max-width: 768px) {
  .specialists-filters, .filter-group.filter-taxonomies { flex-direction: column; }
  .filter-select { min-width: 100%; flex-basis: auto; }
  .card-header { flex-direction: column; align-items: flex-start; gap: 16px; padding: 20px; }
  .card-photo { width: 80px; height: 80px; }
  .card-name { font-size: 20px; }
}

/* Модалка (попап) */
.asc-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(5px);
  display: none; align-items: center; justify-content: center; z-index: 1000;
  padding: 20px;
}

.asc-modal-content {
  background: #fff; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.1);
  width: 100%; max-width: 640px;
  max-height: 90vh; overflow: auto;
  display: flex; flex-direction: column;
}

@media (max-width: 768px) {
  .asc-modal-overlay { padding: 0; }
  .asc-modal-content {
    max-width: none; width: 100%; height: 100dvh; max-height: none; border-radius: 0;
  }
}

.asc-modal-header {
  position: sticky; top: 0; z-index: 2;
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; background: #fff; border-bottom: 1px solid var(--asc-border-color);
}
.asc-modal-header h3 { margin: 0; font-size: 20px; font-weight: 700; }
.asc-modal-close { font-size: 30px; font-weight: 300; color: var(--asc-text-light); cursor: pointer; line-height: 1; padding: 0 5px; }
.asc-modal-close:hover { color: var(--asc-text-dark); }

.asc-form-body { padding: 20px; display: grid; gap: 16px; }
.asc-form-group { display: flex; flex-direction: column; gap: 8px; }
.asc-form-group label { font-size: 14px; font-weight: 600; color: #374151; }
.asc-form-group label .required { color: #ef4444; margin-left: 2px; }
.asc-form-input, .asc-form-textarea, .asc-form-select {
  width: 100%; padding: 12px 14px; font-size: 15px;
  border: 1px solid var(--asc-border-color); border-radius: 8px;
  transition: border-color .2s, box-shadow .2s;
}
.asc-form-input:focus, .asc-form-textarea:focus, .asc-form-select:focus {
  outline: none; border-color: var(--asc-primary-color); box-shadow: 0 0 0 3px rgba(0,86,179,.1);
}
.asc-form-textarea { min-height: 100px; resize: vertical; }
.asc-form-file-input { font-size: 14px; padding: 10px; }
.asc-form-file-input::file-selector-button {
  margin-right: 10px; padding: 8px 12px; border: none; border-radius: 6px; background: #f3f4f6; color: var(--asc-text-dark);
  cursor: pointer; transition: background-color .2s;
}
.asc-form-file-input::file-selector-button:hover { background: #e5e7eb; }

.asc-form-message { display: none; padding: 16px; border-radius: 8px; font-size: 15px; margin: 0 20px 16px 20px; }
#asc-form-success-message { background: var(--asc-success-bg); color: var(--asc-success-text); text-align: center; }
#asc-form-error-message { background: var(--asc-error-bg); color: var(--asc-error-text); }

.asc-form-footer {
  position: sticky; bottom: 0; z-index: 2;
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 20px; background: #fff; border-top: 1px solid var(--asc-border-color);
  border-bottom-left-radius: 16px; border-bottom-right-radius: 16px;
}
.asc-form-submit-btn {
  padding: 12px 24px; font-size: 15px; font-weight: 600; color: #fff;
  background: var(--asc-primary-color); border: none; border-radius: 8px; cursor: pointer; transition: .2s;
}
.asc-form-submit-btn:hover { background: var(--asc-primary-hover); }
.asc-form-submit-btn:disabled { background: #9ca3af; cursor: not-allowed; }

@media (max-width: 768px) {
  .asc-form-footer { padding: 14px 16px; }
  .asc-form-submit-btn { width: 100%; height: 48px; font-size: 16px; border-radius: 10px; }
}

body.asc-modal-open { overflow: hidden; touch-action: none; }

/* Кастомный файл-аплоад */
.asc-file-wrapper {
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
}
.asc-file-btn {
  display: inline-block; background: #f3f4f6; border: 1px solid var(--asc-border-color); border-radius: 8px;
  padding: 10px 14px; font-size: 14px; font-weight: 600; color: var(--asc-text-dark); cursor: pointer; line-height: 1.2;
  transition: background-color .2s, box-shadow .2s;
}
.asc-file-btn:hover { background: #e5e7eb; box-shadow: 0 2px 4px rgba(0,0,0,.06); }
.asc-file-name { font-size: 14px; color: var(--asc-text-light); word-break: break-all; max-width: 100%; }

.asc-form-body .asc-form-group .asc-file-wrapper {
  border-style: dotted; border-width: 2px; border-color: #eaeaea; border-radius: 8px; padding: 10px 10px 12px 10px; justify-content: center;
}
.asc-form-body .asc-file-wrapper label { padding: 3px 9px; border-radius: 90px; }

@media (max-width: 420px) {
  .asc-form-body .asc-file-wrapper span { line-height: 1em; font-size: 12px; }
  .asc-form-body .asc-form-group .asc-file-wrapper { gap: 8px; flex-direction: column; }
  .asc-form-body .asc-file-wrapper label { font-size: 13px; }
}
