/**
 * Doctor Quick-View Modal Styles
 *
 * Add these styles to your theme's CSS file (e.g., mindclinic-custom.css)
 * or include them via wp_add_inline_style() in the REST endpoint handler.
 *
 * @package MindClinic
 */

/* ── Modal Overlay ── */
.mc-doctor-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mc-doctor-modal--visible {
    visibility: visible;
    opacity: 1;
}

.mc-doctor-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(30, 35, 40, 0.6);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

/* ── Modal Panel ── */
.mc-doctor-modal__panel {
    position: relative;
    width: 100%;
    max-width: 580px;
    max-height: 85vh;
    overflow-y: auto;
    background: #FFFFFF;
    border-radius: 24px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    padding: 2rem;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.35s cubic-bezier(0.165, 0.84, 0.44, 1);
    scrollbar-width: thin;
}

.mc-doctor-modal--visible .mc-doctor-modal__panel {
    transform: translateY(0) scale(1);
}

.mc-doctor-modal__panel::-webkit-scrollbar {
    width: 5px;
}
.mc-doctor-modal__panel::-webkit-scrollbar-track {
    background: transparent;
}
.mc-doctor-modal__panel::-webkit-scrollbar-thumb {
    background: #D1EAEB;
    border-radius: 4px;
}

/* ── Close Button ── */
.mc-doctor-modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border: none;
    background: #F4F7F8;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748B;
    font-size: 1rem;
    transition: all 0.2s ease;
    z-index: 2;
}

.mc-doctor-modal__close:hover {
    background: #E2E8F0;
    color: #3F4954;
    transform: rotate(90deg);
}

/* RTL close button */
.rtl .mc-doctor-modal__close {
    right: auto;
    left: 1rem;
}

/* ── Loader ── */
.mc-doctor-modal__loader {
    text-align: center;
    padding: 3rem 1rem;
    color: #64748B;
    font-size: 0.9rem;
}

.mc-doctor-modal__spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #D1EAEB;
    border-top-color: #2B98A1;
    border-radius: 50%;
    animation: mcSpin 0.7s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes mcSpin {
    to { transform: rotate(360deg); }
}

/* ── Content: Header ── */
.mc-doctor-modal__header {
    display: flex;
    gap: 1.2rem;
    align-items: center;
    margin-bottom: 1.2rem;
    padding-right: 2rem; /* space for close button */
}

.rtl .mc-doctor-modal__header {
    padding-right: 0;
    padding-left: 2rem;
}

.mc-doctor-modal__avatar-wrap {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(63, 73, 84, 0.12);
    background: #F4F7F8;
}

.mc-doctor-modal__avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mc-doctor-modal__initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2B98A1;
    color: #fff;
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
}

.mc-doctor-modal__header-text {
    flex: 1;
    min-width: 0;
}

.mc-doctor-modal__name {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #3F4954;
    margin: 0 0 0.2rem;
    line-height: 1.3;
}

.mc-doctor-modal__role {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #2B98A1;
}

/* ── Tags ── */
.mc-doctor-modal__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.mc-doctor-modal__tag {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    background: #D1EAEB;
    color: #237D85;
    border: 1px solid rgba(43, 152, 161, 0.1);
}

.mc-doctor-modal__tag--accent {
    background: #FFF3E8;
    color: #B8541E;
    border-color: rgba(244, 162, 97, 0.2);
}

/* ── Bio ── */
.mc-doctor-modal__bio {
    font-size: 0.88rem;
    line-height: 1.7;
    color: #64748B;
    margin-bottom: 1.5rem;
}

.mc-doctor-modal__bio p {
    margin: 0 0 0.7rem;
}

.mc-doctor-modal__bio p:last-child {
    margin-bottom: 0;
}

/* ── Services ── */
.mc-doctor-modal__services {
    margin-bottom: 1.2rem;
    padding: 0.8rem 1rem;
    background: #F4F7F8;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
}

.mc-doctor-modal__services-title {
    font-family: 'Playfair Display', serif;
    font-size: 0.8rem;
    font-weight: 700;
    color: #3F4954;
    margin: 0 0 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mc-doctor-modal__services-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.mc-doctor-modal__service-item {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.3rem 0.7rem;
    background: #FFFFFF;
    color: #237D85;
    border-radius: 8px;
    border: 1px solid #D1EAEB;
}

/* ── Actions ── */
.mc-doctor-modal__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    align-items: center;
    padding-top: 1.2rem;
    border-top: 1px solid #E2E8F0;
}

.mc-doctor-modal__profile-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: #2B98A1;
    text-decoration: none;
    transition: gap 0.2s ease;
}

.mc-doctor-modal__profile-link:hover {
    gap: 0.7rem;
    text-decoration: underline;
}

.mc-doctor-modal__book-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    padding: 0.7rem 1.5rem;
    background: #2B98A1;
    color: #fff;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.8rem;
    text-decoration: none;
    box-shadow: 0 6px 15px rgba(43, 152, 161, 0.25);
    transition: all 0.3s ease;
}

.rtl .mc-doctor-modal__book-btn {
    margin-left: 0;
    margin-right: auto;
}

.mc-doctor-modal__book-btn:hover {
    background: #237D85;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(43, 152, 161, 0.35);
    color: #fff;
}

/* ── Mobile ── */
@media (max-width: 640px) {
    .mc-doctor-modal {
        padding: 0.75rem;
        align-items: flex-end;
    }

    .mc-doctor-modal__panel {
        max-width: 100%;
        max-height: 80vh;
        border-radius: 20px 20px 0 0;
        padding: 1.5rem;
        padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
        transform: translateY(30px);
    }

    .mc-doctor-modal--visible .mc-doctor-modal__panel {
        transform: translateY(0);
    }

    .mc-doctor-modal__header {
        padding-right: 0;
    }

    .mc-doctor-modal__avatar-wrap {
        width: 56px;
        height: 56px;
    }

    .mc-doctor-modal__actions {
        flex-direction: column;
    }

    .mc-doctor-modal__book-btn {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }

    .rtl .mc-doctor-modal__book-btn {
        margin-right: 0;
    }
}
