/* SAN MEP Solutions — Premium Training Schedule UI */

/* ---------- Schedule modal ---------- */
.ts-modal[hidden] { display: none !important; }

.ts-modal {
    position: fixed;
    inset: 0;
    z-index: 10060;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(4, 18, 31, .82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.ts-modal-panel {
    position: relative;
    isolation: isolate;
    width: min(1080px, 100%);
    max-height: 91vh;
    overflow: auto;
    border: 1px solid rgba(216, 230, 236, .9);
    border-radius: 22px;
    background:
        radial-gradient(circle at 100% 0%, rgba(19, 185, 164, .075), transparent 30%),
        linear-gradient(180deg, #ffffff 0%, #fbfdfe 100%);
    color: #183247;
    box-shadow: 0 30px 100px rgba(0, 0, 0, .42);
}

.ts-modal-panel::before {
    content: "";
    position: sticky;
    top: 0;
    z-index: 3;
    display: block;
    height: 6px;
    background: linear-gradient(90deg, #102f49 0%, #0fb7a4 55%, #b91c2c 100%);
}

.ts-modal-content {
    position: relative;
    padding: 30px;
}

.ts-modal-header {
    position: relative;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 3px 60px 24px 0;
    border-bottom: 1px solid #e5edf1;
    margin-bottom: 20px;
}

.ts-modal-header::after {
    content: "";
    position: absolute;
    top: 0;
    right: 5px;
    width: 150px;
    height: 100px;
    background: url("../images/logo.png") center / contain no-repeat;
    opacity: .055;
    pointer-events: none;
}

.ts-kicker {
    display: inline-block;
    color: #b91c2c;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.ts-modal-header h2 {
    margin: 9px 0 8px;
    color: #102f49;
    font: 800 clamp(24px, 3vw, 34px)/1.15 'Plus Jakarta Sans', Inter, sans-serif;
    letter-spacing: -.035em;
}

.ts-modal-header p {
    margin: 0;
    color: #63798a;
    font-size: 14px;
    line-height: 1.65;
}

.ts-close {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 4;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: #102f49;
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(16, 47, 73, .2);
    transition: background .2s ease, transform .2s ease;
}

.ts-close:hover {
    background: #0fb7a4;
    transform: rotate(90deg);
}

/* ---------- Course accordion ---------- */
.ts-course-list {
    display: grid;
    gap: 12px;
}

.ts-course {
    overflow: hidden;
    border: 1px solid #dce7ec;
    border-left: 4px solid #13b9a4;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 15px rgba(16, 47, 73, .035);
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.ts-course:nth-child(even) {
    border-left-color: #b91c2c;
}

.ts-course:hover {
    border-color: #b8d8d9;
    box-shadow: 0 9px 24px rgba(16, 47, 73, .08);
    transform: translateY(-1px);
}

.ts-course summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 22px;
    align-items: center;
    gap: 20px;
    min-height: 76px;
    padding: 17px 20px;
    cursor: pointer;
    list-style: none;
    background: linear-gradient(100deg, #f3f8fa 0%, #f8fbfc 58%, #f0f8f7 100%);
}

.ts-course:nth-child(even) summary {
    background: linear-gradient(100deg, #f7f8fa 0%, #fbfcfd 58%, #fdf5f5 100%);
}

.ts-course summary::-webkit-details-marker { display: none; }

.ts-course summary::after {
    content: "+";
    display: grid;
    place-items: center;
    color: #0a9f91;
    font-size: 25px;
    font-weight: 800;
    line-height: 1;
}

.ts-course:nth-child(even) summary::after { color: #b91c2c; }
.ts-course[open] summary::after { content: "−"; }

.ts-course-name {
    min-width: 0;
    color: #102f49;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.35;
}

.ts-course-date {
    justify-self: end;
    white-space: nowrap;
    color: #b91c2c;
    font-size: 13px;
    font-weight: 800;
    text-align: right;
    font-variant-numeric: tabular-nums;
    padding: 8px 12px;
    border: 1px solid rgba(185, 28, 44, .12);
    border-radius: 8px;
    background: rgba(255, 255, 255, .82);
}

.ts-course-body {
    padding: 20px;
    border-top: 1px solid #e6eef1;
    background: linear-gradient(180deg, #fff 0%, #fbfdfe 100%);
}

.ts-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.ts-stats div {
    padding: 14px;
    border: 1px solid #dcebea;
    border-radius: 11px;
    background: linear-gradient(135deg, #eff9f7, #f7fbfc);
}

.ts-stats div:nth-child(2) {
    background: linear-gradient(135deg, #f2f6fa, #f9fbfc);
}

.ts-stats div:nth-child(3) {
    border-color: #f0e0e2;
    background: linear-gradient(135deg, #fff6f6, #fbf9f9);
}

.ts-stats strong,
.ts-stats span { display: block; }

.ts-stats strong {
    color: #102f49;
    font-size: 22px;
    font-weight: 800;
}

.ts-stats span {
    margin-top: 4px;
    color: #6a7e8d;
    font-size: 11px;
    font-weight: 600;
}

.ts-timing {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-left: 3px solid #13b9a4;
    border-radius: 0 8px 8px 0;
    background: #f2f8f8;
    color: #405b70;
    font-size: 13px;
    line-height: 1.65;
}

.ts-timing span,
.ts-edit-note { color: #718493; }

.ts-table-wrap {
    overflow-x: auto;
    border: 1px solid #dce5e9;
    border-radius: 10px;
}

.ts-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
}

.ts-table th {
    background: #102f49;
    color: #fff;
    text-align: left;
    font-weight: 700;
    white-space: nowrap;
}

.ts-table th,
.ts-table td {
    padding: 11px 10px;
    border-right: 1px solid #e1e9ed;
    border-bottom: 1px solid #e1e9ed;
    vertical-align: top;
}

.ts-table th:last-child,
.ts-table td:last-child { border-right: 0; }

.ts-table tbody tr:last-child td { border-bottom: 0; }

.ts-table tbody tr:nth-child(even) { background: #f3f8fa; }
.ts-table tbody tr:nth-child(odd) { background: #fff; }

.ts-edit-note {
    margin: 0;
    font-size: 12px;
    line-height: 1.6;
}

.ts-footer-note {
    margin: 20px 0 0;
    padding-top: 15px;
    border-top: 1px solid #e6edf0;
    color: #718493;
    font-size: 11px;
    line-height: 1.6;
    text-align: center;
}

body.ts-modal-open { overflow: hidden; }

/* ---------- Training page schedule CTA ---------- */
.training-schedule-cta-section {
    position: relative;
    overflow: hidden;
    padding: 64px 0;
    background:
        radial-gradient(circle at 8% 15%, rgba(15, 183, 164, .09), transparent 28%),
        linear-gradient(135deg, #eef3f6 0%, #f7f9fa 52%, #edf5f4 100%);
}

.training-schedule-cta-section::before,
.training-schedule-cta-section::after {
    content: "";
    position: absolute;
    border: 1px solid rgba(16, 47, 73, .055);
    border-radius: 50%;
    pointer-events: none;
}

.training-schedule-cta-section::before {
    width: 330px;
    height: 330px;
    top: -190px;
    right: 7%;
}

.training-schedule-cta-section::after {
    width: 230px;
    height: 230px;
    bottom: -155px;
    left: 5%;
}

.training-schedule-cta {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    padding: clamp(26px, 4vw, 42px);
    border: 1px solid #d7e5e9;
    border-radius: 20px;
    background:
        radial-gradient(circle at 100% 0%, rgba(19, 185, 164, .075), transparent 35%),
        linear-gradient(120deg, #fff 0%, #fbfdfd 100%);
    box-shadow: 0 16px 42px rgba(16, 47, 73, .09);
}

.training-schedule-cta .section-kicker {
    color: #079b8e;
    font-weight: 800;
    letter-spacing: .13em;
}

.training-schedule-cta h2 {
    margin: 10px 0 9px;
    color: #102f49;
    font-family: 'Plus Jakarta Sans', Inter, sans-serif;
    font-size: clamp(23px, 3vw, 32px);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.025em;
}

.training-schedule-cta p {
    max-width: 680px;
    margin: 0;
    color: #607789;
    font-size: 15px;
    line-height: 1.7;
}

.training-schedule-cta button {
    flex: 0 0 auto;
    min-height: 56px;
    padding: 0 25px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(110deg, #102f49, #0b5964);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(16, 47, 73, .18);
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.training-schedule-cta button:hover {
    transform: translateY(-2px);
    background: linear-gradient(110deg, #0b5964, #0fb7a4);
    box-shadow: 0 14px 28px rgba(15, 140, 133, .22);
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
    .training-schedule-cta-section { padding: 42px 0; }

    .training-schedule-cta {
        align-items: flex-start;
        flex-direction: column;
        gap: 22px;
        padding: 25px;
    }

    .training-schedule-cta button { width: 100%; }
}

@media (max-width: 650px) {
    .ts-modal { padding: 8px; }

    .ts-modal-panel {
        max-height: 94vh;
        border-radius: 15px;
    }

    .ts-modal-content { padding: 20px 13px; }

    .ts-modal-header {
        padding: 2px 45px 17px 0;
        margin-bottom: 15px;
    }

    .ts-modal-header::after {
        right: 0;
        width: 90px;
        height: 75px;
    }

    .ts-modal-header h2 { font-size: 23px; }
    .ts-modal-header p { font-size: 13px; }

    .ts-close {
        width: 36px;
        height: 36px;
        font-size: 23px;
    }

    .ts-course summary {
        grid-template-columns: minmax(0, 1fr) auto 18px;
        gap: 8px;
        min-height: 68px;
        padding: 12px 10px;
    }

    .ts-course-name {
        font-size: 13px;
        overflow-wrap: anywhere;
    }

    .ts-course-date {
        font-size: 10px;
        padding: 6px 7px;
    }

    .ts-course summary::after { font-size: 21px; }

    .ts-course-body { padding: 13px 10px; }

    .ts-stats { gap: 6px; }
    .ts-stats div { padding: 10px 7px; }
    .ts-stats strong { font-size: 18px; }
    .ts-stats span { font-size: 10px; }

    .ts-table { min-width: 700px; }

    .training-schedule-cta h2 { font-size: 23px; }
    .training-schedule-cta p { font-size: 14px; }
}
