/* =========================================
   KALENDÁR TD – HLAVNÉ ROZLOŽENIE
========================================= */

.td-calendar-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 25px 18px 40px;
    box-sizing: border-box;
    color: #e5e9e7;
    font-family: Arial, sans-serif;
}

.td-calendar-page-heading {
    margin: 0 0 16px;
}

.td-calendar-page-heading h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
}

.td-calendar-heading {
    margin: 0 0 16px;
}

.td-calendar-add {
    display: inline-flex;
    align-items: center;
    border: 0;
    border-radius: 30px;
    background: #19cc85;
    color: #082218;
    padding: 12px 22px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.td-calendar-add span:first-child {
    font-size: 18px;
    margin-right: 7px;
}

.td-calendar-section {
    background: linear-gradient(145deg, #202a25, #19211e);
    border: 1px solid #43564c;
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: 0 5px 16px #0003;
    box-sizing: border-box;
}

.td-calendar-main-section #calendar {
    width: 100%;
    min-width: 0;
    color: #e5e9e7;
}

.td-calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    padding: 14px 4px 2px;
    font-size: 13px;
    color: #dce5df;
}

.td-calendar-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.td-calendar-legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #3788d8;
    display: inline-block;
}

.td-calendar-legend-period {
    width: 34px;
    height: 13px;
    border-radius: 8px;
    background: #19cc85;
    display: inline-block;
}

.td-calendar-section-title {
    font-size: 19px;
    line-height: 1.3;
    color: #19cc85;
    margin: 0 0 14px;
    font-weight: 700;
}

/* =========================================
   FULLCALENDAR – KOMPLETNE TMAVÉ PREVEDENIE
========================================= */

.td-calendar-main-section .fc {
    color: #e5e9e7;
    background: transparent;
    font-family: Arial, sans-serif;
}

/* Všetky hlavné vnútorné plochy */
.td-calendar-main-section .fc .fc-view-harness,
.td-calendar-main-section .fc .fc-view,
.td-calendar-main-section .fc .fc-multimonth,
.td-calendar-main-section .fc .fc-multimonth-month,
.td-calendar-main-section .fc .fc-scrollgrid,
.td-calendar-main-section .fc .fc-scrollgrid-section,
.td-calendar-main-section .fc .fc-scrollgrid-section > td,
.td-calendar-main-section .fc .fc-scrollgrid-section table {
    background: transparent !important;
}

/* Nadpis mesiaca */
.td-calendar-main-section .fc .fc-multimonth-title {
    color: #19cc85 !important;
    font-size: 16px;
    font-weight: 700;
    padding: 10px 0;
}

/* Názvy dní */
.td-calendar-main-section .fc .fc-col-header,
.td-calendar-main-section .fc .fc-col-header-cell {
    background: #26332d !important;
}

.td-calendar-main-section .fc .fc-col-header-cell-cushion {
    color: #aebdb4 !important;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    padding: 8px 2px;
}

/* Bunky kalendára */
.td-calendar-main-section .fc .fc-daygrid-day {
    background: #1b2420 !important;
}

.td-calendar-main-section .fc .fc-daygrid-day-frame {
    background: transparent !important;
    min-height: 45px;
}

/* Čísla dní */
.td-calendar-main-section .fc .fc-daygrid-day-number {
    color: #dce5df !important;
    font-size: 12px;
    text-decoration: none;
    padding: 5px;
}

/* Dni z predchádzajúceho a nasledujúceho mesiaca */
.td-calendar-main-section .fc .fc-day-other {
    background: #171f1b !important;
}

.td-calendar-main-section .fc .fc-day-other .fc-daygrid-day-number {
    color: #65736b !important;
}

/* Dnešný deň */
.td-calendar-main-section .fc .fc-day-today {
    background: #19cc8520 !important;
}

.td-calendar-main-section .fc .fc-day-today .fc-daygrid-day-number {
    color: #19cc85 !important;
    font-weight: 700;
}

/* Ohraničenia a deliace čiary */
.td-calendar-main-section .fc .fc-scrollgrid,
.td-calendar-main-section .fc .fc-scrollgrid td,
.td-calendar-main-section .fc .fc-scrollgrid th,
.td-calendar-main-section .fc .fc-daygrid-day,
.td-calendar-main-section .fc .fc-col-header-cell,
.td-calendar-main-section .fc .fc-multimonth {
    border-color: #3c4942 !important;
}

