/* ==========================================================================
   TennisShop Gym v2 — calendar-frontend.css
   Calendario interactivo moderno. Sin cintillos decorativos genéricos.
   Las cards expresan jerarquía por tipografía, no por bordes superiores.
   ========================================================================== */

.tsg-calendar-container {
    --tsg-blue: #001489;
    --tsg-blue-deep: #3333cc;
    --tsg-blue-dark: #000d5c;
    --tsg-blue-light: #4997f6;
    --tsg-blue-50: #7f89c4;
    --tsg-orange: #e66415;
    --tsg-orange-lt: #ff7a2d;
    --tsg-orange-50: #f3b08a;
    --tsg-ink: #141414;
    --tsg-gray: #cccccc;
    --tsg-muted: #64748b;
    --tsg-subtle: #94a3b8;
    --tsg-bg: #f7f8fc;
    --tsg-surface: #ffffff;
    --tsg-border: #e9ecf3;
    --tsg-font-display: "Barlow Condensed","Futura Extra Black Condensed","Oswald",Impact,sans-serif;
    --tsg-font-body: "Montserrat","Gotham",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;

    font-family: var(--tsg-font-body);
    color: var(--tsg-ink);
    padding: 0;
    background: transparent;
    box-shadow: none;
    position: relative;
}

/* ─── Barra de control: 3 columnas (nav · filtros · paginación) ──────────────── */
.tsg-calendar-container .tsg-control-bar {
    display: grid;
    grid-template-columns: minmax(0, auto) 1fr minmax(0, auto);
    align-items: center;
    gap: 18px;
    background: var(--tsg-surface);
    border-radius: 18px;
    box-shadow: 0 4px 16px rgba(0,20,137,.05);
    padding: 14px 20px;
    margin-bottom: 22px;
}
@media (max-width: 900px) {
    .tsg-calendar-container .tsg-control-bar { grid-template-columns: 1fr; gap: 12px; }
}

.tsg-bar-nav { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tsg-bar-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.tsg-bar-pages { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }

.tsg-nav-btn {
    width: 38px; height: 38px;
    border-radius: 50%;
    border: none;
    background: rgba(0,20,137,.06);
    color: var(--tsg-blue);
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 700;
    transition: background .2s ease, color .2s ease, transform .15s ease;
}
.tsg-nav-btn:hover:not(:disabled) { background: var(--tsg-blue); color: #fff; transform: scale(1.06); }
.tsg-nav-btn:disabled { opacity: .35; cursor: not-allowed; }
.tsg-nav-btn--today {
    width: auto; padding: 0 18px;
    border-radius: 999px;
    background: var(--tsg-orange);
    color: #fff;
    font-weight: 800; font-size: 12px;
    text-transform: uppercase; letter-spacing: 0.6px;
    height: 38px;
}
.tsg-nav-btn--today:hover { background: var(--tsg-orange-lt); transform: none; }

.tsg-week-title {
    font-family: var(--tsg-font-display);
    font-style: italic;
    font-weight: 900;
    text-transform: uppercase;
    font-size: 22px;
    color: var(--tsg-blue);
    white-space: nowrap;
    letter-spacing: -0.3px;
    margin-left: 6px;
    line-height: 1;
}

/* Filtros estilo pill */
.tsg-filter-select {
    appearance: none; -webkit-appearance: none;
    background: #fff url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23001489' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 14px center;
    border: 1.5px solid var(--tsg-border);
    border-radius: 999px;
    padding: 9px 38px 9px 18px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--tsg-font-body);
    color: var(--tsg-ink);
    cursor: pointer;
    width: 220px;
    transition: border-color .2s ease, box-shadow .2s ease;
    height: 38px;
    line-height: 1;
}
.tsg-filter-select:hover,
.tsg-filter-select:focus { border-color: var(--tsg-orange); box-shadow: 0 0 0 3px rgba(230,100,21,.15); outline: none; }

/* Paginación (puntos por bloque) */
.tsg-page-dot {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: transparent;
    border: 1.5px solid var(--tsg-border);
    color: var(--tsg-muted);
    font-weight: 700;
    font-size: 12px;
    font-family: var(--tsg-font-body);
    cursor: pointer;
    transition: all .15s ease;
}
.tsg-page-dot:hover { border-color: var(--tsg-blue); color: var(--tsg-blue); }
.tsg-page-dot.is-active { background: var(--tsg-blue); border-color: var(--tsg-blue); color: #fff; }

/* ─── Grid del calendario ─────────────────────────────────────────────────────── */
.tsg-calendar-grid {
    display: grid;
    gap: 14px;
    animation: tsg-cal-fade .35s ease;
}
@keyframes tsg-cal-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.tsg-calendar-column { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* Cabecera de día — sin caja blanca, sólo tipografía */
.tsg-day-header {
    padding: 8px 0 4px;
    text-align: center;
    position: relative;
}
.tsg-day-header__name {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--tsg-font-display);
    font-style: italic;
    font-weight: 900;
    font-size: 20px;
    text-transform: uppercase;
    color: var(--tsg-blue);
    letter-spacing: -0.3px;
    line-height: 1;
}
.tsg-day-header__date {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--tsg-muted);
    margin-top: 4px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}
.tsg-today-pill {
    background: var(--tsg-orange);
    color: #fff;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 999px;
    line-height: 1;
}
.tsg-calendar-column.is-today .tsg-day-header__name { color: var(--tsg-orange); }

/* Banner "AHORA" — sólo en la columna de hoy: clase en curso o próxima */
.tsg-now-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 6px;
    text-align: center;
    justify-content: center;
}
.tsg-now-banner__text strong { font-weight: 900; }
.tsg-now-banner--live {
    background: rgba(230,100,21,.12);
    color: var(--tsg-orange);
}
.tsg-now-banner__dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--tsg-orange);
    animation: tsg-pulse-tag 1.4s ease-in-out infinite;
    flex-shrink: 0;
}
.tsg-now-banner--next {
    background: rgba(0,20,137,.06);
    color: var(--tsg-blue);
}
.tsg-now-banner--done {
    background: transparent;
    color: var(--tsg-subtle);
    font-weight: 600;
    font-style: italic;
}

