﻿/* Calendar Widget Styles */
.calendar-widget {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    width: 100%;
}

    .calendar-widget .cal-view-tabs {
        display: flex;
        gap: 0.5rem;
        background: #0d2b33;
        border-radius: 8px;
        padding: 0.25rem;
        margin-bottom: 1rem;
    }

    .calendar-widget .cal-view-tab {
        flex: 1;
        padding: 0.5rem 0;
        border: none;
        border-radius: 6px;
        background: transparent;
        font-size: 0.75rem;
        font-weight: 600;
        color: #fff;
        cursor: pointer;
        transition: all 0.2s;
    }

        .calendar-widget .cal-view-tab.active {
            background: white;
            color: #1e5f8a;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        }

    .calendar-widget .calendar-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 1rem;
    }

    .calendar-widget .cal-nav-btn {
        background: #f3f4f6;
        border: none;
        border-radius: 6px;
        padding: 0.5rem 0.75rem;
        cursor: pointer;
        font-size: 1rem;
        font-weight: bold;
        transition: all 0.2s;
    }

        .calendar-widget .cal-nav-btn:hover {
            background: #e5e7eb;
        }

    .calendar-widget .calendar-title {
        font-size: 1rem;
        font-weight: 600;
        margin: 0;
        color: #1f2937;
    }

    .calendar-widget .calendar-weekdays {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        text-align: center;
        font-size: 0.7rem;
        font-weight: 700;
        color: #6b7280;
        margin-bottom: 0.5rem;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid #e5e7eb;
    }

    .calendar-widget .calendar-grid {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        margin-bottom: 1rem;
    }

    .calendar-widget .calendar-day {
        aspect-ratio: 1;
        padding: 0.5rem 0.25rem;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.2s;
        background: #f9fafb;
        text-align: center;
        font-size: 0.8rem;
        font-weight: 500;
        position: relative;
        border: 1px solid #0f2d38;
    }

        .calendar-widget .calendar-day:hover {
            background: #e0e7ff;
            transform: scale(1.02);
        }

        .calendar-widget .calendar-day.today {
            background: linear-gradient(135deg, #dbeafe, #bfdbfe);
        }

        .calendar-widget .calendar-day.has-event {
        }

        .calendar-widget .calendar-day.selected {
            background: #1e5f8a;
            color: white;
            border-color: #1e5f8a;
        }

        .calendar-widget .calendar-day.other-month {
            color: #9ca3af;
            background: #f3f4f6;
            cursor: default;
            border: none;
        }


    .calendar-widget .event-dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        margin-top: 2px;
        display: inline-block;
        margin-left: 4px;
    }

    .calendar-widget .week-grid {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 4px;
        margin-bottom: 1rem;
    }

    .calendar-widget .week-day-col {
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        padding: 8px;
        cursor: pointer;
        background: #f9fafb;
        transition: all 0.2s;
    }

        .calendar-widget .week-day-col:hover {
            background: #e0e7ff;
            transform: scale(1.02);
        }

        .calendar-widget .week-day-col.today-col {
            background: linear-gradient(135deg, #dbeafe, #bfdbfe);
        }

    .calendar-widget .week-day-header {
        text-align: center;
        font-weight: 700;
        padding-bottom: 5px;
    }

        .calendar-widget .week-day-header .week-day-num {
            font-size: 1.1rem;
        }

    .calendar-widget .week-event-chip {
        background: #1e5f8a;
        color: white;
        padding: 2px 4px;
        border-radius: 4px;
        font-size: 10px;
        margin-bottom: 2px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        cursor: pointer;
        transition: all 0.2s;
    }

        .calendar-widget .week-event-chip:hover {
            opacity: 0.8;
            transform: scale(1.02);
        }

    .calendar-widget .week-more {
        font-size: 10px;
        color: #6b7280;
        text-align: center;
    }

    .calendar-widget .day-view-header {
        margin-bottom: 15px;
        font-weight: 700;
        color: #1e5f8a;
    }

    .calendar-widget .day-timeline {
        max-height: 300px;
        overflow-y: auto;
    }

    .calendar-widget .day-event-row {
        display: flex;
        gap: 10px;
        padding: 10px;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        margin-bottom: 8px;
        cursor: pointer;
        background: #f9fafb;
        transition: all 0.2s;
    }

        .calendar-widget .day-event-row:hover {
            background: #e0e7ff;
            transform: translateX(5px);
        }

    .calendar-widget .day-event-time {
        min-width: 55px;
        font-size: 12px;
        font-weight: 600;
        color: #6b7280;
    }

    .calendar-widget .day-event-bar {
        width: 3px;
        border-radius: 2px;
    }

    .calendar-widget .day-event-info {
        flex: 1;
    }

    .calendar-widget .day-event-title {
        font-weight: 600;
        margin-bottom: 2px;
    }

    .calendar-widget .day-event-loc {
        font-size: 11px;
        color: #6b7280;
    }

    .calendar-widget .upcoming-section {
        border-top: 1px solid #e5e7eb;
        padding-top: 1rem;
        margin-top: 0.5rem;
    }

    .calendar-widget .upcoming-header {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 0.75rem;
    }

        .calendar-widget .upcoming-header h4 {
            font-size: 0.85rem;
            font-weight: 600;
            margin: 0;
        }

    .calendar-widget .upcoming-list {
        max-height: 250px;
        overflow-y: auto;
    }

    .calendar-widget .upcoming-event-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 0.75rem;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.2s;
        margin-bottom: 6px;
        background: #f9fafb;
        border-left: 3px solid;
        border-right: 1px solid #e5e7eb;
        border-top: 1px solid #e5e7eb;
        border-bottom: 1px solid #e5e7eb;
    }

        .calendar-widget .upcoming-event-item:hover {
            transform: translateX(5px);
            background: #e0e7ff;
        }

    .calendar-widget .event-date-badge {
        text-align: center;
        min-width: 48px;
        background: white;
        border-radius: 8px;
        padding: 0.5rem;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }

    .calendar-widget .event-day {
        font-size: 1rem;
        font-weight: 700;
        display: block;
    }

    .calendar-widget .event-month {
        font-size: 0.65rem;
        text-transform: uppercase;
        font-weight: 600;
        color: #6b7280;
    }

    .calendar-widget .event-info {
        flex: 1;
    }

    .calendar-widget .event-title {
        font-size: 0.85rem;
        font-weight: 600;
        margin-bottom: 2px;
        color: black;
    }

    .calendar-widget .event-time {
        font-size: 0.7rem;
        color: #6b7280;
    }

    .calendar-widget .event-type-tag {
        font-size: 0.6rem;
        padding: 0.25rem 0.75rem;
        border-radius: 20px;
        color: white;
        font-weight: 500;
        white-space: nowrap;
    }

    .calendar-widget .no-events-msg {
        text-align: center;
        padding: 1.5rem;
        color: #9ca3af;
        font-size: 0.8rem;
    }

