/* Main Container */
.course-finder-wrapper {
    background: #f9f9f9;
    padding: 40px 20px;
    border-radius: 8px;
}

/* Header Styling */
.course-finder-header {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.course-finder-header h2 {
    margin-top: 0;
    font-size: 28px;
    font-weight: 700;
}

.course-finder-header p {
    color: #666;
    margin-bottom: 20px;
}

/* Filter Row Layout */
.filter-row {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Custom Multi-Select (The Chips Input) */
.custom-multi-select-wrapper {
    flex: 1;
    position: relative;
    min-width: 300px;
}

.selected-tags {
    border: 1px solid #ddd;
    background: #fff;
    min-height: 45px;
    border-radius: 4px;
    padding: 5px 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
    cursor: pointer;
}

.selected-tags .placeholder {
    color: #999;
}

/* Chips */
.course-tag {
    background: #eee;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.course-tag .remove {
    cursor: pointer;
    font-weight: bold;
    color: #666;
}

.course-tag .remove:hover {
    color: #d00;
}

/* Dropdown Options */
.dropdown-options {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    z-index: 999;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.option-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.option-item:hover {
    background: #f5f5f5;
}

/* Button */
.btn-yellow {
    background-color: #fbc02d;
    color: #fff;
    border: none;
    padding: 0 25px;
    height: 45px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-yellow:hover {
    background-color: #d32f2f;
}

/* Calendar Clean Up - Month View Styling */
#frontend-calendar {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
}

.toastui-calendar-layout {
    background-color: #fff !important;
    border: 1px solid #e5e5e5 !important;
}

/* Month Grid Styling */
.toastui-calendar-month {
    border: 1px solid #e5e5e5 !important;
}

.toastui-calendar-daygrid-cell {
    border-color: #e5e5e5 !important;
}

.toastui-calendar-day-name-container {
    position: unset !important;
}

/* Date Numbers Styling */
.toastui-calendar-template-monthDayName {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-align: center;
    padding: 12px 0;
    display: block;
    width: 100%;
}

/* Fix Day Names Container Alignment */
.toastui-calendar-day-name-item {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.toastui-calendar-day-name-item span {
    width: 100% !important;
    text-align: center !important;
}

.toastui-calendar-weekday-grid-date {
    font-size: 16px !important;
    font-weight: 400 !important;
    color: #333 !important;
    text-align: right;
    padding: 8px 12px !important;
}

/* Sunday dates in red */
.toastui-calendar-weekday-grid-date[data-date*="Sun"],
.toastui-calendar-template-monthDayName:first-child {
    color: #d32f2f !important;
}

/* Event Styling - Text-based list format */
.toastui-calendar-month-more {
    display: block !important;
    color: #999;
    font-size: 11px;
    margin-top: 4px;
    margin-left: 4px;
    font-weight: 600;
    cursor: pointer;
}

.toastui-calendar-month-more:hover {
    text-decoration: underline;
    color: #333;
}

.toastui-calendar-panel {
    border: none !important;
    background: transparent !important;
}

.toastui-calendar-event-time,
.toastui-calendar-event-allday {
    background: transparent !important;
    border: none !important;
    padding: 2px 8px !important;
    margin: 2px 0 !important;
    height: auto !important;
    min-height: 20px !important;
}

.toastui-calendar-event-time .toastui-calendar-event-time-content {
    display: flex !important;
    align-items: center;
    font-size: 12px !important;
    line-height: 1.4 !important;
    color: #333 !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    padding: 0 !important;
}

/* Remove time duration bar */
.toastui-calendar-time-date {
    display: none !important;
}

/* Remove the blue dot on current date */
.toastui-calendar-grid-cell-date-decorator::before {
    display: none !important;
}

.toastui-calendar-weekday-grid-date-decorator {
    background: transparent !important;
    border-radius: 0 !important;
    color: #333 !important;
}

/* Remove any blue circle/background on today's date */
.toastui-calendar-weekday-grid-date-decorator::before,
.toastui-calendar-weekday-grid-date-decorator::after {
    display: none !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .custom-multi-select-wrapper {
        min-width: 100%;
    }

    .btn-yellow {
        width: 100%;
    }

    #frontend-calendar {
        padding: 10px;
    }

    .toastui-calendar-event-time-content {
        font-size: 10px !important;
    }
}

@media (max-width: 480px) {
    .course-finder-wrapper {
        padding: 20px 10px;
    }

    .course-finder-header {
        padding: 15px;
        margin-bottom: 20px;
    }

    .course-finder-header h2 {
        font-size: 20px;
        line-height: 1.3;
    }

    #frontend-calendar {
        padding: 10px 5px;
    }

    .toastui-calendar-day-name-item {
        font-size: 11px !important;
        line-height: 20px !important;
    }

    .toastui-calendar-weekday-grid-date {
        font-size: 12px !important;
        padding: 4px 4px !important;
        margin-right: 0 !important;
    }

    .toastui-calendar-weekday-grid-more-events {
        font-size: 10px !important;
        height: 16px !important;
        line-height: 16px !important;
        margin-top: 2px !important;
    }

    .toastui-calendar-event-time-content {
        font-size: 9px !important;
        padding-left: 2px !important;
    }

    .filter-row {
        flex-direction: column;
        gap: 10px;
    }

    .custom-multi-select-wrapper {
        min-width: 100%;
        width: 100%;
    }

    .btn-yellow {
        width: 100%;
        font-size: 14px;
        height: 40px;
    }
}

/* Loading Spinner - Fixed Positioning */
.fe-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.fe-overlay.active {
    display: flex !important;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #fbc02d;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: auto;
    position: relative;
    top: 50%;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* --- Custom Modal Styles (Frontend) --- */
.mor-custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999999;
    /* Very High Z-Index to sit on top of everything */
    display: flex;
    /* Important for centering */
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.mor-custom-modal-box {
    background: #fff;
    width: 90%;
    max-width: 400px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: slideUp 0.2s ease-out;
    font-family: inherit;
    /* Inherit theme font */
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.mor-modal-header {
    background: #f9f9f9;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.mor-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
    font-weight: 700;
}

.close-custom-modal {
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    color: #999;
    background: none;
    border: none;
    padding: 0;
}

.close-custom-modal:hover {
    color: #d32f2f;
}

.btn-yellow:hover {
    color: white;
}

.mor-modal-body {
    padding: 25px 20px;
}

.mor-info-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    font-size: 15px;
    color: #555;
}

/* Dashicons support for frontend (if not loaded by theme) */
.mor-info-row .dashicons {
    color: #fbc02d;
    /* Your yellow brand color */
    font-family: "dashicons";
    font-size: 20px;
    height: 20px;
    width: 20px;
    display: inline-block;
    text-align: center;
    text-decoration: none;
}

.mor-modal-footer {
    padding: 15px 20px;
    background: #f9f9f9;
    border-top: 1px solid #eee;
    text-align: right;
}

/* Status Dot Styling */
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    background-color: #ccc;
}

/* --- Frontend Calendar Toolbar --- */
.mor-fe-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 20px 0;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.fe-nav-buttons {
    display: flex;
    gap: 8px;
}

.fe-btn-nav,
.fe-btn-today {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    transition: all 0.2s;
}

.fe-btn-nav:hover,
.fe-btn-today:hover {
    background: #fbc02d;
    /* Yellow Brand Color */
    color: #fff;
    border-color: #fbc02d;
}

.fe-cal-title {
    margin: 0 !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #333;
}

/* Mobile Responsiveness for Toolbar */
@media (max-width: 480px) {
    .mor-fe-toolbar {
        flex-direction: column-reverse;
        gap: 15px;
    }

    .fe-nav-buttons {
        width: 100%;
        justify-content: space-between;
    }

    .fe-btn-nav,
    .fe-btn-today {
        flex: 1;
        text-align: center;
    }
}

/* Register Button */
.btn-register {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    padding: 0 20px;
    height: 36px;
    font-size: 14px;

    background-color: #fbc02d;
    color: #fff;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    margin-right: 0.8rem;
}

.btn-register:hover {
    background: #d32f2f;
    color: white;
}

/* Custom Category Dropdown (Support for branding/hover) */
.mor-redirect-dropdown {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 10px 0;
    font-family: inherit;
    user-select: none;
    background: #fff;
    border-radius: 5px;
}

.mor-dropdown-trigger {
    padding: 10px 15px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #fff;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #333;
}

.mor-dropdown-trigger .arrow {
    font-size: 12px;
    color: #666;
}

.mor-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 0 0 5px 5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 999;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 4px;
}

.mor-dropdown-menu.open {
    display: block;
}

.mor-dropdown-item {
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.2s;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
}

.mor-dropdown-item:last-child {
    border-bottom: none;
}

.mor-dropdown-item:hover {
    background-color: #d32f2f;
    /* Brand Red */
    color: #fff;
    padding-left: 20px;
    /* Subtle slide effect */
}