/* === Kalendarz Szkolny - Frontend === */
:root {
    --sk-primary: #1A4D95;
    --sk-secondary: #961A30;
}

/* === Custom toolbar === */
.sk-cal-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}
.sk-cal-group-select {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-size: 0.9em;
    min-width: 160px;
    background: #fff;
    width: 100%;
}
.sk-cal-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border-radius: 10px;
    padding: 8px 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.sk-cal-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.sk-cal-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid #e0e0e0;
    background: #fff;
    color: #555;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.15s;
}
.sk-cal-nav-btn:hover {
    background: var(--sk-primary);
    border-color: var(--sk-primary);
    color: #fff;
}
.sk-cal-today-btn {
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    background: #fff;
    color: #555;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 500;
    transition: all 0.15s;
}
.sk-cal-today-btn:hover {
    background: var(--sk-primary);
    border-color: var(--sk-primary);
    color: #fff;
}
.sk-cal-title {
    flex: 1;
    text-align: center;
    font-weight: 600;
    font-size: 1.05rem;
    color: #333;
    text-transform: capitalize;
    white-space: nowrap;
}
.sk-cal-view-toggle {
    display: flex;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    flex-shrink: 0;
}
.sk-cal-view-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 34px;
    border: none;
    background: #fff;
    color: #999;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s;
}
.sk-cal-view-btn:first-child {
    border-right: 1px solid #e0e0e0;
}
.sk-cal-view-btn.active {
    background: var(--sk-primary);
    color: #fff;
}
.sk-cal-view-btn:hover:not(.active) {
    background: #f5f5f5;
    color: #333;
}

@media (max-width: 767px) {
    .sk-cal-toolbar {
        padding: 6px 8px;
        gap: 4px;
    }
    .sk-cal-nav-btn {
        width: 30px;
        height: 30px;
        font-size: 0.7rem;
    }
    .sk-cal-today-btn {
        padding: 3px 8px;
        font-size: 0.7rem;
    }
    .sk-cal-title {
        font-size: 0.9rem;
    }
    .sk-cal-view-btn {
        width: 32px;
        height: 30px;
        font-size: 0.75rem;
    }
    .sk-cal-group-select {
        font-size: 0.85em;
        padding: 6px 10px;
    }
}

/* Calendar container */
#sk-calendar {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

/* FullCalendar overrides */
.fc .fc-daygrid-day-number {
    font-weight: 500;
    color: #333;
}
.fc .fc-daygrid-day.fc-day-today {
    background: rgba(26, 77, 149, 0.06) !important;
}
.fc .fc-daygrid-more-link {
    color: var(--sk-secondary);
    font-weight: 600;
}
.fc .fc-list-event:hover td {
    background: rgba(26, 77, 149, 0.06);
}
.fc .fc-list-day-cushion {
    background: #f5f7fa !important;
}
/* List view: hide dot, color left border, more space for title */
.fc .fc-list-event-dot {
    display: none !important;
}
.fc .fc-list-event td:first-child {
    border-left: 4px solid var(--fc-event-bg-color, #1A4D95);
    border-radius: 0;
}
.fc .fc-list-event-time {
    white-space: nowrap;
    font-weight: 600;
    font-size: 0.85rem;
    padding-right: 6px !important;
    min-width: 0 !important;
    width: auto !important;
}
.fc .fc-list-event-title {
    font-size: 0.92rem;
    word-break: break-word;
}
.fc .fc-list-event-graphic {
    display: none !important;
}

/* === DESKTOP events === */
.fc .fc-event {
    border: none !important;
    border-radius: 5px !important;
    padding: 3px 8px !important;
    font-size: 0.78rem !important;
    cursor: pointer;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    line-height: 1.4 !important;
}
.fc .fc-event-time {
    font-weight: 600;
    margin-right: 4px;
}
.fc .fc-event-title {
    overflow: hidden;
    text-overflow: ellipsis;
}
.fc .fc-daygrid-event {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin: 1px 2px !important;
}

/* === MOBILE — dots instead of text === */
@media (max-width: 767px) {
    #sk-calendar {
        padding: 8px;
        border-radius: 8px;
    }
    /* Hide text, show dots */
    .fc .fc-daygrid-event-harness {
        display: inline-block !important;
        margin: 0 !important;
        width: auto !important;
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
    }
    .fc .fc-daygrid-event {
        display: inline-block !important;
        background: transparent !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        min-height: 0 !important;
    }
    .fc .fc-daygrid-day-events {
        display: flex !important;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 3px;
        padding: 3px 2px;
        min-height: 0 !important;
    }
    .fc .fc-daygrid-day-bottom {
        margin: 0 !important;
        padding: 0 !important;
    }
    .fc .fc-daygrid-more-link {
        font-size: 0.65rem;
    }
    /* Day cells tighter */
    .fc .fc-daygrid-day-frame {
        min-height: 48px !important;
    }
    .fc .fc-daygrid-day-number {
        font-size: 0.8rem;
        padding: 4px 6px 0 !important;
    }
    .fc .fc-col-header-cell-cushion {
        font-size: 0.75rem;
        padding: 4px 0 !important;
    }
}

