/**
 * Doctor Card Component - Surface-based Design
 * Used by both com_doctors component and mod_doctors module
 * @package    com_doctors
 * @since      2.0.0
 *
 * BREAKING CHANGES from v1.x:
 * - Replaced background-image card with surface-based card
 * - Removed gradient bio overlay (.doctor-bio-overlay)
 * - New structure: .profile-card > .image-wrapper + .card-content
 * - Introduced chip-based metadata system
 * - Migrated from inline SVG to Material Icons Round font
 *
 * NOTE: Module grid classes moved to mod-doctors.css in v1.11.0
 */

/* ============================================
   Doctor Profile Card Component
   ============================================ */

/* Card Link Container */
.doctor-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100%;
    max-width: var(--md-card-width, 350px);
}

/* Profile Card - Surface-based Container */
.profile-card {
    width: 100%;
    background: var(--md-surface, #ffffff);
    border-radius: var(--md-card-border-radius, 32px);
    padding: 12px;
    /* box-shadow: var(--md-card-shadow, 0 10px 25px -5px rgba(0,0,0,0.05), 0 8px 10px -6px rgba(0,0,0,0.05));
    transition: all 0.3s var(--md-transition-easing-standard, cubic-bezier(0.4, 0, 0.2, 1));
    cursor: pointer; */
    overflow: hidden;
    box-sizing: border-box;
    flex-wrap: wrap;
    display: flex;
}

.link {
    box-shadow: var(--md-card-shadow, 0 10px 25px -5px rgba(0,0,0,0.05), 0 8px 10px -6px rgba(0,0,0,0.05));
    transition: all 0.3s var(--md-transition-easing-standard, cubic-bezier(0.4, 0, 0.2, 1));
    cursor: pointer;
}

.profile-card.fullpage {
    width: 100%;
    background: var(--md-surface, #ffffff);
    border-radius: var(--md-card-border-radius, 32px);
    padding: 0px;
    box-shadow: var(--md-card-shadow, 0 10px 25px -5px rgba(0,0,0,0.05), 0 8px 10px -6px rgba(0,0,0,0.05));
    transition: none;
    cursor: default;
    overflow: hidden;
    box-sizing: border-box;
    flex-wrap: wrap;
    display: flex;
    gap: var(--md-spacing-2);
}

.profile-card.link:hover {
    transform: translateY(-5px);
    box-shadow: var(--md-shadow-lg, 0 20px 25px -5px rgba(0,0,0,0.15));
}

.profile-card.fullpage:hover {
    transform: none;
    box-shadow: var(--md-card-shadow, 0 10px 25px -5px rgba(0,0,0,0.05), 0 8px 10px -6px rgba(0,0,0,0.05));
}

/* ============================================
   Image Wrapper with Overlay Badges
   ============================================ */

.image-wrapper {
    width: 100%;
    aspect-ratio: 4 / 3;
    position: relative;
    overflow: hidden;
    border-radius: var(--md-image-border-radius, 24px);
}

.image-wrapper.fullpage {
    width: 100%;
    aspect-ratio: 4 / 3;
    position: relative;
    overflow: hidden;
    border-radius: var(--md-image-border-radius, 24px);
    flex: 1 1 55%;
}

.image-wrapper.facility {
    width: 100%;
    aspect-ratio: 4 / 3;
    position: relative;
    overflow: hidden;
    border-radius: var(--md-image-border-radius, 24px);
    flex: 1 1;
}

.doctor-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    background: var(--md-doctor-photo-bg, #e5e7eb);
}

/* Overlay Badges */
.overlay-badge {
    position: absolute;
    padding: 6px 12px;
    border-radius: var(--md-badge-border-radius, 12px);
    font-size: var(--md-fs-badge, 0.75rem);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

/* Category Badge (Bottom Right) */
.category-bottom {
    bottom: 12px;
    right: 12px;
    background: rgba(25, 118, 210, 0.7);
    color: white;
    backdrop-filter: blur(8px) grayscale(8%);
}

/* ============================================
   Card Content Section
   ============================================ */

.card-content {
    padding: 20px 10px 10px 10px;
}

.card-content.fullpage {
    padding: var(--md-spacing-3) var(--md-spacing-2);
    flex: 1 1 41%;
}

.card-content.facility {
    padding: 20px 10px 10px 10px;
    flex: 1 1 35%;
    display: flex;
    flex-direction: column;
    gap: var(--md-spacing-1);
}

.card-content-facility-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--md-spacing-1);
}

/* Doctor Name */
.doc-name {
    margin: 0;
    font-size: var(--md-fs-name, 1.5rem);
    font-weight: 800;
    color: var(--md-text-dark, #1f1f1f);
    letter-spacing: -0.01em;
    line-height: 1.2;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

/* Doctor Title/Specialization */
.doc-title {
    margin: 8px 0 20px 0;
    font-size: var(--md-fs-title, 1.05rem);
    color: var(--md-text-sub, #374151);
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: -0.05rem;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

/* ============================================
   Chip System
   ============================================ */

/* Section Label */
.section-label {
    font-size: var(--md-fs-section-label, 0.7rem);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--md-text-grey, #6b7280);
    margin-bottom: 8px;
    font-weight: 700;
}

/* Chip Group Container */
.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

/* Info Chip */
.info-chip {
    display: inline-flex;
    align-items: center;
    background: var(--md-chip-bg, #f3f4f6);
    padding: 6px 12px;
    border-radius: var(--md-chip-border-radius, 10px);
    font-size: var(--md-fs-info-chip, 0.8rem);
    color: var(--md-chip-text, #4b5563);
    font-weight: 600;
    white-space: nowrap;
}

.info-chip.children {
    color: var(--md-child-font-color);
    background: var(--md-child-bg-color);
}

/* Material Icons in Chips */

.material-symbols-rounded.chip-icon {
    font-size: var(--md-fs-icon, 20px);
    margin-right: 4px;
    opacity: 0.8;
}

/* ============================================
   Responsive Breakpoints
   ============================================ */

/* Tablet (768px - 991px) */
@media screen and (min-width: 768px) and (max-width: 991px) {
    .profile-card {
        padding: 10px;
    }

    .card-content {
        padding: 16px 8px 8px 8px;
    }

    .doc-title {
        margin: 6px 0 16px 0;
    }

    .chip-group {
        gap: 5px;
        margin-bottom: 12px;
    }
}

/* Large mobile (576px - 767px) */
@media screen and (min-width: 576px) and (max-width: 767px) {
    .profile-card {
        padding: 10px;
    }

    .card-content {
        padding: 14px 8px 8px 8px;
    }

    .doc-title {
        margin: 8px 0 16px 0;
    }
}

/* Small mobile (up to 575px) */
@media screen and (max-width: 575px) {
    .doctor-card-link {
        max-width: 100%;
    }

    .profile-card {
        padding: 8px;
        border-radius: 24px;
    }

    .image-wrapper {
        border-radius: 20px;
    }

    .card-content {
        padding: 12px 6px 6px 6px;
    }

    .card-content.fullpage {
        padding: 14px 24px;
    }

    .doc-title {
        margin: 8px 0 16px 0;
    }

    .chip-group {
        gap: 4px;
        margin-bottom: 10px;
    }

    .section-label {
        margin-bottom: 6px;
    }

    .overlay-badge {
        padding: 4px 8px;
    }

    .category-bottom {
        bottom: 8px;
        right: 8px;
    }

    /* Disable hover transform on touch devices */
    .profile-card:hover {
        transform: none;
        box-shadow: var(--md-card-shadow);
    }

    /* Add active state for touch feedback */
    .doctor-card-link:active .profile-card {
        transform: scale(0.98);
    }

    .image-wrapper.facility {
        width: 100%;
        min-width: 70%;
        aspect-ratio: 5 / 3;
        position: relative;
        overflow: hidden;
        border-radius: var(--md-image-border-radius, 24px);
        flex: 1 1;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .doctor-card-link {
        -webkit-tap-highlight-color: transparent;
    }

    .profile-card:hover {
        transform: none;
        box-shadow: var(--md-card-shadow);
    }

    .doctor-card-link:active .profile-card {
        transform: scale(0.98);
        transition: transform 0.1s;
    }
}
