/* ============================================================
   LifeTrack - Estilos da modalidade de atendimento na agenda
   Arquivo: agenda_telemedicina.css
   ============================================================ */

:root {
    --lt-red: #d71920;
    --lt-red-dark: #a80f15;
    --lt-black: #111111;
    --lt-gray: #666666;
    --lt-border: #e6e6e6;
    --lt-soft-red: #fff0f1;
}


/* ============================================================
   ÁREA DE ESCOLHA DA MODALIDADE
   ============================================================ */

.agenda-modality-selection {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--lt-border);
}


/* ============================================================
   BOTÕES TODAS / PRESENCIAL / TELEMEDICINA
   ============================================================ */

.modality-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}


/*
   IMPORTANTE:
   Aqui removemos completamente a influência do flex/grid
   antigo e centralizamos o texto usando a própria altura
   da linha.

   Assim o texto fica exatamente no centro vertical.
*/
.modality-tags .period-tag {
    display: block !important;

    position: relative;

    height: 48px !important;
    min-height: 48px !important;

    margin: 0 !important;

    padding: 0 22px !important;

    box-sizing: border-box;

    border: 1px solid var(--lt-border);

    border-radius: 999px;

    background: #ffffff;

    color: var(--lt-black);

    font-family: 'Outfit', sans-serif;

    font-size: 14px;

    font-weight: 700;

    /*
       Mesma altura do botão.
       Isso força o texto para o centro vertical real.
    */
    line-height: 48px !important;

    text-align: center !important;

    text-indent: 0 !important;

    white-space: nowrap;

    cursor: pointer;

    appearance: none;
    -webkit-appearance: none;

    vertical-align: middle;

    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}


/*
   Os botões Presencial e Telemedicina possuem
   elementos <i> inseridos pelo JavaScript.

   Mesmo quando o ícone não aparece visualmente,
   ele pode interferir no alinhamento.

   Por isso ele é completamente removido
   do fluxo visual.
*/
.modality-tags .period-tag i {
    display: none !important;

    width: 0 !important;
    height: 0 !important;

    margin: 0 !important;
    padding: 0 !important;
}


/* ============================================================
   TAMANHO INDIVIDUAL DOS BOTÕES
   ============================================================ */

.modality-tags .period-tag[data-modality="todas"] {
    width: 92px;
    min-width: 92px;
}


.modality-tags .period-tag[data-modality="presencial"] {
    width: 140px;
    min-width: 140px;
}


.modality-tags .period-tag[data-modality="telemedicina"] {
    width: 168px;
    min-width: 168px;
}


/* ============================================================
   HOVER
   ============================================================ */

.modality-tags .period-tag:hover {
    border-color: var(--lt-red);

    color: var(--lt-red);

    /*
       Sem translateY aqui.
       Isso evita que um botão pareça mais alto ou
       desalinhado que os outros.
    */
    transform: none;
}


/* ============================================================
   BOTÃO ATIVO
   ============================================================ */

.modality-tags .period-tag.active {
    border-color: var(--lt-red);

    color: #ffffff;

    background: var(--lt-red);

    box-shadow:
        0 7px 16px rgba(215, 25, 32, 0.20);
}


/* ============================================================
   TEXTO EXPLICATIVO
   ============================================================ */

.agenda-modality-help {
    margin: 11px 0 0;

    color: var(--lt-gray);

    font-size: 14px;

    line-height: 1.5;
}


/* ============================================================
   HORÁRIO DE TELEMEDICINA
   ============================================================ */

.time-slot.telemedicine-slot {
    position: relative;

    min-height: 66px;

    padding: 10px 8px 25px;

    border-color: var(--lt-red);

    color: var(--lt-red);

    background:
        linear-gradient(
            180deg,
            #ffffff 0%,
            #fff7f8 100%
        );

    box-shadow:
        0 7px 18px rgba(215, 25, 32, 0.09),
        0 1px 2px rgba(17, 24, 39, 0.04);
}


.time-slot.telemedicine-slot:hover {
    color: #ffffff;

    background:
        linear-gradient(
            180deg,
            var(--lt-red) 0%,
            var(--lt-red-dark) 100%
        );

    box-shadow:
        0 11px 22px rgba(215, 25, 32, 0.24);
}


/* ============================================================
   BADGE DE TELEMEDICINA
   ============================================================ */

.agenda-modality-badge {
    position: absolute;

    right: 7px;
    bottom: 5px;

    display: inline-flex;

    align-items: center;

    gap: 4px;

    color: var(--lt-red-dark);

    font-size: 10px;

    font-weight: 800;

    line-height: 1;

    white-space: nowrap;
}


.time-slot.telemedicine-slot:hover .agenda-modality-badge {
    color: #ffffff;
}


/* ============================================================
   MODAL DE CONFIRMAÇÃO
   ============================================================ */

.booking-modality-line {
    padding: 10px 12px;

    border-left:
        4px solid var(--lt-red);

    border-radius: 6px;

    color: var(--lt-black);

    background: var(--lt-soft-red);

    font-size: 15px;
}


.booking-modality-line span {
    color: var(--lt-red-dark);

    font-weight: 800;
}


/* ============================================================
   HORÁRIOS
   ============================================================ */

.time-slots {
    display: grid;

    grid-template-columns:
        repeat(4, 64px);

    justify-content: start;

    gap: 10px;
}


