/**
 * Course Calendar Styles
 * File: css/course-calendar.css
 */

/* ---------------------------------------------------------------------------
 * Calendar Container
 * --------------------------------------------------------------------------- */

.course-calendar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'proxima-nova', sans-serif;
}

/* ---------------------------------------------------------------------------
 * Display Control Classes
 * --------------------------------------------------------------------------- */

.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

/* ---------------------------------------------------------------------------
 * Calendar Controls
 * --------------------------------------------------------------------------- */

.calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px;
    background: rgba(108, 129, 143, 0.05);
    border-radius: 8px;
}

.calendar-navigation {
    display: flex;
    align-items: center;
    gap: 20px;
}

.calendar-navigation h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #041E42;
    min-width: 200px;
    text-align: center;
}

.nav-btn {
    background: #2370A9;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:hover {
    background: #D69A2D;
    transform: scale(1.1);
}

.calendar-filters {
    display: flex;
    gap: 15px;
    align-items: center;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid #bbbbbb;
    border-radius: 0;
    font-family: 'proxima-nova', sans-serif;
    font-size: 14px;
    background: white;
    min-width: 150px;
}

.filter-select:focus {
    outline: none;
    border-color: #2370A9;
    box-shadow: 0 0 0 2px rgba(35, 112, 169, 0.2);
}

.reset-btn {
    background: #D69A2D;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 0;
    cursor: pointer;
    font-family: 'proxima-nova', sans-serif;
    font-size: 14px;
    transition: all 0.3s ease;
}

.reset-btn:hover {
    background: #B8851F;
}

.view-toggles {
    display: flex;
    gap: 10px;
}

.view-btn {
    background: white;
    color: #2370A9;
    border: 2px solid #2370A9;
    padding: 8px 20px;
    border-radius: 0;
    cursor: pointer;
    font-family: 'proxima-nova', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    transition: all 0.3s ease;
}

.view-btn.active,
.view-btn:hover {
    background: #2370A9;
    color: white;
}

/* ---------------------------------------------------------------------------
 * Month View Calendar (Desktop)
 * --------------------------------------------------------------------------- */

.month-view {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #041E42;
    color: white;
}

.day-header {
    padding: 15px 10px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.calendar-body {
    display: grid;
    grid-template-rows: repeat(auto-fit, minmax(120px, auto));
}

.calendar-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 1px solid #e0e0e0;
}

.calendar-week:last-child {
    border-bottom: none;
}

.calendar-day {
    min-height: 120px;
    border-right: 1px solid #e0e0e0;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.calendar-day:last-child {
    border-right: none;
}

.calendar-day:hover {
    background: rgba(35, 112, 169, 0.05);
}

.calendar-day.today {
    background: rgba(35, 112, 169, 0.1);
}

.calendar-day.today .day-number {
    background: #2370A9;
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-day.other-month {
    color: #ccc;
    background: #f9f9f9;
}

.calendar-day.has-courses {
    background: rgba(214, 154, 45, 0.1);
}

.calendar-day.has-courses:hover {
    background: rgba(214, 154, 45, 0.2);
}

.day-number {
    font-weight: 600;
    font-size: 16px;
    color: #041E42;
    margin-bottom: 5px;
}

.day-courses {
    flex: 1;
    overflow: hidden;
}

.course-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.course-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    padding-left: 0;
}

.course-item:before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    margin-top: 2px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

/* Course type color variations */
.course-item.course-type-selfpaced:before {
    background-color: #2370A9;
}

.course-item.course-type-facilitatorled:before {
    background-color: #0F4C75;
}

.course-item.course-type-blended:before {
    background-color: #5DADE2;
}

.course-title {
    font-size: 11px;
    line-height: 1.2;
    color: #2370A9;
    text-decoration: none;
    word-wrap: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    transition: color 0.3s ease;
}

/* Course type text color variations to match dots */
.course-item.course-type-selfpaced .course-title {
    color: #2370A9;
}

.course-item.course-type-facilitatorled .course-title {
    color: #0F4C75;
}

.course-item.course-type-blended .course-title {
    color: #5DADE2;
}

/* Hover effects */
.course-item:hover:before {
    transform: scale(1.2);
}

.course-item:hover .course-title,
.course-item.course-hover .course-title {
    color: #041E42 !important;
    text-decoration: underline;
}

.course-item.course-hover:before {
    transform: scale(1.2);
}

.more-courses {
    font-size: 10px;
    color: #666;
    text-align: center;
    padding: 2px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    margin-top: 3px;
}

/* ---------------------------------------------------------------------------
 * Mobile List View
 * --------------------------------------------------------------------------- */

