/**
 * Doctor Grid Styles
 * Ported from prototype for Archive Doctor page
 */

:root {
    --shb-primary: #2DACC9;
    --shb-primary-hover: #2492AB;
    --shb-secondary: #0F172A;
    --shb-accent: #1B2B56;
    --shb-text-heading: #0F172A;
    --shb-text-body: #64748B;
    --shb-bg-alt: #F8FAFC;
    --shb-surface: #FFFFFF;
    --shb-border-light: #E2E8F0;
    --shb-font-sans: 'Manrope', sans-serif;
    --shb-font-display: 'Figtree', sans-serif;
}

/* Grid Layout container logic */
.shb-doctor-grid-container {
    width: 100%;
    margin: 0 auto;
}

/* Grid System */
.grid-4col-v1 {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 2rem;
    width: 100%;
}

@media (min-width: 768px) {
    .grid-4col-v1 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid-4col-v1 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1280px) {
    .grid-4col-v1 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Animation Keyframes */
@keyframes fadeUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- DOCTOR CARD COMPONENT --- */
.doctor-card {
    position: relative;
    background: var(--shb-surface);
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--shb-border-light);
    box-shadow: 0 4px 20px -2px rgba(45, 172, 201, 0.1);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    aspect-ratio: 3 / 4;
    cursor: pointer;
    width: 100%;
    opacity: 0;
    animation: fadeUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.doctor-card:hover {
    box-shadow: 0 20px 40px -4px rgba(15, 23, 42, 0.15);
    transform: translateY(-8px);
    border-color: var(--shb-primary);
}

/* Card Image */
.card-image {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    filter: grayscale(0%) contrast(1.02);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.doctor-card:hover .card-image img {
    filter: grayscale(0%) contrast(1);
    transform: scale(1.05);
}

/* Fallback for missing image */
.shb-placeholder-photo {
    width: 100%;
    height: 100%;
    background: var(--shb-bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--shb-text-body);
    font-size: 0.9rem;
}

/* Gradient Overlay */
.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(15, 23, 42, 0) 0%, rgba(15, 23, 42, 0.1) 50%, rgba(15, 23, 42, 0.85) 100%);
    transition: all 0.6s ease;
    z-index: 1;
}

.doctor-card:hover .card-overlay {
    background: linear-gradient(to bottom, rgba(45, 172, 201, 0.1) 0%, rgba(15, 23, 42, 0.6) 40%, rgba(15, 23, 42, 0.98) 100%);
}

/* Badge Label */
.badge-label {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #FFFFFF;
    font-weight: 700;
    background: var(--shb-primary);
    padding: 6px 12px;
    border-radius: 100px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.5s ease 0.1s;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.doctor-card:hover .badge-label {
    opacity: 1;
    transform: translateY(0);
}

/* Card Content */
.card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 32px 24px;
    z-index: 2;
    text-align: left;
}

.category-line {
    width: 40px;
    height: 3px;
    background: var(--shb-primary);
    margin-bottom: 12px;
    transition: all 0.5s ease;
    border-radius: 2px;
}

.doctor-card:hover .category-line {
    width: 80px;
    background: #fff;
}

.specialty {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--shb-primary);
    font-weight: 700;
    margin-bottom: 4px;
    font-family: var(--shb-font-sans);
}

.doctor-card:hover .specialty {
    color: #A5F3FC;
}

.doctor-name {
    font-size: 22px;
    font-weight: 700;
    color: #FFFFFF;
    line-height: 1.2;
    margin-bottom: 4px;
    margin-top: 0;
    font-family: var(--shb-font-display);
}

.credentials {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 16px;
    line-height: 1.5;
    font-weight: 500;
    margin-top: 0;
    font-family: var(--shb-font-sans);
}

.doctor-card:hover .credentials {
    color: rgba(255, 255, 255, 0.9);
}

/* Expandable Stats */
.stats-expand {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.6s ease 0.2s;
}

.doctor-card:hover .stats-expand {
    max-height: 300px;
    /* Increased from 200px to prevent cutting off */
    opacity: 1;
}

.stats-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    /* Reduced from 20px */
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.stat-item {
    flex: 1;
    text-align: center;
    display: block !important;
}

.stat-value {
    display: block !important;
    font-size: 18px !important;
    font-weight: 700;
    color: #FFFFFF !important;
    line-height: 1 !important;
    margin-bottom: 4px !important;
    font-family: var(--shb-font-sans) !important;
}

.stat-label {
    font-size: 10px !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: 600 !important;
    display: block !important;
    font-family: var(--shb-font-sans) !important;
    line-height: normal !important;
}

