/* Modálne okno prihlásenia na tréning */

.tm-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow-y: auto;
}

.tm-overlay[hidden] {
    display: none;
}

.tm-dialog {
    position: relative;
    background: #fff;
    width: 100%;
    max-width: 460px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    border-radius: 14px;
    text-align: left;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
}

.tm-close {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 5;
    background: rgba(255, 255, 255, 0.85);
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    color: var(--dark);
    cursor: pointer;
}

/* Hero s obrázkom tréningu a prekrytím vo farbe typu tréningu
   (--tm-color nastavuje fillModal() z data.color, fallback neon) */
.tm-hero {
    position: relative;
    min-height: 170px;
    background-color: var(--tm-color, var(--neon));
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tm-hero__overlay {
    position: absolute;
    inset: 0;
    background-color: var(--tm-color, var(--neon));
    opacity: 0.68;
}

.tm-hero__content {
    position: relative;
    text-align: center;
    color: #fff;
    padding: 30px 20px 40px;
}

.tm-hero__title {
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 800;
    font-size: 30px;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 0;
}

.tm-hero__date {
    font-weight: 600;
    font-size: 15px;
    margin-top: 4px;
}

/* Avatar inštruktora prekrývajúci hero */
.tm-avatar {
    position: relative;
    width: 92px;
    height: 92px;
    margin: -46px auto 0;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    background: #eee;
}

.tm-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tm-body {
    padding: 18px 22px 26px;
}

/* Informačné riadky */
.tm-info__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid #ececec;
    font-size: 15px;
}

.tm-info__row:last-child {
    border-bottom: none;
}

.tm-info__label {
    color: var(--dark);
}

.tm-info__value {
    text-align: right;
    font-weight: 500;
}

.tm-info__value--price {
    font-weight: 700;
}

.tm-info__link {
    color: var(--neon);
    font-weight: 700;
    text-decoration: underline;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

/* explicitný display by inak prebil atribút hidden */
.tm-info__link[hidden] {
    display: none;
}

/* Bonus pre inštruktora */
.tm-tip {
    margin-top: 16px;
    text-align: center;
}

.tm-tip__label {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 10px;
}

.tm-tip__options {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tm-chip {
    border: 2px solid var(--neon);
    background: #fff;
    color: var(--neon);
    font-weight: 700;
    font-size: 14px;
    padding: 9px 13px;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

.tm-chip--active {
    background: var(--neon);
    color: #fff;
}

/* Akčné tlačidlá */
.tm-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.tm-btn {
    flex: 1;
    padding: 15px 0;
    border-radius: 8px;
    font-weight: 700;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    border: 2px solid transparent;
}

.tm-btn--secondary {
    background: #fff;
    border-color: #d9d9d9;
    color: var(--dark);
}

.tm-btn--primary {
    background: var(--neon);
    color: #fff;
}

.tm-btn--primary:disabled {
    opacity: 0.6;
    cursor: wait;
}

.tm-btn--danger {
    background: #d92d2d;
    color: #fff;
}

.tm-btn--danger:disabled {
    opacity: 0.7;
    cursor: wait;
}

/* Stav „Odhlasujem..." — spinner pred textom tlačidla */
.tm-btn--loading {
    pointer-events: none;
}

.tm-btn--loading::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 9px;
    vertical-align: -2px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: tmSpin 0.7s linear infinite;
}

@keyframes tmSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   Krok potvrdenia odhlásenia (tmStepCancel)
   ========================================================================== */

.tm-cancel__question {
    margin: 6px 0 14px;
    font-size: 19px;
    font-weight: 800;
    text-align: center;
    color: var(--dark);
}

.tm-cancel__notice {
    margin: 0 0 6px;
    padding: 13px 15px;
    border-radius: 8px;
    font-size: 14.5px;
    line-height: 1.45;
    font-weight: 600;
}

.tm-cancel__notice--ok {
    background: rgba(29, 158, 68, 0.1);
    border: 1px solid rgba(29, 158, 68, 0.35);
    color: #15722f;
}

.tm-cancel__notice--warn {
    background: rgba(217, 45, 45, 0.08);
    border: 1px solid rgba(217, 45, 45, 0.4);
    color: #b51f1f;
    font-weight: 700;
}

/* Popis tréningu */
.tm-desc {
    margin-top: 24px;
}

.tm-desc__heading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 15px;
    margin-bottom: 8px;
}

.tm-desc__icon {
    width: 20px;
    height: 20px;
}

.tm-desc__text {
    font-size: 14px;
    line-height: 1.55;
    color: var(--dark);
    white-space: pre-line;
}

/* Chybová hláška v modali */
.tm-error {
    background: #fdecec;
    border: 1px solid #f5c6cb;
    color: #b02a37;
    font-size: 14px;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    text-align: center;
}

/* Krok: prihlásenie úspešné */
.tm-success {
    text-align: center;
}

.tm-cal {
    display: flex;
    justify-content: center;
    gap: 28px;
    margin: 6px 0 18px;
}

.tm-cal__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--dark);
    font-size: 13px;
    font-weight: 600;
}

.tm-cal__item i {
    font-size: 34px;
    color: var(--neon);
}

.tm-success__title {
    font-weight: 800;
    font-size: 20px;
    margin-bottom: 14px;
}

.tm-success__info {
    font-size: 15px;
    margin-bottom: 16px;
}