.mobile-list-view {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.mobile-date-group {
    border-bottom: 1px solid #e0e0e0;
    padding: 20px;
}

.mobile-date-group:last-child {
    border-bottom: none;
}

.mobile-date-header {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #041E42;
    border-bottom: 2px solid #2370A9;
    padding-bottom: 8px;
}

.mobile-course-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-course-item {
    padding: 15px;
    margin-bottom: 10px;
    background: rgba(108, 129, 143, 0.05);
    border-radius: 8px;
    border-left: 4px solid #2370A9;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.mobile-course-item:last-child {
    margin-bottom: 0;
}

/* Mobile course type border colors */
.mobile-course-item.course-type-selfpaced {
    border-left-color: #2370A9;
}

.mobile-course-item.course-type-facilitatorled {
    border-left-color: #0F4C75;
}

.mobile-course-item.course-type-blended {
    border-left-color: #5DADE2;
}

.mobile-course-item:hover {
    background: rgba(35, 112, 169, 0.1);
    transform: translateX(5px);
}

.mobile-course-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-course-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #041E42;
    line-height: 1.3;
}

.mobile-course-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.course-type-label {
    background: #2370A9;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Course type label colors */
.mobile-course-item.course-type-selfpaced .course-type-label {
    background: #2370A9;
}

.mobile-course-item.course-type-facilitatorled .course-type-label {
    background: #0F4C75;
}

.mobile-course-item.course-type-blended .course-type-label {
    background: #5DADE2;
}

.course-price {
    font-size: 14px;
    font-weight: 600;
    color: #041E42;
}

.no-courses-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.no-courses-message p {
    margin: 0;
    font-style: italic;
}

/* ---------------------------------------------------------------------------
 * Year View Calendar
 * --------------------------------------------------------------------------- */

.year-view {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.year-month {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.year-month:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
}

.year-month h3 {
    margin: 0 0 15px 0;
    color: #041E42;
    font-size: 24px;
    font-weight: 600;
}

.month-summary {
    color: #666;
}

.course-count {
    font-size: 18px;
    font-weight: 600;
    color: #2370A9;
}

/* ---------------------------------------------------------------------------
 * Modal Styles
 * --------------------------------------------------------------------------- */

.course-modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    position: relative;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 15px;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #2370A9;
}

.day-courses-list {
    margin-top: 20px;
}

.modal-course-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.modal-course-item:hover {
    border-color: #2370A9;
    background: rgba(35, 112, 169, 0.05);
}

.modal-course-item h4 {
    margin: 0 0 10px 0;
    color: #041E42;
}

.view-course-btn {
    background: #2370A9;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 0;
    cursor: pointer;
    font-family: 'proxima-nova', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    transition: all 0.3s ease;
}

.view-course-btn:hover {
    background: #041E42;
    transform: translateY(-2px);
}

/* ---------------------------------------------------------------------------
 * Loading Indicator
 * --------------------------------------------------------------------------- */

.calendar-loading {
    text-align: center;
    padding: 50px;
    color: #666;
    font-style: italic;
}

.calendar-loading::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #2370A9;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error {
    color: #e74c3c;
    text-align: center;
    padding: 20px;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 8px;
    margin: 20px 0;
}

/* ---------------------------------------------------------------------------
 * Responsive Design
 * --------------------------------------------------------------------------- */

@media (max-width: 1024px) {
    .calendar-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .calendar-navigation h2 {
        font-size: 20px;
        min-width: auto;
    }
    
    .year-view {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    /* Switch to mobile view */
    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: block !important;
    }
    
    .course-calendar-container {
        padding: 10px;
    }
    
    .calendar-controls {
        padding: 15px;
    }
    
    .calendar-navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    .calendar-navigation h2 {
        font-size: 18px;
    }
    
    .calendar-filters {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }
    
    .filter-select {
        width: 100%;
    }
    
    .view-toggles {
        width: 100%;
        justify-content: center;
    }
    
    /* Mobile list view adjustments */
    .mobile-date-group {
        padding: 15px;
    }
    
    .mobile-date-header {
        font-size: 16px;
    }
    
    .mobile-course-title {
        font-size: 15px;
    }
    
    .mobile-course-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .year-view {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .year-month {
        padding: 15px;
    }
    
    .year-month h3 {
        font-size: 20px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .mobile-date-group {
        padding: 12px;
    }
    
    .mobile-date-header {
        font-size: 14px;
        margin-bottom: 12px;
    }
    
    .mobile-course-item {
        padding: 12px;
    }
    
    .mobile-course-title {
        font-size: 14px;
    }
    
    .course-type-label {
        font-size: 11px;
        padding: 3px 10px;
    }
    
    .course-price {
        font-size: 13px;
    }
    
    .nav-btn {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .calendar-navigation h2 {
        font-size: 16px;
    }
}