.time-slot {
    display: flex !important;

    align-items: center !important;

    justify-content: center !important;

    width: 64px;

    min-width: 64px;

    max-width: 64px;

    height: 56px;

    min-height: 56px;

    max-height: 56px;

    margin: 0;

    padding: 0 !important;

    box-sizing: border-box;

    border-radius: 13px;

    font-size: 13px;

    line-height: 1;

    text-align: center;

    font-variant-numeric: tabular-nums;
}


/* ============================================================
   RESPONSIVO
   ============================================================ */

@media (max-width: 700px) {

    .modality-tags {
        display: grid;

        grid-template-columns: 1fr;

        gap: 10px;
    }


    .modality-tags .period-tag,
    .modality-tags .period-tag[data-modality="todas"],
    .modality-tags .period-tag[data-modality="presencial"],
    .modality-tags .period-tag[data-modality="telemedicina"] {

        width: 100% !important;

        min-width: 0 !important;

        height: 48px !important;

        min-height: 48px !important;

        padding: 0 18px !important;

        line-height: 48px !important;

        text-align: center !important;
    }


    .agenda-modality-help {
        font-size: 13px;
    }
}


@media (max-width: 420px) {

    .time-slots {
        grid-template-columns:
            repeat(4, 58px);

        gap: 8px;
    }


    .time-slot {
        width: 58px;

        min-width: 58px;

        max-width: 58px;

        height: 52px;

        min-height: 52px;

        max-height: 52px;

        font-size: 12px;
    }
}


@media (max-width: 350px) {

    .time-slots {
        grid-template-columns:
            repeat(3, 1fr);
    }


    .time-slot {
        width: 100%;

        min-width: 0;

        max-width: none;
    }
}

/* Seleção explícita de atendimento quando o mesmo horário aceita ambos. */
#booking-modal {
    overflow-y: auto;
    padding: 14px 12px;
}
#booking-modal .modal-content {
    margin: auto;
    max-height: calc(100dvh - 28px);
    overflow-y: auto;
    box-sizing: border-box;
}
#booking-modal .lt-booking-mode-choice {
    border: 0;
    padding: 0;
    margin: 0 0 20px;
    min-width: 0;
    text-align: left;
}
#booking-modal .lt-booking-mode-choice legend {
    padding: 0;
    margin: 0 0 12px;
    color: #111827;
    font: 700 15px/1.45 'Outfit', sans-serif;
}
#booking-modal .lt-booking-mode-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
#booking-modal .lt-booking-mode-option {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    min-height: 78px;
    padding: 12px 10px;
    border: 1.5px solid #d1d5db;
    border-radius: 12px;
    background: #fff;
    color: #111827;
    cursor: pointer;
    text-align: left;
    transition: border-color .15s, background-color .15s, box-shadow .15s;
}
#booking-modal .lt-booking-mode-option i {
    flex: 0 0 auto;
    color: #dc2626;
    font-size: 18px;
}
#booking-modal .lt-booking-mode-option strong {
    display: block;
    color: inherit;
    font: 700 14px/1.35 'Outfit', sans-serif;
}
#booking-modal .lt-booking-mode-option small {
    display: block;
    margin-top: 4px;
    color: #6b7280;
    font: 400 12px/1.3 'Outfit', sans-serif;
}
#booking-modal .lt-booking-mode-option:hover,
#booking-modal .lt-booking-mode-option[aria-pressed="true"] {
    border-color: #dc2626;
    background: #fff5f5;
}
#booking-modal .lt-booking-mode-option[aria-pressed="true"] {
    box-shadow: 0 0 0 1px #dc2626 inset;
}
#booking-modal .lt-booking-mode-option:focus-visible {
    outline: 3px solid #dc2626;
    outline-offset: 3px;
}
#booking-modal #confirm-booking:disabled {
    background: #9ca3af;
    border-color: #9ca3af;
    color: #fff;
    cursor: not-allowed;
    opacity: 1;
}
html[data-theme="dark"] #booking-modal .lt-booking-mode-choice legend {
    color: #f3f4f6;
}
html[data-theme="dark"] #booking-modal .lt-booking-mode-option {
    background: #20252f;
    border-color: #404855;
    color: #f3f4f6;
}
html[data-theme="dark"] #booking-modal .lt-booking-mode-option small {
    color: #b4bdca;
}
html[data-theme="dark"] #booking-modal .lt-booking-mode-option:hover,
html[data-theme="dark"] #booking-modal .lt-booking-mode-option[aria-pressed="true"] {
    background: #371f25;
    border-color: #ef4444;
}
@media(max-width: 390px) {
    #booking-modal .modal-content { padding: 24px 18px; }
    #booking-modal .lt-booking-mode-option {
        flex-direction: column;
        align-items: flex-start;
        min-height: 95px;
    }
}

/* Correção localizada: seleção da modalidade no resumo mobile (14/11/2026).
   Evita que o bottom sheet prenda o toque/oculte o botão de continuar. */
@media (max-width: 700px) {
    body[data-lt-page="agenda"] #booking-modal {
        z-index: 1100;
        overflow-y: auto;
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
    }
    body[data-lt-page="agenda"] #booking-modal .modal-content {
        margin: 0 auto;
        max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }
    body[data-lt-page="agenda"] #booking-modal .lt-booking-mode-option {
        position: relative;
        min-height: 96px;
        touch-action: manipulation;
    }
    body[data-lt-page="agenda"] #booking-modal .modal-actions {
        position: sticky;
        bottom: 0;
        z-index: 2;
        padding: 12px 0 max(8px, env(safe-area-inset-bottom, 0px));
        background: #fff;
    }
    html[data-theme="dark"] body[data-lt-page="agenda"] #booking-modal .modal-actions {
        background: #0d0d12;
    }
}