/* Event dot (mobile) */
.sk-event-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.15s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.sk-event-dot:hover {
    transform: scale(1.3);
}

/* === Event popup overlay === */
.sk-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: skFadeIn 0.2s ease;
}
@keyframes skFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.sk-popup-container {
    position: relative;
    background: #fff;
    border-radius: 14px;
    max-width: 480px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 15px 50px rgba(0,0,0,0.2);
    animation: skSlideUp 0.25s ease;
}
@keyframes skSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.sk-popup {
    padding: 28px;
}
.sk-popup h4 {
    margin: 0 0 16px;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--sk-primary);
    padding-right: 30px;
    line-height: 1.35;
}
.sk-popup-meta {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
}
.sk-popup-meta li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 0;
    font-size: 0.9rem;
    color: #555;
    border-bottom: 1px solid #f0f0f0;
}
.sk-popup-meta li:last-child {
    border-bottom: none;
}
.sk-popup-meta li i {
    color: var(--sk-secondary);
    margin-top: 3px;
    min-width: 16px;
    text-align: center;
}
.sk-popup-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: #f5f5f5;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 4px 10px;
    border-radius: 8px;
    transition: all 0.15s;
}
.sk-popup-close:hover {
    color: #333;
    background: #eee;
}

/* Popup action buttons */
.sk-popup-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.sk-popup-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none !important;
    transition: all 0.2s;
    background: var(--sk-primary);
    color: #fff !important;
}
.sk-popup-btn:hover {
    background: #153d75;
    color: #fff !important;
}
.sk-popup-btn-secondary {
    background: #fff !important;
    color: #333 !important;
    border: 1px solid #ddd;
}
.sk-popup-btn-secondary:hover {
    background: #f5f5f5 !important;
    border-color: #bbb;
}

@media (max-width: 767px) {
    .sk-popup {
        padding: 20px;
    }
    .sk-popup-actions {
        flex-direction: column;
    }
    .sk-popup-btn {
        justify-content: center;
    }
}