/* Hlavička kalendára – názov a navigácia */
.td-calendar-main-section .fc .fc-toolbar {
    gap: 10px;
    flex-wrap: wrap;
}

.td-calendar-main-section .fc .fc-toolbar-title {
    color: #19cc85 !important;
    font-size: 22px;
    font-weight: 700;
}

/* Tlačidlá */
.td-calendar-main-section .fc .fc-button {
    background: #26332d !important;
    border: 1px solid #3c4a43 !important;
    color: #eef4f0 !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

.td-calendar-main-section .fc .fc-button:hover,
.td-calendar-main-section .fc .fc-button:focus {
    background: #35443b !important;
    border-color: #19cc85 !important;
    box-shadow: none !important;
}

.td-calendar-main-section .fc .fc-button-primary:not(:disabled).fc-button-active,
.td-calendar-main-section .fc .fc-button-primary:not(:disabled):active {
    background: #147c54 !important;
    border-color: #19cc85 !important;
    color: #ffffff !important;
}

.td-calendar-main-section .fc .fc-button:disabled {
    background: #202a25 !important;
    color: #77847c !important;
    opacity: 0.6;
}

/* Tréningové udalosti a obdobia */
.td-calendar-main-section .fc .fc-event {
    border: 0 !important;
    border-radius: 4px;
    color: #ffffff !important;
}

.td-calendar-main-section .fc .fc-event-title,
.td-calendar-main-section .fc .fc-event-time {
    color: #ffffff !important;
}

.td-calendar-main-section .fc .fc-daygrid-event {
    margin-top: 2px;
}

/* Odstránenie prípadných bielych pozadí vnútorných elementov */
.td-calendar-main-section .fc .fc-daygrid-day-bg,
.td-calendar-main-section .fc .fc-daygrid-day-events,
.td-calendar-main-section .fc .fc-daygrid-day-top,
.td-calendar-main-section .fc .fc-multimonth-header {
    background: transparent !important;
}

/* =========================================
   FILTER OBDOBIA ŠTATISTÍK
========================================= */

.td-calendar-period-section {
    padding: 16px 18px;
}

.td-calendar-period-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 13px;
}

.td-calendar-period-heading .td-calendar-section-title {
    margin: 0;
}

.td-calendar-period-info {
    color: #aab5af;
    font-size: 12px;
}

.td-calendar-period-controls {
    display: grid;
    grid-template-columns: minmax(190px, 1.4fr) repeat(2, minmax(150px, 1fr));
    gap: 12px;
}

.td-calendar-period-preset,
.td-calendar-period-date {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.td-calendar-period-controls label {
    color: #aab5af;
    font-size: 12px;
}

.td-calendar-period-controls select,
.td-calendar-period-controls input {
    width: 100%;
    min-width: 0;
    height: 42px;
    box-sizing: border-box;
    padding: 0 11px;
    border: 1px solid #3c4942;
    border-radius: 9px;
    background: #18211d;
    color: #eef4f0;
    font-family: inherit;
    font-size: 13px;
    color-scheme: dark;
    cursor: pointer;
}

.td-calendar-period-controls select:disabled,
.td-calendar-period-controls input:disabled {
    opacity: .48;
    cursor: not-allowed;
}

.td-calendar-period-controls select:focus,
.td-calendar-period-controls input:focus {
    outline: none;
    border-color: #19cc85;
    box-shadow: 0 0 0 2px #19cc8525;
}

.td-calendar-period-error {
    color: #ff8279;
    font-size: 12px;
    margin-top: 8px;
}

/* =========================================
   ZÁKLADNÉ ŠTATISTIKY
========================================= */

.td-calendar-basic-grid,
.td-calendar-regularity-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.td-calendar-basic-card,
.td-calendar-regularity-card {
    min-width: 0;
    padding: 15px 14px;
    background: #ffffff08;
    border: 1px solid #3c4942;
    border-radius: 12px;
    box-sizing: border-box;
}

.td-calendar-basic-label,
.td-calendar-regularity-label {
    display: block;
    min-height: 34px;
    color: #aab5af;
    font-size: 12px;
    line-height: 1.4;
}

.td-calendar-basic-value {
    display: block;
    margin-top: 7px;
    color: #19cc85;
    font-size: 27px;
    line-height: 1.15;
    font-weight: 700;
}

.td-calendar-basic-unit,
.td-calendar-regularity-unit {
    display: block;
    margin-top: 5px;
    color: #aab5af;
    font-size: 11px;
}

.td-calendar-regularity-value {
    display: block;
    margin-top: 7px;
    color: #eef4f0;
    font-size: 21px;
    line-height: 1.2;
    font-weight: 700;
}

.td-calendar-regularity-value span {
    color: #19cc85;
}

/* =========================================
   EXISTUJÚCE ŠTATISTICKÉ TABUĽKY
========================================= */

.td-calendar-existing-stats {
    overflow: hidden;
}

.td-calendar-existing-stats h2,
.td-calendar-existing-stats h3 {
    color: #19cc85;
}

.td-calendar-existing-stats table {
    width: 100%;
}

.td-calendar-existing-stats #treningyPoMesiacoch {
    width: 100%;
    border-collapse: collapse;
    color: #e7ece9;
    font-size: 14px;
}

