/* 
 * Frontend CSS for CSC Events Calendar 
 * Clean, bright, and tourist-friendly aesthetic
 */

:root {
    --csc-primary: #3b5998; /* Accessible blue */
    --csc-secondary: #f4f6f8; /* Soft background */
    --csc-text: #333333;
    --csc-text-light: #666666;
    --csc-border: #e0e0e0;
    --csc-white: #ffffff;
    --csc-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --csc-hover-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    --csc-radius: 8px;
    --csc-font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.csc-events-container {
    font-family: var(--csc-font);
    color: var(--csc-text);
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

/* Controls */
.csc-events-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.csc-view-toggles {
    display: flex;
    background: var(--csc-secondary);
    border-radius: var(--csc-radius);
    padding: 4px;
}

.csc-btn {
    background: transparent;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 500;
    color: var(--csc-text-light);
    cursor: pointer;
    border-radius: calc(var(--csc-radius) - 2px);
    transition: all 0.3s ease;
}

.csc-btn.active {
    background: var(--csc-white);
    color: var(--csc-primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.csc-month-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.csc-month-nav h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    min-width: 150px;
    text-align: center;
}

.csc-nav-btn {
    background: var(--csc-white);
    border: 1px solid var(--csc-border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: var(--csc-text);
    transition: all 0.2s;
}

.csc-nav-btn:hover {
    background: var(--csc-secondary);
    color: var(--csc-primary);
}

/* Views */
.csc-view {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}
.csc-view.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* List View & Past View */
#csc-view-list, #csc-view-past {
    display: none;
    flex-direction: column;
    gap: 20px;
}
#csc-view-list.active, #csc-view-past.active {
    display: flex;
}

.csc-list-item {
    display: flex;
    background: var(--csc-white);
    border: 1px solid var(--csc-border);
    border-radius: var(--csc-radius);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: var(--csc-shadow);
}

.csc-list-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--csc-hover-shadow);
}

.csc-list-image {
    width: 30%;
    min-width: 250px;
    background-size: cover;
    background-position: center;
}

.csc-list-content {
    padding: 30px;
    flex: 1;
}

.csc-list-date {
    color: var(--csc-primary);
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.csc-list-title {
    margin: 0 0 15px 0;
    font-size: 24px;
    line-height: 1.3;
}

.csc-list-excerpt {
    color: var(--csc-text-light);
    margin-bottom: 20px;
    line-height: 1.6;
}

.csc-read-more {
    display: inline-block;
    padding: 10px 24px;
    background: var(--csc-primary);
    color: var(--csc-white);
    text-decoration: none;
    border-radius: 20px;
    font-weight: 500;
    font-size: 14px;
    transition: background 0.3s;
}

.csc-read-more:hover {
    background: #2a4175;
    color: var(--csc-white);
}

/* Month Calendar */
.csc-calendar-grid {
    background: var(--csc-white);
    border: 1px solid var(--csc-border);
    border-radius: var(--csc-radius);
    overflow: hidden;
}

.csc-calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--csc-secondary);
    border-bottom: 1px solid var(--csc-border);
}

.csc-calendar-header div {
    padding: 15px 10px;
    text-align: center;
    font-weight: 600;
    color: var(--csc-text-light);
    font-size: 14px;
}

.csc-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.csc-day {
    min-height: 120px;
    padding: 10px;
    border-right: 1px solid var(--csc-border);
    border-bottom: 1px solid var(--csc-border);
    position: relative;
    background: var(--csc-white);
}

.csc-day:nth-child(7n) {
    border-right: none;
}

.csc-day.empty {
    background: #fafafa;
}

.csc-day-number {
    font-weight: 500;
    color: var(--csc-text-light);
    margin-bottom: 10px;
    display: inline-block;
}

.csc-day.today .csc-day-number {
    background: var(--csc-primary);
    color: var(--csc-white);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
}

.csc-event-dot {
    background: var(--csc-primary);
    color: var(--csc-white);
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 5px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.2s;
}

.csc-event-dot:hover {
    opacity: 0.8;
}

/* Modal */
.csc-modal {
    display: none;
    position: fixed;
    z-index: 999999; /* Increased to overlay most sticky headers */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding-top: 100px;
    padding-bottom: 40px;
    padding-left: 20px;
    padding-right: 20px;
    box-sizing: border-box;
}

.csc-modal.active {
    display: flex;
}

.csc-modal-content {
    background-color: var(--csc-white);
    padding: 0;
    border-radius: var(--csc-radius);
    width: 100%;
    max-width: 600px;
    max-height: calc(100vh - 140px);
    overflow-y: auto; /* Makes it scrollable if it exceeds screen height */
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: modalScale 0.3s ease;
}

@keyframes modalScale {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.csc-close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    color: var(--csc-white);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.csc-close-modal:hover {
    color: #f1f1f1;
}

.csc-modal-hero {
    height: 250px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.csc-modal-hero::after {
    display: none;
}

.csc-modal-title-wrapper {
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    background-color: rgba(0, 0, 0, 0.85);
    padding: 15px 20px;
    border-radius: var(--csc-radius);
    color: var(--csc-white);
    z-index: 2;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.csc-modal-title {
    margin: 0;
    font-size: 22px;
    color: var(--csc-white);
    line-height: 1.3;
}

.csc-modal-details {
    padding: 30px;
}

.csc-modal-meta {
    font-weight: 500;
    color: var(--csc-primary);
    margin-bottom: 20px;
}

.csc-modal-desc {
    line-height: 1.6;
    color: var(--csc-text);
}

.csc-spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: var(--csc-primary);
    animation: spin 1s linear infinite;
    margin: 50px auto;
    display: none;
}

.csc-loading .csc-spinner {
    display: block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .csc-list-item {
        flex-direction: column;
    }
    .csc-list-image {
        width: 100%;
        height: 200px;
    }
    .csc-calendar-header div {
        font-size: 12px;
        padding: 10px 5px;
    }
    .csc-day {
        min-height: 80px;
        padding: 5px;
    }
    .csc-event-dot {
        font-size: 10px;
        padding: 2px 4px;
    }
}
