/* ===== Specialty List Page ===== */
.specialty-page {
    background: #f5f5f5;
    min-height: 100vh;
}

.specialty-hero {
    background: linear-gradient(135deg, #0051a5 0%, #003d7a 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

    .specialty-hero::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(255,255,255,0.05)" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,112C672,96,768,96,864,112C960,128,1056,160,1152,165.3C1248,171,1344,149,1392,138.7L1440,128L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
        background-size: cover;
    }

.specialty-content {
    padding: 20px 0 30px;
}

/* ===== Panel ===== */
.specialty-panel,
.doctor-panel {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 15px;
}

.panel-header {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-bottom: 2px solid #0051a5;
    padding: 10px 15px;
}

.panel-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

    .panel-title i {
        color: #0051a5;
        margin-right: 8px;
    }

.panel-body {
    padding: 12px;
}

/* ===== Search ===== */
.specialty-search {
    margin-bottom: 10px;
}

.search-input-wrapper {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 13px;
    z-index: 1;
}

.search-input {
    width: 100%;
    padding: 7px 10px 7px 32px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    transition: border-color 0.2s;
}

    .search-input:focus {
        outline: none;
        border-color: #0051a5;
        box-shadow: 0 0 0 2px rgba(0, 81, 165, 0.1);
    }

    .search-input::placeholder {
        color: #9ca3af;
    }

/* ===== Specialty List ===== */
.specialty-list {
    max-height: 680px;
    overflow-y: auto;
    overflow-x: hidden;
}

    .specialty-list::-webkit-scrollbar {
        width: 4px;
    }

    .specialty-list::-webkit-scrollbar-track {
        background: #f3f4f6;
        border-radius: 3px;
    }

    .specialty-list::-webkit-scrollbar-thumb {
        background: #0051a5;
        border-radius: 3px;
    }

        .specialty-list::-webkit-scrollbar-thumb:hover {
            background: #003d7a;
        }

/* ===== Specialty Item ===== */
.specialty-item {
    display: flex;
    align-items: stretch;
    border: 1px solid #e5e7eb;
    border-radius: 7px;
    margin-bottom: 5px;
    background: white;
    overflow: hidden;
    transition: all 0.2s ease;
    cursor: pointer;
}

    .specialty-item:hover {
        border-color: #0051a5;
        box-shadow: 0 2px 6px rgba(0, 81, 165, 0.1);
        background: #f0f6ff;
    }

    .specialty-item.active {
        background: linear-gradient(135deg, #0051a5 0%, #003d7a 100%);
        border-color: #0051a5;
        box-shadow: 0 2px 8px rgba(0, 81, 165, 0.25);
    }

        .specialty-item.active .specialty-name {
            color: white !important;
        }

        .specialty-item.active .btn-view-specialty-detail {
            color: rgba(255,255,255,0.85);
        }

            .specialty-item.active .btn-view-specialty-detail:hover {
                color: white;
            }

.specialty-clickable-area {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    padding: 8px 10px;
    cursor: pointer;
}

.specialty-name {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.specialty-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding: 0 10px 0 0;
}

.btn-view-specialty-detail {
    display: inline-block;
    padding: 0;
    background: transparent;
    color: #374151;
    font-size: 0.75rem;
    font-style: italic;
    font-weight: 500;
    text-decoration: underline;
    border: none;
    white-space: nowrap;
    transition: color 0.2s;
}

    .btn-view-specialty-detail:hover {
        color: #0051a5;
        text-decoration: underline;
        background: transparent;
    }

/* ===== Doctor List ===== */
#doctorListContainer {
    min-height: 300px;
}

.welcome-message {
    text-align: center;
    padding: 50px 20px;
    color: #6b7280;
}

.welcome-icon {
    margin-bottom: 12px;
}

    .welcome-icon i {
        color: #d1d5db;
    }

.welcome-message h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 8px;
}

.welcome-message p {
    font-size: 0.9rem;
    color: #6b7280;
    max-width: 400px;
    margin: 0 auto;
}

.loading-container {
    text-align: center;
    padding: 40px 20px;
    color: #0051a5;
}

.loading-spinner {
    margin-bottom: 12px;
}

    .loading-spinner i {
        font-size: 36px;
        animation: spin 1s linear infinite;
    }

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ===== Doctor Card ===== */
.doctor-card {
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 8px;
    background: white;
    transition: all 0.25s ease;
}

    .doctor-card:hover {
        border-color: #0051a5;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }

.doctor-info-section {
    width: 100%;
    min-width: 0;
}

/* Chức danh + Tên + Nút chi tiết trên cùng 1 hàng */
.doctor-basic-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.doctor-title {
    display: inline-block;
    background: #e0f2fe;
    color: #0051a5;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    flex-shrink: 0;
    white-space: nowrap;
}

.doctor-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
    line-height: 1.3;
    flex: 1; /* chiếm phần còn lại, đẩy nút chi tiết sang phải */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Nút chi tiết nằm cùng hàng — tự đẩy về phía phải */
.btn-view-doctor-detail {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #0051a5;
    color: white;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s ease;
    border: none;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: auto; /* đẩy về cuối hàng */
}

    .btn-view-doctor-detail:hover {
        background: #003d7a;
        color: white;
        transform: translateY(-1px);
        box-shadow: 0 3px 8px rgba(0, 81, 165, 0.3);
        text-decoration: none;
    }

    .btn-view-doctor-detail.disabled {
        opacity: 0.5;
        cursor: not-allowed;
        pointer-events: none;
    }

/* ẩn phần không dùng trong card danh sách */
.doctor-details,
.doctor-work-days,
.doctor-code-badge,
.doctor-avatar-section,
.doctor-actions,
.btn-book-appointment {
    display: none !important;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 30px 20px;
    color: #6b7280;
}

    .empty-state i {
        color: #d1d5db;
        margin-bottom: 12px;
    }

    .empty-state h4 {
        font-size: 1rem;
        font-weight: 700;
        color: #374151;
        margin-bottom: 6px;
    }

    .empty-state p {
        font-size: 0.85rem;
        color: #6b7280;
    }

/* ===== Responsive ===== */
@media (max-width: 991px) {
    .specialty-panel {
        margin-bottom: 16px;
    }

    .specialty-list {
        max-height: 350px;
    }

    .doctor-card {
        padding: 8px 10px;
    }

    .btn-view-doctor-detail {
        width: 100%;
        justify-content: center;
        margin-left: 0;
        margin-top: 6px;
    }

    .doctor-basic-info {
        flex-wrap: wrap;
    }
}

@media (max-width: 767px) {
    .specialty-name {
        font-size: 0.95rem;
    }

    .doctor-name {
        font-size: 0.85rem;
    }
}

@media (max-width: 576px) {
    .panel-header {
        padding: 8px 10px;
    }

    .panel-title {
        font-size: 0.9rem;
    }

    .panel-body {
        padding: 8px;
    }
}
