/**
 * ePatientCare — Public doctor profile: visiting-card share modal
 * Preview is scaled with JS (see doctor-share-card.blade.php) so the full
 * 1050×700 card always fits the popup with no scroll. Capture restores 1:1.
 */

.epcsc-modal {
    position: fixed;
    inset: 0;
    z-index: 71;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    overflow: hidden;
    pointer-events: none;
}

.epcsc-modal__panel {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    width: min(920px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(15, 107, 102, 0.22);
    overflow: hidden;
}

.epcsc-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px 12px;
    border-bottom: 1px solid #e5efef;
    flex-shrink: 0;
}

.epcsc-modal__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f6b66;
    line-height: 1.3;
}

.epcsc-modal__subtitle {
    margin: 4px 0 0;
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.4;
}

.epcsc-modal__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: -4px -4px 0 0;
    border: 0;
    border-radius: 10px;
    background: #f3f4f6;
    color: #4b5563;
    cursor: pointer;
    flex-shrink: 0;
}

.epcsc-modal__close:hover {
    background: #e5e7eb;
    color: #111827;
}

/* Card stage: reserved height so the preview never collapses to blank */
.epcsc-modal__stage {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 14px 8px;
    background: linear-gradient(160deg, #eef7f6 0%, #f7fbfb 55%, #e8f2f1 100%);
    overflow: hidden;
}

.epcsc-stage {
    position: relative;
    width: 100%;
    /* Height is set inline by Alpine from the computed scale */
    overflow: hidden;
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(15, 107, 102, 0.12);
    background: #f7fbfb;
}

.epcsc-stage__scale {
    position: absolute;
    top: 0;
    left: 0;
    width: 1050px;
    height: 700px;
    transform-origin: top left;
    /* transform: scale(...) is set inline by Alpine */
}

/* Action footer */
.epcsc-modal__footer {
    flex-shrink: 0;
    padding: 12px 16px 16px;
    border-top: 1px solid #e5efef;
    background: #ffffff;
}

.epcsc-modal__error {
    margin: 0 0 10px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 0.75rem;
    line-height: 1.4;
}

.epcsc-tip {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0 0 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #eef7f6;
    border: 1px solid #cbe3e0;
}

.epcsc-tip__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #0f6b66;
    color: #ffffff;
    flex-shrink: 0;
}

.epcsc-tip__body {
    min-width: 0;
}

.epcsc-tip__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f6b66;
    line-height: 1.3;
}

.epcsc-tip__text {
    margin: 4px 0 0;
    font-size: 0.72rem;
    font-weight: 500;
    color: #4b5563;
    line-height: 1.45;
}

.epcsc-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    border-radius: 14px;
    border: 0;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.epcsc-action:active {
    transform: translateY(1px);
}

.epcsc-action__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    flex-shrink: 0;
}

.epcsc-action__icon svg {
    width: 16px;
    height: 16px;
}

.epcsc-action__text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    text-align: left;
}

.epcsc-action__label {
    font-size: 0.9rem;
    font-weight: 700;
}

.epcsc-action__hint {
    font-size: 0.68rem;
    font-weight: 500;
    opacity: 0.85;
}

.epcsc-action--save {
    background: linear-gradient(135deg, #0f6b66 0%, #15b39a 100%);
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 107, 102, 0.28);
}

.epcsc-action--save:hover {
    box-shadow: 0 10px 26px rgba(15, 107, 102, 0.36);
}

.epcsc-action--save .epcsc-action__icon {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

@media (max-height: 640px) {
    .epcsc-modal__header {
        padding: 12px 14px 10px;
    }

    .epcsc-modal__footer {
        padding: 10px 14px 12px;
    }

    .epcsc-modal__stage {
        padding: 8px 10px 6px;
    }
}