.tsg-day-body { display: flex; flex-direction: column; gap: 12px; }
.tsg-no-classes {
    background: transparent;
    padding: 16px 10px;
    text-align: center;
    color: var(--tsg-subtle);
    font-size: 12px;
    font-style: italic;
    border: 1px dashed var(--tsg-border);
    border-radius: 14px;
}

/* ─── Card MODERNA: sin franjas superiores, jerarquía por tipo ───────────────── */
.tsg-class-item {
    --card-accent: var(--tsg-orange);
    position: relative;
    background: var(--tsg-surface);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 14px rgba(15,23,42,.05);
    cursor: pointer;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
    isolation: isolate;
    animation: tsg-fade-in .35s ease both;
    border: 1px solid transparent;
}
@keyframes tsg-fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.tsg-class-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 42px rgba(15,23,42,.12);
    border-color: rgba(0,20,137,.08);
}

/* Icono FA de fondo (decorativo, muy sutil) */
.tsg-class-item__bg-icon {
    position: absolute;
    right: -8px; bottom: -18px;
    font-size: 100px;
    color: var(--card-accent);
    opacity: 0.07;
    pointer-events: none;
    z-index: 0;
    line-height: 1;
    transform: rotate(-8deg);
}

.tsg-class-time-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}
.tsg-class-time {
    font-family: var(--tsg-font-body);
    font-weight: 800;
    font-size: 13px;
    color: var(--card-accent);
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
.tsg-class-icon {
    color: var(--card-accent);
    font-size: 16px;
    opacity: .85;
}

.tsg-class-title {
    font-family: var(--tsg-font-display);
    font-style: italic;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.3px;
    font-size: 19px;
    line-height: 1.02;
    color: var(--tsg-blue);
    margin: 4px 0 2px;
    position: relative;
    z-index: 1;
    word-wrap: break-word;
}
.tsg-class-discipline {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    color: var(--card-accent);
    position: relative;
    z-index: 1;
}

.tsg-class-meta {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 12px;
    color: var(--tsg-muted);
    margin-top: 8px;
    position: relative;
    z-index: 1;
}
.tsg-class-meta > div {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tsg-class-meta i { color: var(--tsg-blue-50); font-size: 11px; width: 12px; text-align: center; flex-shrink: 0; }
.tsg-class-meta span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.tsg-class-instructor {
    display: flex; align-items: center; gap: 8px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--tsg-border);
    position: relative;
    z-index: 1;
    min-width: 0;
}
.tsg-class-instructor__avatar {
    width: 26px; height: 26px; border-radius: 50%;
    background: linear-gradient(135deg, var(--tsg-blue-50), var(--tsg-orange-50));
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,20,137,.18);
}
.tsg-class-instructor__name {
    font-size: 12px;
    font-weight: 600;
    color: var(--tsg-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* Badge "marcada" */
.tsg-marked-badge {
    position: absolute;
    top: 10px; right: 10px;
    background: #16a34a;
    color: #fff;
    width: 22px; height: 22px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px;
    z-index: 3;
    box-shadow: 0 4px 10px rgba(22,163,74,.35);
}

/* ─── Estados ─────────────────────────────────────────────────────────────────── */
.tsg-class-item.tsg-status-finished {
    filter: grayscale(.85);
    opacity: .5;
    background: #fafbfc;
    box-shadow: none;
}
.tsg-class-item.tsg-status-finished:hover { transform: none; box-shadow: 0 2px 8px rgba(15,23,42,.04); border-color: transparent; }

.tsg-class-item.tsg-status-in_progress {
    --card-accent: var(--tsg-orange);
    border: 2px solid var(--tsg-orange);
    box-shadow: 0 10px 30px rgba(230,100,21,.22);
    animation: tsg-fade-in .35s ease both, tsg-pulse-progress 2.4s ease-in-out infinite;
}
.tsg-class-item.tsg-status-in_progress::after {
    content: "EN CURSO";
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--tsg-orange);
    color: #fff;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.8px;
    padding: 4px 9px;
    border-radius: 999px;
    z-index: 3;
    animation: tsg-pulse-tag 1.4s ease-in-out infinite;
}
/* Si la card está marcada Y en curso, movemos el check verde a la izquierda
   para no colisionar con la pill "EN CURSO" del top-right. */
.tsg-class-item.tsg-status-in_progress .tsg-marked-badge {
    right: auto;
    left: 10px;
}
@keyframes tsg-pulse-progress {
    0%,100% { box-shadow: 0 8px 24px rgba(230,100,21,.18); }
    50%     { box-shadow: 0 14px 38px rgba(230,100,21,.4); }
}
@keyframes tsg-pulse-tag {
    0%,100% { transform: scale(1); opacity: 1; }
    50%     { transform: scale(1.05); opacity: .92; }
}

/* ─── Modal de detalle ────────────────────────────────────────────────────────── */
.tsg-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,13,92,.55);
    backdrop-filter: blur(6px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: tsg-fade-in .25s ease;
    padding: 16px;
}
.tsg-modal-card {
    background: var(--tsg-surface);
    border-radius: 24px;
    width: 100%;
    max-width: 520px;
    padding: 36px 32px 30px;
    box-shadow: 0 30px 80px rgba(0,0,0,.35);
    position: relative;
    animation: tsg-modal-in .3s ease;
    max-height: 90vh;
    overflow-y: auto;
}
@keyframes tsg-modal-in { from { opacity: 0; transform: translateY(20px) scale(.97); } to { opacity: 1; transform: none; } }