/* Modal Styles */
.event-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

.event-modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    animation: slideDown 0.3s;
}

.event-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #1e5f8a, #2c7cb6);
    color: white;
    border-radius: 16px 16px 0 0;
}

    .event-modal-header h3 {
        margin: 0;
        font-size: 1.25rem;
    }

.event-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
    transition: all 0.2s;
}

    .event-modal-close:hover {
        transform: scale(1.2);
    }

.event-modal-body {
    padding: 1.5rem;
}

.event-detail-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 1rem;
    padding: 8px;
    border-bottom: 1px solid #e5e7eb;
}

    .event-detail-row.description {
        flex-direction: column;
    }

.event-detail-icon {
    font-size: 1.2rem;
    min-width: 30px;
}

.event-detail-row span:last-child {
    flex: 1;
    color: #374151;
    line-height: 1.5;
}

.event-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 0 0 16px 16px;
}

    .event-modal-footer h4 {
        margin: 0 0 0.5rem 0;
        font-size: 0.9rem;
        color: #1e5f8a;
    }

#modalAttachments a {
    display: inline-block;
    margin-right: 10px;
    padding: 5px 10px;
    background: #1e5f8a;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.8rem;
    transition: all 0.2s;
}

    #modalAttachments a:hover {
        background: #2c7cb6;
        transform: translateY(-2px);
    }

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.upcoming-label-period {
    font-weight: 400;
    opacity: 0.75;
    font-size: 0.9em;
}
