
/* Контейнер */
.doctors-list-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 0px;
    font-family: "Ubuntu", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Фильтр по специальностям */
.doctors-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 32px;
    /*justify-content: space-between;*/
}

.filter-btn {
    padding: 8px 18px;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 100px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.filter-btn.active {
    background: #111827;
    border-color: #111827;
    color: white;
}

/* Карточка врача */
.doctor-card {
    background: white;
    border-radius: 16px;
    margin-bottom: 8px;
    border: 1px solid #f3f4f6;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Hover как в виджете - тень и подъем */
.doctor-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(234, 89, 77, 0.12);
    border-color: #EA594D;
}

/* И еще сильнее при раскрытии */
.doctor-card.expanded {
    border-color: #EA594D;
    box-shadow: 0 8px 24px rgba(234, 89, 77, 0.12);
    transform: translateY(-2px);
}

/* Строка врача (кликабельная область) */
.doctor-row {
    display: flex;
    align-items: center;
    padding: 20px 24px;
    gap: 16px;
    cursor: pointer;
    user-select: none;
}

/* Аватар */
.doctor-avatar {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, #f0f0f0, #e5e7eb);
    display: inline-block;
    align-items: center;
    justify-content: center;
}

/* Фото врача - заполняет круг */
.doctor-avatar img:not(.avatar-placeholder) {
    padding: 2px;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Иконка-заглушка - внутри круга по центру */
.avatar-placeholder {
    width: 48px;
    height: 48px;
    object-fit: contain !important;
    opacity: 0.7;
}

/* Имя и мета-информация */
.doctor-main {
    flex: 1;
    min-width: 0;
}

.doctor-name {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
    line-height: 1.3;
}

.doctor-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 14px;
    color: #6b7280;
}

.doctor-position {
    color: #374151;
    font-weight: 500;
}

.doctor-specialty {
    color: #059669;
    font-weight: 500;
}

.doctor-dot {
    color: #d1d5db;
}

.doctor-experience {
    color: #059669;
    font-weight: 500;
}

/* Цена и кнопка записи */
.doctor-price-action {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.doctor-price {
    font-size: 17px;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
}

.doctor-appointment-btn {
    padding: 10px 20px;
    background: #EA594D;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
    display: inline-block;
}

.doctor-appointment-btn:hover {
    background: #d44a3f;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(234, 89, 77, 0.3);
    color: white;
}

/* Кнопка раскрытия */
.doctor-expand-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    cursor: pointer;
    color: #9ca3af;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.doctor-expand-btn:hover {
    color: #374151;
}

.doctor-card.expanded .doctor-expand-btn {
    transform: rotate(180deg);
}

.doctor-expand-btn svg {
    width: 20px;
    height: 20px;
}

/* Раскрывающиеся детали */
.doctor-details {
    display: none;
    border-top: 1px solid #f3f4f6;
    background: #fafafa;
}

.doctor-card.expanded .doctor-details {
    display: block;
}

/* Сетка для остальных данных */
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    padding: 24px;
}

.detail-section h4 {
    font-size: 12px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 8px 0;
}

.detail-section p {
    font-size: 14px;
    color: #374151;
    margin: 0 0 4px 0;
    line-height: 1.5;
}

.detail-section p:last-child {
    margin-bottom: 0;
}

/* Бейдж аккредитации */
.accreditation-item {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.accreditation-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.accreditation-position {
    font-weight: 500;
    color: #374151;
    margin-bottom: 4px;
}

.accreditation-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
}

.accreditation-status.active {
    background: #ecfdf5;
    color: #059669;
}

.accreditation-status.expired {
    background: #fef2f2;
    color: #dc2626;
}

/* Пустое состояние */
.no-doctors {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
    font-size: 16px;
}

/* Пагинация */
.doctors-pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 32px;
}

.pagination-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.pagination-btn:hover:not(.active):not(:disabled) {
    background: #f9fafb;
    border-color: #d1d5db;
}

.pagination-btn.active {
    background: #111827;
    border-color: #111827;
    color: white;
}

.pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination-ellipsis {
    display: flex;
    align-items: center;
    padding: 0 4px;
    color: #9ca3af;
    font-size: 14px;
}

/* Загрузка */
.doctors-loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 2px solid #f0f0f0;
    border-top-color: #EA594D;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { 
        transform: rotate(360deg); 
    }
}

/* Адаптивность для мобильных */
@media (max-width: 640px) {
    .doctors-list-container {
        padding: 24px 16px;
    }
    
    .doctor-row {
        padding: 16px;
        gap: 12px;
        flex-wrap: wrap;
    }
    
    .doctor-price-action {
        width: 100%;
        display: flex;
        justify-content: flex-end;
        gap: 12px;
        padding-left: 0;
        margin-top: 4px;
    }
    
    .doctor-price {
        margin-right: auto;
    }
    
    .doctor-avatar {
        width: 64px;
        height: 64px;
    }
    
    .doctor-name {
        font-size: 18px;
    }
    
    .details-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 16px;
    }
    
    .doctors-filter {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }
    
    .filter-btn {
        padding: 6px 14px;
        font-size: 13px;
    }
}

/* Должности в деталях */
.position-item {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.position-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.position-item:first-child {
    padding-top: 0;
}

.position-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.position-name {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    flex: 1;
}

.position-price {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
}

.position-appointment-btn {
    padding: 6px 14px;
    background: #EA594D;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.position-appointment-btn:hover {
    background: #d44a3f;
    color: white;
}

.position-accreditation {
    margin-top: 6px;
    font-size: 12px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Список должностей на всю ширину */
.positions-list {
    padding: 24px 24px 0;
}

.positions-list .position-item {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.positions-list .position-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.positions-list .position-item:first-child {
    padding-top: 0;
}


/* Адаптация для мобильных */
@media (max-width: 640px) {
    .position-header {
        display: flex;
        align-items: center;
        gap: 12px;
        flex-wrap: nowrap;
    }
    
    .position-appointment-btn {
        width: 100px;
        text-align: center;       
    }
    
    .position-name {
        flex: 1;
        min-width: 0;
    }
    
    .position-price {
        white-space: nowrap;
    }
    
    .position-appointment-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

/* ========================================
   Модальное окно выбора должности
   ======================================== */

.doctor-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.doctor-modal {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 460px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.doctor-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 24px 16px;
    border-bottom: 1px solid #f3f4f6;
}

.doctor-modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0;
    padding-right: 12px;
}

.doctor-modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.2s;
    flex-shrink: 0;
}

.doctor-modal-close:hover {
    background: #e5e7eb;
    color: #111827;
}

.doctor-modal-body {
    padding: 16px 24px 24px;
    overflow-y: auto;
    max-height: calc(80vh - 80px);
}

.modal-position-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 1px solid #f3f4f6;
    border-radius: 12px;
    margin-bottom: 8px;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    color: inherit;
}

.modal-position-item:last-child {
    margin-bottom: 0;
}

.modal-position-item:hover {
    border-color: #EA594D;
    background: #fdf2f1;
}

.modal-position-name {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: #374151;
}

.modal-position-price {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
}

.modal-position-arrow {
    color: #9ca3af;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.modal-position-item:hover .modal-position-arrow {
    color: #EA594D;
}

body.modal-open {
    overflow: hidden;
}

@media (max-width: 640px) {
    .doctor-modal {
        width: 95%;
        max-width: none;
        margin: 16px;
        border-radius: 16px;
    }
    
    .doctor-modal-header {
        padding: 20px 20px 12px;
    }
    
    .doctor-modal-body {
        padding: 12px 20px 20px;
    }
    
    .modal-position-item {
        padding: 14px;
    }
}