/* CTA Button */
.cta-button {
    padding: 10px 20px !important;
    /* Slightly reduced padding */
    background: var(--shb-primary) !important;
    color: #FFFFFF !important;
    border: none !important;
    border-radius: 100px !important;
    font-size: 11px !important;
    /* Slightly reduced font size */
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    display: block !important;
    text-align: center !important;
    text-decoration: none !important;
    line-height: normal !important;
    box-shadow: none;
    box-sizing: border-box !important;
    /* Ensure padding doesn't overflow width */
    margin-top: 4px;
    /* Ensure slight spacing */
}


.cta-button:hover,
.cta-button:focus {
    background: #FFFFFF !important;
    color: var(--shb-secondary) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
    outline: none !important;
}

/* Search and Filters Header Styling */
.shb-archive-header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    z-index: 10;
}

.shb-doctor-filters {
    display: flex;
    gap: 12px;
    /* Filters Gap from design.json */
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    max-width: 900px;
    margin: 0 auto;
}

/* Search Box Design (design.json > components.inputs.searchBox) */
.shb-search-filter {
    position: relative;
    flex: 1;
    min-width: 300px;
}

.shb-search-icon {
    position: absolute;
    left: 16px;
    /* Icon left from design.json */
    top: 50%;
    transform: translateY(-50%);
    color: #94A3B8;
    /* Placeholder color from design.json */
    width: 20px;
    height: 20px;
    pointer-events: none;
    z-index: 1;
}

.shb-search-input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    /* Padding for searchBox from design.json */
    border-radius: 12px;
    /* Base input radius from design.json */
    border: 1px solid #E2E8F0;
    font-family: var(--shb-font-sans);
    font-size: 15px;
    /* Font size from baseStyles */
    background-color: #FFFFFF;
    color: #0F172A;
    outline: none;
    transition: all 0.2s ease;
    box-shadow: none;
    /* No shadow on default state */
}

.shb-search-input:focus {
    border-color: var(--shb-primary);
    box-shadow: 0 0 0 4px rgba(45, 172, 201, 0.1);
}

.shb-search-input::placeholder {
    color: #94A3B8;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* Department Select (design.json > components.inputs.select) */
.shb-department-filter {
    position: relative;
    min-width: 200px;
}

.shb-department-select {
    width: 100%;
    padding: 12px 40px 12px 16px;
    /* Right padding for arrow */
    border-radius: 12px;
    /* Base input radius */
    border: 1px solid #E2E8F0;
    font-family: var(--shb-font-sans);
    font-size: 15px;
    background-color: #FFFFFF;
    color: #0F172A;
    /* Text Body/Heading */
    outline: none;
    transition: all 0.2s ease;
    cursor: pointer;
    appearance: none;
    /* Custom SVG Arrow from design.json */
    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%207l5%205%205-5%22%20stroke%3D%22%2364748B%22%20stroke-width%3D%222%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    box-shadow: none;
}

.shb-department-select:focus {
    border-color: var(--shb-primary);
    box-shadow: 0 0 0 4px rgba(45, 172, 201, 0.1);
}

/* Base Hover State for Inputs */
.shb-search-input:hover,
.shb-department-select:hover {
    border-color: #CBD5E1;
    /* Hover border from design.json */
}

/* View Toggle (if present) */
.shb-view-toggle {
    display: flex;
    gap: 8px;
    background: #FFFFFF;
    padding: 6px;
    border-radius: 100px;
    border: 1px solid var(--shb-border-light);
}

.shb-view-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--shb-text-body);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.shb-view-btn.active {
    background: var(--shb-primary);
    color: #FFFFFF;
}

.shb-filter-label {
    display: none;
}

.shb-section-header {
    display: none;
}

/* Stagger Animation Delays */
.doctor-card:nth-child(1) {
    animation-delay: 0.1s;
}

.doctor-card:nth-child(2) {
    animation-delay: 0.2s;
}

.doctor-card:nth-child(3) {
    animation-delay: 0.3s;
}

.doctor-card:nth-child(4) {
    animation-delay: 0.4s;
}

.doctor-card:nth-child(5) {
    animation-delay: 0.5s;
}

.doctor-card:nth-child(6) {
    animation-delay: 0.6s;
}

.doctor-card:nth-child(7) {
    animation-delay: 0.7s;
}

.doctor-card:nth-child(8) {
    animation-delay: 0.8s;
}

/* Load More Button */
.shb-load-more-container {
    text-align: center;
    margin-top: 4rem;
}

.shb-load-more-btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    background-color: transparent;
    border: 1px solid var(--shb-primary);
    color: var(--shb-primary);
    border-radius: 100px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: var(--shb-font-sans);
}

.shb-load-more-btn:hover {
    background-color: var(--shb-primary);
    color: white;
}