.tsg-modal-close {
    position: absolute; top: 14px; right: 16px;
    background: rgba(15,23,42,.05);
    width: 34px; height: 34px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--tsg-ink);
    transition: background .15s ease, color .15s ease;
    line-height: 1;
}
.tsg-modal-close:hover { background: #dc2626; color: #fff; }

.tsg-modal-title {
    font-family: var(--tsg-font-display);
    font-style: italic; font-weight: 900;
    text-transform: uppercase;
    color: var(--tsg-blue);
    font-size: 30px;
    line-height: 1;
    margin: 8px 0 4px;
    letter-spacing: -0.4px;
}
.tsg-modal-discipline { font-size: 12px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; color: var(--tsg-orange); }

.tsg-modal-info {
    background: rgba(0,20,137,.04);
    padding: 16px 18px;
    border-radius: 14px;
    margin: 18px 0;
    font-size: 14px;
    line-height: 1.6;
}
.tsg-modal-info p { margin: 4px 0; color: var(--tsg-ink); }
.tsg-modal-info strong { color: var(--tsg-blue); font-weight: 700; }

.tsg-modal-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }

/* Botones del modal — colores sólidos con texto blanco bien contrastado */
.tsg-modal-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    padding: 14px 22px;
    border-radius: 999px;
    font-family: var(--tsg-font-body);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 13px;
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease, color .15s ease, border-color .15s ease;
    line-height: 1;
}
.tsg-modal-btn--primary {
    background: var(--tsg-blue);
    color: #ffffff;
    border-color: var(--tsg-blue);
}
.tsg-modal-btn--primary:hover { background: var(--tsg-blue-dark); border-color: var(--tsg-blue-dark); color: #fff; transform: translateY(-2px); }
.tsg-modal-btn--orange {
    background: var(--tsg-orange);
    color: #ffffff;
    border-color: var(--tsg-orange);
}
.tsg-modal-btn--orange:hover { background: var(--tsg-orange-lt); border-color: var(--tsg-orange-lt); color: #fff; transform: translateY(-2px); }
.tsg-modal-btn--wa {
    background: #25D366;
    color: #ffffff;
    border-color: #25D366;
}
.tsg-modal-btn--wa:hover { background: #1eb058; border-color: #1eb058; color: #fff; transform: translateY(-2px); }
.tsg-modal-btn--admin {
    background: #ffffff;
    color: var(--tsg-blue);
    border-color: var(--tsg-blue);
}
.tsg-modal-btn--admin:hover { background: var(--tsg-blue); color: #fff; transform: translateY(-2px); }
.tsg-modal-btn:disabled,
.tsg-modal-btn.is-disabled {
    cursor: not-allowed;
    transform: none !important;
    background: #eef2f7 !important;
    color: #475569 !important;
    border-color: #cbd5e1 !important;
    opacity: 1;
    box-shadow: none;
}

.tsg-loader {
    grid-column: 1/-1;
    text-align: center;
    padding: 40px;
    color: var(--tsg-muted);
    font-weight: 600;
    font-family: var(--tsg-font-body);
}

/* ─── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .tsg-calendar-grid { grid-template-columns: repeat(3, 1fr) !important; }
}
@media (max-width: 700px) {
    .tsg-calendar-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .tsg-week-title { font-size: 16px; }
    .tsg-class-item { padding: 14px; }
    .tsg-class-title { font-size: 17px; }
}
@media (max-width: 480px) {
    .tsg-calendar-grid { grid-template-columns: 1fr !important; }
}

/* ==========================================================================
   SAFETY NET — borra artefactos heredados de versiones anteriores que
   pudieran estar en cache. NO TOCAR.
   ========================================================================== */

/* 1) Selector 1-7 días (movido a config del widget Elementor). */
.tsg-bar-views,
.tsg-view-btn,
[data-tsg-view] { display: none !important; }

/* 2) Cintillos bicolor superiores en cards (descartados como decoración). */
.tsg-class-item::before,
.tsg-modal-card::before,
.tsg-upcoming-item::before,
.tsg-inprogress-item::before,
.tsg-event-card::before,
.tsg-plan-card::before,
.tsg-send-plan::before,
.tsg-my-class::before,
.tsg-reservation::before,
.tsg-page-header::before { content: none !important; background: none !important; height: 0 !important; }


/* ─── Card de EVENTO ESPECIAL en la grilla (sustituye clases de su rango) ─────── */
.tsg-class-item--event {
    --card-accent: var(--tsg-orange);
    background: linear-gradient(135deg, rgba(0,20,137,.05) 0%, rgba(230,100,21,.09) 100%);
    border: 1.5px solid rgba(230,100,21,.45);
}
.tsg-class-item--event:hover { border-color: var(--tsg-orange); }
.tsg-event-flag {
    position: absolute;
    top: 10px; right: 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, var(--tsg-blue) 0%, var(--tsg-orange) 100%);
    color: #fff;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.8px;
    padding: 4px 9px;
    border-radius: 999px;
    z-index: 2;
}
.tsg-class-item--event .tsg-class-icon { display: none; } /* el flag ya marca el tipo */