/* === iCal subscribe section === */
.sk-ical-section {
    background: var(--cmnbg, #F0F4FA);
    border: 1px solid #e0e6ef;
    border-radius: 12px;
    overflow: hidden;
}
.sk-ical-main-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 22px 24px;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    gap: 16px;
    transition: background 0.15s;
}
.sk-ical-main-toggle:hover {
    background: rgba(0,0,0,0.02);
}
.sk-ical-toggle-left {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
.sk-ical-toggle-left > i {
    font-size: 1.4rem;
    color: var(--sk-primary);
    margin-top: 2px;
    flex-shrink: 0;
}
.sk-ical-main-chevron {
    font-size: 0.8rem;
    color: #aaa;
    transition: transform 0.25s;
    flex-shrink: 0;
}
.sk-ical-section.open .sk-ical-main-chevron {
    transform: rotate(180deg);
}
.sk-ical-main-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
    padding: 0 24px;
}
.sk-ical-section.open .sk-ical-main-body {
    max-height: 2000px;
    padding: 0 24px 24px;
}
.sk-ical-heading {
    color: var(--sk-primary);
    font-weight: 600;
    font-size: 1.1rem;
    margin: 0 0 4px;
}
.sk-ical-desc {
    color: #666;
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.45;
}
.sk-ical-school-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    background: #fff;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.sk-ical-school-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--sk-primary);
}
.sk-ical-school-label small {
    font-weight: 400;
    color: #888;
    font-size: 0.82rem;
}
.sk-ical-school-label i {
    font-size: 1.1rem;
}
.sk-ical-icons {
    display: flex;
    gap: 8px;
    align-items: center;
}
.sk-ical-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 1rem;
    text-decoration: none !important;
    transition: all 0.2s;
    border: 1px solid #ddd;
    background: #fff;
    color: #555 !important;
}
.sk-ical-icon:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.12);
}
.sk-ical-google:hover { background: #4285f4; border-color: #4285f4; color: #fff !important; }
.sk-ical-apple:hover { background: #333; border-color: #333; color: #fff !important; }
.sk-ical-outlook:hover { background: #0078d4; border-color: #0078d4; color: #fff !important; }
.sk-ical-group-heading {
    font-size: 0.82rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 10px;
}
.sk-ical-accordions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.sk-ical-accordion {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.sk-ical-accordion-header {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 600;
    color: #333;
    text-align: left;
    transition: background 0.15s;
}
.sk-ical-accordion-header:hover { background: #f8f9fb; }
.sk-ical-accordion-header .sk-dot { width: 10px; height: 10px; flex-shrink: 0; }
.sk-ical-accordion-title { flex: 1; }
.sk-ical-chevron {
    font-size: 0.7rem;
    color: #aaa;
    transition: transform 0.25s;
}
.sk-ical-accordion.open .sk-ical-chevron { transform: rotate(180deg); }
.sk-ical-accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.sk-ical-accordion.open .sk-ical-accordion-body { max-height: 500px; }
.sk-ical-group-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px 8px 36px;
    border-top: 1px solid #f0f0f0;
}
.sk-ical-group-row:last-child { padding-bottom: 12px; }
.sk-ical-group-name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    font-weight: 500;
    color: #444;
}
.sk-ical-group-name .sk-dot { width: 8px; height: 8px; }
.sk-ical-group-row .sk-ical-icons { gap: 6px; }
.sk-ical-group-row .sk-ical-icon {
    width: 30px;
    height: 30px;
    font-size: 0.85rem;
    border-radius: 6px;
}
.sk-ical-tip {
    margin: 16px 0 0;
    font-size: 0.8rem;
    color: #999;
    text-align: center;
}
.sk-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* Filter bar (legacy) */
.sk-filter-bar {
    background: #fff;
    border-radius: 10px;
    padding: 10px 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.sk-filter-btn, .sk-type-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border: 1.5px solid #ddd;
    border-radius: 20px;
    background: #fff;
    color: #555;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}
.sk-filter-btn:hover, .sk-type-btn:hover {
    border-color: var(--sk-primary);
    color: var(--sk-primary);
}
.sk-filter-btn.active, .sk-type-btn.active {
    background: var(--sk-primary);
    border-color: var(--sk-primary);
    color: #fff;
}

/* Subscribe box (shortcode) */
.sk-subscribe-box .sk-subscribe-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none !important;
    transition: all 0.2s;
    background: var(--sk-primary);
    color: #fff !important;
}

@media (max-width: 767px) {
    .sk-ical-main-toggle { padding: 16px 14px; }
    .sk-ical-main-body { padding: 0 14px; }
    .sk-ical-section.open .sk-ical-main-body { padding: 0 14px 18px; }
    .sk-ical-school-row { padding: 12px 14px; }
    .sk-ical-group-row { padding-left: 24px; }
    .sk-filter-bar { padding: 8px 10px; border-radius: 8px; }
    .sk-filter-btn, .sk-type-btn { padding: 3px 10px; font-size: 0.72rem; }
    /* List view overflow fix */
    .fc .fc-list { overflow-x: hidden; }
    .fc .fc-list-event-title a { word-break: break-word; white-space: normal !important; }
    .fc .fc-list-table { table-layout: fixed; width: 100% !important; }
    .fc .fc-list-table td { overflow: hidden; text-overflow: ellipsis; }
    #sk-calendar { overflow: hidden; max-width: 100vw; box-sizing: border-box; }
}