.td-calendar-existing-stats #treningyPoMesiacoch th {
    background: #18211d;
    color: #e8efeb;
    font-size: 12px;
    padding: 12px 10px;
    text-align: center;
    border: 1px solid #3a4640;
}

.td-calendar-existing-stats #treningyPoMesiacoch td {
    padding: 10px;
    border: 1px solid #3a46408c;
    text-align: center;
    color: #e7ece9;
}

.td-calendar-existing-stats #treningyPoMesiacoch tbody tr:nth-child(odd) {
    background: #ffffff13;
}

.td-calendar-existing-stats #treningyPoMesiacoch tbody tr:nth-child(even) {
    background: #0002;
}

.td-calendar-existing-stats #toggleTableBtn {
    display: block;
    width: 100%;
    margin-top: 10px;
    border: 1px solid #3a4941;
    background: #26332d;
    color: #eef4f0;
    border-radius: 12px;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

/* =========================================
   MOBILNÉ ZOBRAZENIE
========================================= */

@media (max-width: 600px) {

    .td-calendar-page {
        padding: 20px 12px 30px;
    }

    .td-calendar-page-heading {
        margin: 0 2px 14px;
    }

    .td-calendar-page-heading h1 {
        font-size: 20px;
    }

    .td-calendar-heading {
        margin: 0 2px 14px;
    }

    .td-calendar-add {
        padding: 10px 14px;
        font-size: 12px;
    }

    .td-calendar-section {
        padding: 12px 10px;
        border-radius: 13px;
        margin-bottom: 12px;
    }

    .td-calendar-legend {
        gap: 13px;
        padding: 11px 2px 1px;
        font-size: 11px;
    }

    .td-calendar-section-title {
        font-size: 16px;
        margin-bottom: 11px;
    }

    .td-calendar-period-section {
        padding: 13px 10px;
    }

    .td-calendar-period-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
        margin-bottom: 12px;
    }

    .td-calendar-period-info {
        font-size: 11px;
    }

    .td-calendar-period-controls {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .td-calendar-period-preset {
        grid-column: 1 / -1;
    }

    .td-calendar-period-controls label {
        font-size: 11px;
    }

    .td-calendar-period-controls select,
    .td-calendar-period-controls input {
        height: 40px;
        padding: 0 8px;
        font-size: 12px;
    }

    .td-calendar-basic-grid,
    .td-calendar-regularity-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .td-calendar-basic-card,
    .td-calendar-regularity-card {
        padding: 12px 10px;
    }

    .td-calendar-basic-label,
    .td-calendar-regularity-label {
        font-size: 11px;
        min-height: 30px;
    }

    .td-calendar-basic-value {
        font-size: 24px;
    }

    .td-calendar-regularity-value {
        font-size: 19px;
    }

    .td-calendar-main-section .fc .fc-toolbar-title {
        font-size: 18px;
    }

    .td-calendar-main-section .fc .fc-button {
        font-size: 12px;
        padding: 5px 8px;
    }

    .td-calendar-main-section .fc .fc-col-header-cell-cushion {
        font-size: 10px;
        padding: 6px 1px;
    }

    .td-calendar-main-section .fc .fc-daygrid-day-number {
        font-size: 10px;
        padding: 3px;
    }

    .td-calendar-main-section .fc .fc-multimonth-title {
        font-size: 14px;
    }
}