.tm-success__info-label {
    font-weight: 700;
    margin-right: 6px;
}

.tm-upsell {
    background: #fafafa;
    border: 1px solid #ececec;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
    text-align: left;
}

.tm-upsell__price {
    color: var(--neon);
    font-weight: 800;
}

/* Krok: miestenka potvrdená */
.tm-done {
    text-align: center;
}

.tm-done__title {
    font-weight: 800;
    font-size: 20px;
    margin: 8px 0 6px;
}

.tm-done__sub {
    font-size: 15px;
    margin-bottom: 18px;
}

.tm-done__seat {
    margin-bottom: 18px;
}

.tm-done__seat-label {
    font-size: 14px;
    margin-bottom: 6px;
}

.tm-done__seat-value {
    font-weight: 800;
    font-size: 18px;
    letter-spacing: 1px;
}

/* Tooltip OBSADENÉ */
.tm-seat__tooltip {
    position: absolute;
    transform: translate(-50%, -120%);
    background: #1a1a1a;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 10;
    pointer-events: none;
}

/* Krok 2: výber miestenky */
.tm-seat__heading {
    text-align: center;
    font-size: 16px;
    margin-bottom: 14px;
}

.tm-seat__map {
    border: 2px solid #ececec;
    border-radius: 12px;
    padding: 16px 10px;
    overflow-x: auto;
}

.tm-seat__stage {
    text-align: center;
    margin: 4px 0 14px;
}

.tm-seat__stage span {
    display: inline-block;
    background: #e4e4e4;
    color: var(--dark);
    font-weight: 700;
    font-size: 14px;
    padding: 7px 26px;
    border-radius: 8px;
}

.tm-seat__grid {
    display: flex;
    flex-direction: column;
    gap: 7px;
    align-items: center;
}

.tm-seat__row {
    display: flex;
    gap: 7px;
    justify-content: center;
    align-items: center;
}

.tm-seat__row-label {
    width: 16px;
    font-size: 12px;
    font-weight: 700;
    color: #b5b5b5;
    text-align: center;
    flex-shrink: 0;
}

.tm-seat__seats {
    display: flex;
    gap: 7px;
}

.tm-seat__btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: none;
    background: #7be495;
    color: rgba(0, 60, 20, 0.55);
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
}

.tm-seat__btn--occupied {
    background: #e96d6d;
    color: rgba(80, 0, 0, 0.5);
    cursor: not-allowed;
}

.tm-seat__btn--selected {
    background: #1d9e44;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
}

.tm-seat__gap {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    visibility: hidden;
}

.tm-seat__info {
    text-align: center;
    font-size: 14px;
    margin: 12px 0 4px;
    min-height: 18px;
}

.tm-seat__info strong {
    font-weight: 700;
}

.tm-seat__actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.tm-seat__back {
    background: none;
    border: none;
    color: #9a9a9a;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px;
}

/* Zákaz scrollovania stránky pod otvoreným modalom */
body.tm-open {
    overflow: hidden;
}

/* Mobil: fullscreen */
@media (max-width: 768px) {
    .tm-overlay {
        padding: 0;
        align-items: stretch;
    }

    .tm-dialog {
        max-width: none;
        max-height: none;
        height: 100%;
        border-radius: 0;
    }
}

/* ==========================================================================
   Po prihlásení bez reloadu — zelený záblesk riadku/karty + plávajúci toast
   ========================================================================== */

.tm-flash {
    animation: tmFlash 1.8s ease;
}

@keyframes tmFlash {
    0% {
        box-shadow: 0 0 0 0 rgba(29, 158, 68, 0.55);
        background-color: rgba(29, 158, 68, 0.16);
    }
    60% {
        background-color: rgba(29, 158, 68, 0.08);
    }
    100% {
        box-shadow: 0 0 0 16px rgba(29, 158, 68, 0);
        background-color: transparent;
    }
}

.tm-toast {
    position: fixed;
    left: 50%;
    bottom: 30px;
    transform: translate(-50%, 18px);
    display: flex;
    align-items: center;
    gap: 10px;
    background: #1d9e44;
    color: #fff;
    padding: 13px 24px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
    opacity: 0;
    transition: opacity 0.35s ease, transform 0.35s ease;
    z-index: 1400;
    pointer-events: none;
    max-width: calc(100vw - 32px);
}

.tm-toast--show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.tm-toast__check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #fff;
    color: #1d9e44;
    font-weight: 800;
    font-size: 13px;
}

/* Neutrálny (tmavý) toast — odhlásenie z tréningu */
.tm-toast--neutral {
    background: #2b2b31;
}

.tm-toast--neutral .tm-toast__check {
    color: #2b2b31;
}

/* Záblesk riadku po odhlásení — neutrálny, odlíšený od zeleného tm-flash */
.tm-flash--out {
    animation: tmFlashOut 1.8s ease;
}

@keyframes tmFlashOut {
    0% {
        box-shadow: 0 0 0 0 rgba(43, 43, 49, 0.4);
        background-color: rgba(43, 43, 49, 0.12);
    }
    60% {
        background-color: rgba(43, 43, 49, 0.06);
    }
    100% {
        box-shadow: 0 0 0 16px rgba(43, 43, 49, 0);
        background-color: transparent;
    }
}

/* Potvrdenie zablokované — tréning už začal */
.tm-btn--disabled,
.tm-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}
