/* ==============================================
   Simple Event Calendar - Modern Styling
   Version: 2.2
   ============================================== */

/* =============== Base Styles =============== */
.sec-calendar-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    max-width: 100%;
    margin: 20px auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
    transition: all 0.3s ease;
}

/* =============== Calendar Header =============== */
.sec-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 25px;
    background: #F0F4FF;
    color: white;
    position: relative;
}

.sec-calendar-title {
    display: flex;
    gap: 12px;
    align-items: center;
}

.sec-nav-prev, .sec-nav-next {
    color: white;
    text-decoration: none;
    font-weight: 600;
    padding: 10px 15px;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    background: #ffffff;
}

.sec-nav-prev:hover, .sec-nav-next:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* =============== Dropdown Selects =============== */
.sec-month-select, .sec-year-select {
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.9);
    color: #333;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 35px;
}

.sec-month-select:hover, .sec-year-select:hover {
    background-color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* =============== Calendar Grid =============== */
.sec-calendar-grid {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    background: white;
}

.sec-calendar-grid th {
    padding: 15px 5px;
    text-align: center;
    font-weight: 600;
    color: #555;
    font-size: 0.95em;
    border-bottom: 2px solid #f0f0f0;
    background: #f9fafc;
}

.sec-calendar-grid td {
    height: 100px;
    padding: 5px;
    vertical-align: top;
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    position: relative;
}

.sec-calendar-grid td:hover {
    background-color: #f9f9f9;
}

.sec-empty {
    background-color: #fafafa;
}

.sec-day {
    position: relative;
}

.sec-day-number {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.9em;
    font-weight: 600;
    color: #666;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.sec-today .sec-day-number {
    background-color: #4a6fa5;
    color: white;
    border-radius: 50%;
}

/* =============== Events =============== */
.sec-events {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sec-event {
    font-size: 0.85em;
    padding: 8px 10px;
    margin-bottom: 2px;
    background-color: #f0f4ff;
    border-left: 3px solid #4a6fa5;
    border-radius: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.sec-event:hover {
    background-color: #e0e8ff;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.sec-event-title {
    font-weight: 600;
    color: #333;
    display: block;
}

.sec-event-time {
    display: block;
    font-size: 0.8em;
    color: #666;
    margin-top: 3px;
}

/* =============== Event Details Popup =============== */
.sec-event-dialog .ui-dialog-titlebar {
    background: #F0F4FF;
    color: black;
    font-size: 1.2em;
    padding: 15px 20px;
    border: none;
    border-radius: 5px 5px 0 0;
}

.sec-event-dialog .ui-dialog-content {
    padding: 20px;
    font-size: 15px;
    line-height: 1.6;
    color: #444;
}

.sec-event-dialog .sec-event-description {
    margin-bottom: 20px;
    color: #333;
    white-space: normal;
}

.sec-event-dialog .sec-event-location {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 5px;
    border-left: 4px solid #4a6fa5;
    font-size: 0.95em;
}

.sec-event-dialog .sec-event-location strong {
    color: #4a6fa5;
}

.sec-event-dialog .sec-event-image img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 15px auto 5px;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.sec-event-dialog .ui-dialog-titlebar-close {
    border: none;
    background: transparent;
    color: white;
    right: 15px;
    width: 30px;
    height: 30px;
    top: 50%;
    transform: translateY(-50%);
}

.sec-event-dialog .ui-dialog-titlebar-close .dashicons {
    font-size: 22px;
    width: 22px;
    height: 22px;
}

.sec-event-dialog .ui-dialog-buttonpane {
    padding: 12px 20px;
    border-top: 1px solid #eee;
    background: #f9f9f9;
    border-radius: 0 0 5px 5px;
}

.sec-event-dialog .ui-dialog-buttonpane button {
    background: #4a6fa5;
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.sec-event-dialog .ui-dialog-buttonpane button:hover {
    background: #3a5a8f;
    transform: translateY(-1px);
}

/* =============== Responsive Adjustments =============== */
@media (max-width: 768px) {
    .sec-calendar-header {
        flex-direction: column;
        gap: 12px;
        padding: 15px;
    }
    
    .sec-calendar-title {
        order: -1;
        margin-bottom: 8px;
        width: 100%;
        justify-content: center;
    }
    
    .sec-nav-prev, .sec-nav-next {
        padding: 8px 12px;
        font-size: 0.9em;
    }
    
    .sec-calendar-grid td {
        height: 80px;
        font-size: 0.85em;
    }
    
    .sec-day-number {
        font-size: 0.8em;
        width: 22px;
        height: 22px;
    }
    
    .sec-event {
        font-size: 0.8em;
        padding: 6px 8px;
    }
    
    .sec-event-dialog .ui-dialog {
        width: 90% !important;
        max-width: none !important;
        left: 5% !important;
    }
}

@media (max-width: 480px) {
    .sec-calendar-title {
        flex-direction: column;
        gap: 8px;
    }
    
    .sec-month-select, .sec-year-select {
        width: 100%;
    }
    
    .sec-calendar-grid td {
        height: 70px;
    }
    
    .sec-events {
        margin-top: 25px;
    }
}

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

.sec-calendar-grid {
    animation: fadeIn 0.4s ease-out;
}

.sec-event {
    animation: fadeIn 0.3s ease-out;
}