/* Calendar Section */
.calendar-section {
    width: 100%;
    max-width: 1260px;
    margin: 0 auto;
    padding: 20px 0;
}

.calendar-header {
    position: relative;
    margin-bottom: 0;
}

.calendar-greenbar {
    width: 100%;
    background: #5ea472;
    height: 8px;
}

.calendar-label-wrapper {
    padding-left: 40px;
    margin-top: -7px;
}

.calendar-label-container {
    display: inline-flex;
    align-items: center;
    position: relative;
}

.calendar-label {
    background: #5ea472;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    padding: 12px 25px;
    display: inline-block;
    text-transform: uppercase;
    white-space: nowrap;
    border-radius: 6px;
    position: relative;
    z-index: 1;
}

.calendar-label-accent {
    position: absolute;
    right: -8px;
    top: 0;
    width: 20px;
    height: 100%;
    background: #f5c518;
    border-radius: 6px;
    z-index: 0;
}

.calendar-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 10px 0 10px;
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 30px;
    align-items: start;
}

/* Calendar Widget */
.calendar-widget {
    max-width: 400px;
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    position: relative;
}

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.calendar-nav-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #3d4a5c;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.calendar-nav-btn:hover {
    background: #2d3a4c;
}

.calendar-month-year {
    font-size: 22px;
    font-weight: 500;
    color: #333;
}

.calendar-month-name {
    font-style: italic;
    margin-right: 8px;
}

.calendar-year {
    font-weight: 700;
}

/* Weekdays header */
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 8px;
    text-align: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.calendar-weekdays span {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    padding: 5px;
}

/* Days grid */
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    color: #5d7c1b;
    border: 2px solid #c5c5c5;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    background: #fff;
}

.calendar-day:hover {
    border-color: #5d7c1b;
    background: #f9f9f9;
}

.calendar-day.other-month {
    color: #ccc;
    border-color: #e8e8e8;
}

.calendar-day.other-month:hover {
    border-color: #ccc;
}

.calendar-day.today {
    background: #fffde7;
    border-color: #c9c495;
}

.calendar-day.has-event {
    border-color: #5d7c1b;
    background: #5d7c1b;
    color: #fff;
}

.calendar-day.has-event:hover {
    background: #4a6315;
    border-color: #4a6315;
}

.calendar-day.selected {
    border-color: #3d4a5c;
    box-shadow: 0 0 0 2px #3d4a5c;
}

/* Events panel (tooltip) */
.calendar-events-panel {
    display: none;
    position: absolute;
    top: 0;
    left: calc(100% + 20px);
    width: 300px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 100;
    overflow: hidden;
}

.calendar-events-panel.active {
    display: block;
}

.calendar-events-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: #3d4a5c;
    color: #fff;
}

.calendar-events-date {
    font-weight: 600;
    font-size: 16px;
}

.calendar-events-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.calendar-events-list {
    padding: 15px 20px;
    max-height: 300px;
    overflow-y: auto;
}

.calendar-event-item {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

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

.calendar-event-title {
    font-weight: 600;
    color: #333;
}

.calendar-event-title a {
    color: #5d7c1b;
    text-decoration: none;
}

.calendar-event-title a:hover {
    text-decoration: underline;
}

/* Events list (right side) */
.calendar-events-list-side {
    border-left: 3px solid #5ea472;
    padding-left: 25px;
    padding-top: 5px;
}

.calendar-list-item {
    display: flex;
    align-items: baseline;
    gap: 20px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.calendar-list-date {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
    min-width: 80px;
}

.calendar-list-time {
    font-size: 14px;
    color: #5d7c1b;
    font-weight: 600;
    white-space: nowrap;
    margin-right: 8px;
}

.calendar-list-item.is-multi-day {
    border-left: 3px solid #5d7c1b;
    padding-left: 10px;
}

.calendar-list-item.is-multi-day .calendar-list-date {
    min-width: 200px;
    white-space: nowrap;
}

.calendar-list-badge {
    display: inline-block;
    background: #5d7c1b;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 7px;
    border-radius: 3px;
    margin-left: 6px;
    vertical-align: middle;
}

.calendar-list-body {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.calendar-list-location {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

.calendar-event-time {
    font-size: 13px;
    color: #5d7c1b;
    font-weight: 600;
    margin-top: 4px;
}

.calendar-event-location {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
}

.calendar-event-location::before {
    content: "\1F4CD";
    margin-right: 4px;
}

.calendar-list-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

a.calendar-list-title {
    color: #333;
    text-decoration: none;
}

a.calendar-list-title:hover {
    color: #5d7c1b;
    text-decoration: underline;
}

.calendar-no-events {
    color: #888;
    font-style: italic;
    padding: 20px 0;
}

/* Loading state */
.calendar-widget.loading .calendar-days {
    opacity: 0.5;
    pointer-events: none;
}

/* Responsive */
@media screen and (max-width: 1100px) {
    .calendar-content {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 800px) {
    .calendar-events-panel {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 350px;
    }
}

@media screen and (max-width: 500px) {
    .calendar-widget {
        padding: 15px;
    }

    .calendar-day {
        font-size: 12px;
    }

    .calendar-month-year {
        font-size: 18px;
    }

    .calendar-label-wrapper {
        padding-left: 20px;
    }

    .calendar-list-item {
        gap: 12px;
    }

    .calendar-list-date {
        font-size: 13px;
    }

    .calendar-list-title {
        font-size: 14px;
    }
}

/* Sidebar Calendar Variant */
.calendar-section-sidebar {
    padding: 0;
    max-width: 100%;
    background: transparent;
}

.calendar-section-sidebar .calendar-header {
    margin-bottom: 0;
}

.calendar-section-sidebar .calendar-greenbar {
    height: 6px;
    border-radius: 0;
}

.calendar-section-sidebar .calendar-label-wrapper {
    padding-left: 15px;
    margin-top: -5px;
}

.calendar-section-sidebar .calendar-label {
    font-size: 11px;
    font-weight: bold;
    padding: 8px 15px;
    border-radius: 4px;
    position: relative;
    z-index: 1;
}

.calendar-section-sidebar .calendar-label-accent {
    position: absolute;
    right: -6px;
    top: 0;
    width: 14px;
    height: 100%;
    border-radius: 4px;
    z-index: 0;
}

.calendar-section-sidebar .calendar-content {
    display: block;
    padding: 15px 0;
    max-width: 100%;
}

.calendar-section-sidebar .calendar-widget {
    max-width: 100%;
    padding: 0;
    border-radius: 0;
    background: transparent;
}

.calendar-section-sidebar .calendar-nav {
    margin-bottom: 15px;
}

.calendar-section-sidebar .calendar-nav-btn {
    width: 30px;
    height: 30px;
}

.calendar-section-sidebar .calendar-month-year {
    font-size: 18px;
}

.calendar-section-sidebar .calendar-weekdays {
    gap: 4px;
    margin-bottom: 6px;
    padding-bottom: 8px;
}

.calendar-section-sidebar .calendar-weekdays span {
    font-size: 11px;
    padding: 3px;
}

.calendar-section-sidebar .calendar-days {
    gap: 4px;
}

.calendar-section-sidebar .calendar-day {
    font-size: 12px;
    border-width: 1px;
}

.calendar-section-sidebar .calendar-events-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 350px;
}
