/* ============================================================
   HND Booking Calendar — teemaga ühilduv CSS
   FullCalendar 6.x override
   ============================================================ */

/* CSS muutujad — pärandatakse KS teemast */
.hnd-booking-calendar-wrapper {
    --fc-event-bg-color: #ff3030;
    --fc-event-border-color: #d32f2f;
    --fc-non-business-color: rgba(215, 215, 215, 0.25);
    --fc-today-bg-color: #f0faf2;
    --fc-border-color: #e3e8e5;
    --fc-button-bg-color: #2CB543;
    --fc-button-border-color: #2CB543;
    --fc-button-hover-bg-color: #1f9132;
    --fc-button-hover-border-color: #1f9132;
    --fc-button-active-bg-color: #1f9132;
    --fc-button-active-border-color: #1f9132;

    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

/* ── Kalender konteiner ── */
#hnd-booking-calendar {
    background: #fff;
    border: 1.5px solid #e3e8e5;
    border-radius: 14px;
    padding: 1.5rem;
    overflow: hidden;
}

/* ── Päis ── */
.hnd-bc-header {
    margin-bottom: 1.75rem;
    text-align: center;
}

.hnd-bc-header h2 {
    margin: 0 0 0.4rem;
    font-family: 'Familjen Grotesk', Georgia, serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #1c2420;
    letter-spacing: -0.02em;
}

.hnd-bc-description {
    color: #6a7872;
    font-size: 0.875rem;
    margin: 0;
    font-family: 'DM Sans', system-ui, sans-serif;
}

/* ── FullCalendar üldine ── */
.fc {
    font-family: 'DM Sans', system-ui, sans-serif !important;
}

/* Toolbar */
.fc .fc-toolbar-title {
    font-family: 'Familjen Grotesk', Georgia, serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1c2420;
    letter-spacing: -0.01em;
}

/* Nupud — rohelised, KS stiilis */
.fc .fc-button-primary {
    background-color: #2CB543;
    border-color: #2CB543;
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.45rem 1rem;
    border-radius: 6px;
    text-transform: none;
    letter-spacing: 0;
    box-shadow: none !important;
}
.fc .fc-button-primary:hover {
    background-color: #1f9132;
    border-color: #1f9132;
}
.fc .fc-button-primary:not(:disabled):active,
.fc .fc-button-primary:not(:disabled).fc-button-active {
    background-color: #1f9132;
    border-color: #1f9132;
}
.fc .fc-button-primary:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    background-color: #2CB543;
    border-color: #2CB543;
}
.fc .fc-button-primary:focus {
    box-shadow: 0 0 0 3px rgba(44,181,67,0.25) !important;
}

/* Päise kuupäevade lahtrid */
.fc-col-header-cell-cushion {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6a7872;
    text-decoration: none !important;
    padding: 0.5rem 0;
}
.fc .fc-col-header-cell.fc-day-today .fc-col-header-cell-cushion {
    color: #2CB543;
}

/* Tänane päev */
.fc .fc-day-today {
    background-color: #f0faf2 !important;
}

/* Mitteaktiivsed päevad */
.fc .fc-day.inactive-day {
    background-color: rgba(245, 245, 245, 0.6) !important;
}
.fc .fc-day.inactive-day .fc-timegrid-col-frame {
    opacity: 0.35;
}

/* Kellaajasammas */
.fc .fc-timegrid-slot-label {
    font-size: 0.72rem;
    color: #b0bdb8;
    font-weight: 500;
    vertical-align: top;
}
.fc .fc-timegrid-slot {
    height: 2rem;
}

/* Broneeritud ajad — punane */
.fc .fc-timegrid-event.booked-slot,
.fc .booked-slot,
#hnd-booking-calendar .booked-slot {
    background-color: #fee2e2 !important;
    border-color: #fca5a5 !important;
    border-radius: 3px;
}

/* Event title */
.fc-event-title {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
    padding: 2px 4px !important;
    text-align: center !important;
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    line-height: 1.2 !important;
    color: #dc2626 !important;
}

/* Ruudustiku jooned */
.fc .fc-timegrid-slot-minor {
    border-top-style: dashed;
    border-color: #f0f0f0;
}
.fc td, .fc th {
    border-color: #e3e8e5 !important;
}

/* Loading */
.hnd-bc-loading {
    text-align: center;
    padding: 2rem;
    color: #6a7872;
    font-size: 0.875rem;
    font-family: 'DM Sans', system-ui, sans-serif;
}

/* Viga */
.hnd-bc-error {
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}
.hnd-bc-error p {
    margin: 0;
    color: #856404;
    font-size: 0.875rem;
}


/* ============================================================
   MOBIIL — päevakalendar
   Alla 640px lülitab JS timeGridDay vaatele
   ============================================================ */

@media (max-width: 640px) {

    #hnd-booking-calendar {
        padding: 0.75rem;
        border-radius: 10px;
    }

    /* Toolbar — kompaktne */
    .fc .fc-toolbar {
        gap: 0.5rem;
        flex-wrap: wrap;
        justify-content: space-between !important;
    }
    .fc .fc-toolbar-chunk:nth-child(2) {
        order: -1;
        width: 100%;
        text-align: center;
    }
    .fc-header-toolbar {
        margin-bottom: 0.75rem !important;
    }
    .fc .fc-toolbar-title {
        font-size: 1rem;
    }
    .fc .fc-button {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }

    /* Päevakalendar — üks veerg, kõik ruum */
    .fc .fc-timegrid-col {
        min-width: 0;
    }
    .fc .fc-timegrid-slot {
        height: 2.25rem;
    }
    .fc .fc-timegrid-slot-label {
        font-size: 0.68rem;
        width: 2.5rem;
    }

    /* Päise kuupäev suurem mobiilis */
    .fc-col-header-cell-cushion {
        font-size: 0.9rem;
        padding: 0.6rem 0;
    }

}

/* Print */
@media print {
    .fc .fc-toolbar { display: none; }
    #hnd-booking-calendar { box-shadow: none; border: 1px solid #ccc; }
}