@media (max-width: 768px) {

    /* Контейнер на календара - рамка, отстояние, закръгление */
    #calendar-wrapper {
        margin: 20px 10px;
        padding: 10px;
        border-radius: 8px;
    }

    /* Инструментите (заглавие, стрелки и т.н.) подредени вертикално на мобилни */
    .fc-toolbar {
        flex-direction: column;
        gap: 8px;
    }

    /* Разстояние между бутоните */
    .fc .fc-button-group>.fc-button:not(:last-child) {
        margin-right: 3px;
    }

    /* Минимална височина на ден в month view */
    .fc-daygrid-day-frame {
        min-height: 50px;
    }

    .fc-timegrid {
        height: auto !important;
        max-height: none !important;
        overflow-y: visible !important;
    }

    /* Премахване на нежелан scroll в timegrid */
    .fc-timegrid-body,
    .fc-timegrid-slots,
    .fc-timegrid-cols {
        overflow: unset !important;
    }

    /* Отстояние вдясно при списъчен изглед */
    .fc .fc-list-day-cushion {
        padding-right: 25px !important;
    }

    /* ===== POPUP СЪБИТИЕ ===== */
    #eventPreview {
        width: 80vw !important;
        max-height: 260px;
        overflow: hidden;
        transition: max-height 0.3s ease;
        z-index: 10000 !important;
        padding: 20px 24px !important;
        border-radius: 14px !important;
        background-color: #f1f3f4 !important;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25) !important;
        border: 1px solid #dadce0 !important;
        display: none;
    }

    #eventPreview.expanded {
        max-height: 1000px;
        overflow: auto;
    }

    #eventPreview.show {
        display: block;
    }

    /* Действия вътре в popup */
    .preview-actions {
        justify-content: center;
        margin-bottom: 10px;
    }

    /* Бутоните в popup */
    .preview-actions a,
    .preview-actions button,
    .preview-close {
        font-size: 16px;
    }

    /* X за затваряне */
    .preview-close {
        position: absolute;
        top: 10px;
        right: 14px;
    }

    /* ===== ТЕКСТОВИ СТИЛОВЕ ===== */

    /* Заглавие в навигацията */
    .fc-toolbar-title {
        font-size: 1.1rem !important;
        font-weight: 700 !important;
        color: #2a2929 !important;
    }

    /* Дни от седмицата */
    .fc-col-header-cell-cushion {
        color: #2a2929 !important;
        font-size: 0.85rem;
        font-weight: 500 !important;
    }

    /* Заглавие на събитие */
    .event-title {
        text-align: left !important;
        margin-bottom: 10px;
        font-size: 15px !important;
        font-weight: 500 !important;
        color: #333 !important;
    }

    /* Информация за събитие (час, място и т.н.) */
    .event-body div {
        flex-direction: row !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        gap: 6px;
        font-size: 14px;
        margin-bottom: 8px;
        line-height: 1.4;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* List - day text style */
    .fc-list-day-side-text {
        color: #282727 !important;
        font-weight: 700 !important;
        font-size: 0.85rem !important;
    }

    /* List - day style */
    .fc-list-day-text {
        color: #282727 !important;
        font-weight: 700 !important;
        font-size: 0.85rem !important;
    }

    .event-body i {
        margin-right: 4px;
        flex-shrink: 0;
    }

    /* ===== ОПИСАНИЕ ПРИ КЛИК ===== */
    .preview-description {
        flex-wrap: nowrap !important;
        align-items: center !important;
    }

    #previewDescription,
    .preview-description .desc-text {
        white-space: nowrap !important;
        overflow: hidden;
        text-overflow: ellipsis;
        transition: all 0.3s ease;
        flex: 1;
    }

    /* Разгънато състояние */
    #previewDescription.expanded,
    .preview-description.expanded .desc-text {
        white-space: normal !important;
        overflow: visible;
        text-overflow: initial;
    }

    /* ===== КАЛЕНДАР MONTH VIEW ===== */

    /* Премахваме точката от събитията */
    .fc-daygrid-event-dot {
        display: none !important;
    }

    /* Оправяме подравняването след махането на точката */
    .fc-daygrid-event {
        padding-left: 4px !important;
    }

    /* Основен стил на събитие в grid */
    .fc-event {
        font-size: 0.75rem !important;
        padding: 4px 6px;
        border-radius: 6px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Заглавие на събитие в dayGrid */
    /* .fc-event-title {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    } */

    /* Лека рамка между дните */
    .fc-daygrid-day {
        border: 1px solid #f0f0f0;
    }

    /* ===== НАВИГАЦИЯ — СТРЕЛКИ И ЗАГЛАВИЕ ===== */

    /* Централна зона със заглавие и стрелки */
    .fc-toolbar-chunk:nth-child(2) {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
    }

    /* Стил на стрелките */
    #prevBtn,
    #nextBtn {
        font-size: 1.2rem;
        padding: 4px 8px;
        background: none;
        border: none;
        color: #333;
        border-radius: 50%;
        cursor: pointer;
        transition: background 0.2s ease;
    }

    #prevBtn:hover,
    #nextBtn:hover {
        background-color: rgba(0, 0, 0, 0.05);
    }

    /* Заглавие на календара */
    .fc-toolbar-title {
        font-size: 1.1rem;
        font-weight: 600;
    }

    #todayBtn {
        display: none !important;
    }

    #todayBtnMobile.nav-tab {
        font-size: 0.85rem;
        font-weight: 550;
        color: #434141;
        background-color: transparent;
        border: none;
        border-radius: 99px;
        padding: 0 14px;
        height: 30px;
        cursor: pointer;
        transition: background-color 0.2s ease, color 0.2s ease;
        display: block !important;
        margin: 20px 0 10px auto;
        box-shadow: 0 0 1px rgba(24, 94, 224, 0.15), 0 6px 12px rgba(24, 94, 224, 0.15);
    }

    #todayBtnMobile.nav-tab:hover {
        background-color: #f0f4fa;
    }

    #todayBtnMobile.nav-tab.active {
        font-weight: 600;
        color: #185ee0;
        background-color: #e6eef9;
    }

    #todayBtnMobile {
        display: block !important;
    }

    .fc-toolbar .nav-tabs {
        display: none !important;
    }

    /* Event dot - list */
    .fc-list-event-dot {
        display: none !important;
    }

    .fc-list-event-graphic {
        display: none !important;
    }

    .fc-list-event-time,
    .fc-list-event-title {
        padding-left: 12px !important;
    }

    /*timeGrid layout - Week*/
    .fc .fc-timegrid-col-frame {
        border-left: 1px solid #dcdcdc;
        box-sizing: border-box;
    }

    .fc .fc-timegrid-axis-frame {
        border-left: none !important;
        border-right: 1px solid #e0e0e0;
    }

    .fc .fc-timegrid-slot,
    .fc .fc-timegrid-slot-label {
        height: 80px !important;
        min-height: 80px !important;
        line-height: 80px !important;
    }

    .fc .fc-timegrid-slot-minor {
        display: none !important;
    }

    .fc-timegrid-event-harness>.fc-timegrid-event {
        inset: 0 !important;
    }
}