/**
 * Event Calendar Pro - Styles
 *
 * Mobile-first responsive calendar design using CSS Grid
 *
 * @package Event_Calendar_Pro
 */

/* ==========================================================================
   CSS Custom Properties (Variables)
   ========================================================================== */

.ecp-calendar-wrapper {
    --ecp-bg-color: #ffffff;
    --ecp-border-color: #e0e0e0;
    --ecp-text-color: #333333;
    --ecp-text-muted: #888888;
    --ecp-primary-color: #2563eb;
    --ecp-primary-hover: #1d4ed8;
    --ecp-today-bg: #eff6ff;
    --ecp-today-border: #2563eb;
    --ecp-outside-bg: #f5f5f5;
    --ecp-outside-text: #9ca3af;
    --ecp-event-bg: #dbeafe;
    --ecp-event-text: #1e40af;
    --ecp-hover-bg: #f8fafc;
    --ecp-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --ecp-shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.1);
    --ecp-radius: 8px;
    --ecp-radius-sm: 4px;
    --ecp-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */

.ecp-calendar-wrapper {
    max-width: 100%;
    margin: 0 auto;
    padding: 16px;
    font-family: var(--ecp-font-family);
    color: var(--ecp-text-color);
    background-color: var(--ecp-bg-color);
    border-radius: var(--ecp-radius);
    box-shadow: var(--ecp-shadow-lg);
}

.ecp-calendar-wrapper *,
.ecp-calendar-wrapper *::before,
.ecp-calendar-wrapper *::after {
    box-sizing: border-box;
}

/* ==========================================================================
   Calendar Header
   ========================================================================== */

.ecp-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0 20px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--ecp-border-color);
}

.ecp-month-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ecp-text-color);
    text-align: center;
    flex: 1;
}

/* Navigation Buttons */
.ecp-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ecp-primary-color);
    text-decoration: none;
    background-color: transparent;
    border: 1px solid var(--ecp-primary-color);
    border-radius: var(--ecp-radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ecp-nav-btn:hover,
.ecp-nav-btn:focus {
    color: #ffffff;
    background-color: var(--ecp-primary-color);
    outline: none;
}

.ecp-nav-btn:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

.ecp-nav-arrow {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
}

.ecp-nav-text {
    display: none;
}

/* ==========================================================================
   Calendar Grid
   ========================================================================== */

.ecp-calendar-grid {
    background-color: var(--ecp-bg-color);
    border: 1px solid var(--ecp-border-color);
    border-radius: var(--ecp-radius);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}

.ecp-calendar-grid::-webkit-scrollbar {
    height: 6px;
}

.ecp-calendar-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.ecp-calendar-grid::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.ecp-calendar-grid::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Weekday Headers */
.ecp-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    min-width: 500px;
    background-color: #f8fafc;
    border-bottom: 1px solid var(--ecp-border-color);
}

.ecp-weekday {
    padding: 12px 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ecp-text-muted);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Days Grid */
.ecp-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    min-width: 500px;
}

/* Individual Day Cell */
.ecp-day {
    position: relative;
    min-height: 60px;
    padding: 6px;
    border-right: 1px solid var(--ecp-border-color);
    border-bottom: 1px solid var(--ecp-border-color);
    background-color: var(--ecp-bg-color);
    transition: background-color 0.2s ease;
}

/* Remove right border on last column */
.ecp-day:nth-child(7n) {
    border-right: none;
}

/* Day Number */
.ecp-day-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ecp-text-color);
    border-radius: 50%;
}

/* Outside Month Days (Previous/Next) */
.ecp-day-outside {
    background-color: var(--ecp-outside-bg);
}

.ecp-day-outside .ecp-day-number {
    color: var(--ecp-outside-text);
}

/* Today's Date */
.ecp-day-today {
    background-color: var(--ecp-today-bg);
}

.ecp-day-today .ecp-day-number {
    color: #ffffff;
    background-color: var(--ecp-primary-color);
    font-weight: 600;
}

/* Days with Events */
.ecp-day-has-events {
    cursor: pointer;
}

.ecp-day-has-events:hover {
    background-color: var(--ecp-hover-bg);
}

/* ==========================================================================
   Events in Day Cells
   ========================================================================== */

.ecp-day-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
}

.ecp-event-title {
    display: block;
    padding: 2px 4px 2px 7px;
    font-size: 0.625rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background-color 0.2s ease;
    border-left: 3px solid transparent;
}

/* Past Events - Light red/coral */
.ecp-event-past {
    background-color: #ffcccb;
    color: #991b1b;
    border-left-color: #dc2626;
}

/* Hover disabled for past events */

/* Future/Current Events - Light blue */
.ecp-event-future {
    background-color: #cce5ff;
    color: #1e40af;
    border-left-color: #2563eb;
}

/* Hover disabled for future events */

.ecp-more-events {
    display: block;
    padding: 2px 4px;
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--ecp-text-muted);
}

/* ==========================================================================
   Color Legend
   ========================================================================== */

.ecp-legend {
    display: flex;
    gap: 20px;
    padding: 12px 0;
    margin-top: 16px;
    border-top: 1px solid var(--ecp-border-color);
}

.ecp-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--ecp-text-color);
}

.ecp-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid transparent;
}

.ecp-legend-color-future {
    background-color: #cce5ff;
    border-color: #2563eb;
}

.ecp-legend-color-past {
    background-color: #ffcccb;
    border-color: #dc2626;
}

/* ==========================================================================
   Event Details Panel
   ========================================================================== */

/* Event Details Panel - disabled, using popup only */
.ecp-event-details {
    display: none !important;
}

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

.ecp-event-details-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ecp-border-color);
}

.ecp-event-details-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--ecp-text-color);
}

.ecp-event-details-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--ecp-text-muted);
    background: none;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ecp-event-details-close:hover {
    color: var(--ecp-text-color);
    background-color: var(--ecp-border-color);
}

/* Event List */
.ecp-event-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ecp-event-item {
    padding: 16px;
    margin-bottom: 12px;
    background-color: var(--ecp-bg-color);
    border: 1px solid var(--ecp-border-color);
    border-radius: var(--ecp-radius-sm);
    transition: box-shadow 0.2s ease;
}

.ecp-event-item:last-child {
    margin-bottom: 0;
}

.ecp-event-item:hover {
    box-shadow: var(--ecp-shadow);
}

.ecp-event-item-title {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 600;
}

.ecp-event-item-title a {
    color: var(--ecp-primary-color);
    text-decoration: none;
}

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

.ecp-event-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.875rem;
    color: var(--ecp-text-muted);
}

.ecp-event-item-excerpt {
    margin-top: 8px;
    font-size: 0.875rem;
    color: var(--ecp-text-color);
    line-height: 1.5;
}

/* Loading State */
.ecp-loading {
    padding: 24px;
    text-align: center;
    color: var(--ecp-text-muted);
}

.ecp-loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid var(--ecp-border-color);
    border-top-color: var(--ecp-primary-color);
    border-radius: 50%;
    animation: ecp-spin 0.8s linear infinite;
    vertical-align: middle;
}

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

/* Calendar Loading State (AJAX navigation) */
.ecp-calendar-wrapper.ecp-loading-state {
    position: relative;
    pointer-events: none;
}

.ecp-calendar-wrapper.ecp-loading-state::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 10;
    border-radius: var(--ecp-radius);
}

.ecp-calendar-wrapper.ecp-loading-state::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid var(--ecp-border-color);
    border-top-color: var(--ecp-primary-color);
    border-radius: 50%;
    animation: ecp-spin 0.8s linear infinite;
    z-index: 11;
}

/* Event Item Past/Future in Details Panel */
.ecp-event-item-past {
    border-left: 3px solid #dc2626;
}

.ecp-event-item-future {
    border-left: 3px solid #2563eb;
}

/* No Events Message */
.ecp-no-events {
    padding: 24px;
    text-align: center;
    color: var(--ecp-text-muted);
    font-style: italic;
}

/* ==========================================================================
   Responsive Styles - Mobile (max-width: 599px)
   ========================================================================== */

@media screen and (max-width: 599px) {
    .ecp-calendar-wrapper {
        padding: 8px;
    }

    .ecp-calendar-header {
        padding: 8px 0 12px;
        margin-bottom: 8px;
    }

    .ecp-month-title {
        font-size: 1rem;
    }

    .ecp-nav-btn {
        padding: 6px 8px;
        font-size: 0.75rem;
    }

    .ecp-weekday {
        padding: 8px 2px;
        font-size: 0.625rem;
    }

    .ecp-day {
        min-height: 44px;
        padding: 3px;
    }

    .ecp-day-number {
        width: 20px;
        height: 20px;
        font-size: 0.6875rem;
    }

    .ecp-event-title {
        font-size: 0.5rem;
        padding: 1px 2px 1px 4px;
        border-left-width: 2px;
    }

    .ecp-more-events {
        font-size: 0.5rem;
        padding: 1px 2px;
    }

    .ecp-day-events {
        gap: 1px;
        margin-top: 2px;
    }

    .ecp-legend {
        gap: 12px;
        padding: 8px 0;
        margin-top: 8px;
    }

    .ecp-legend-item {
        font-size: 0.6875rem;
        gap: 4px;
    }

    .ecp-legend-color {
        width: 12px;
        height: 12px;
    }
}

/* ==========================================================================
   Responsive Styles - Very Small Screens (max-width: 399px)
   ========================================================================== */

@media screen and (max-width: 399px) {
    .ecp-calendar-wrapper {
        padding: 4px;
    }

    .ecp-calendar-header {
        padding: 6px 0 8px;
        margin-bottom: 4px;
        gap: 4px;
    }

    .ecp-month-title {
        font-size: 0.875rem;
    }

    .ecp-nav-btn {
        padding: 4px 6px;
        font-size: 0.6875rem;
    }

    .ecp-nav-arrow {
        font-size: 1rem;
    }

    .ecp-weekday {
        padding: 6px 2px;
        font-size: 0.5625rem;
    }

    .ecp-day {
        min-height: 40px;
        padding: 2px;
    }

    .ecp-day-number {
        width: 18px;
        height: 18px;
        font-size: 0.625rem;
    }

    .ecp-event-title {
        font-size: 0.4375rem;
        padding: 1px 2px 1px 3px;
        border-left-width: 2px;
    }

    .ecp-more-events {
        font-size: 0.4375rem;
        padding: 1px 2px;
    }

    .ecp-legend {
        flex-wrap: wrap;
        gap: 8px;
        padding: 6px 0;
        margin-top: 6px;
    }

    .ecp-legend-item {
        font-size: 0.625rem;
        gap: 3px;
    }

    .ecp-legend-color {
        width: 10px;
        height: 10px;
    }
}

/* ==========================================================================
   Responsive Styles - Tablet (min-width: 600px)
   ========================================================================== */

@media screen and (min-width: 600px) {
    .ecp-calendar-wrapper {
        padding: 24px;
        max-width: 90%;
    }

    .ecp-calendar-header {
        padding: 16px 0 24px;
    }

    .ecp-month-title {
        font-size: 1.5rem;
    }

    .ecp-nav-text {
        display: inline;
    }

    .ecp-nav-btn {
        padding: 10px 16px;
    }

    .ecp-weekday {
        padding: 14px 8px;
        font-size: 0.8125rem;
    }

    .ecp-day {
        min-height: 90px;
        padding: 8px;
    }

    .ecp-day-number {
        width: 32px;
        height: 32px;
        font-size: 0.9375rem;
    }

    .ecp-event-title {
        font-size: 0.6875rem;
        padding: 3px 6px;
    }

    .ecp-more-events {
        font-size: 0.6875rem;
    }
}

/* ==========================================================================
   Responsive Styles - Desktop (min-width: 900px)
   ========================================================================== */

@media screen and (min-width: 900px) {
    .ecp-calendar-wrapper {
        max-width: 80%;
    }

    .ecp-month-title {
        font-size: 1.75rem;
    }

    .ecp-weekday {
        padding: 16px 8px;
        font-size: 0.875rem;
    }

    .ecp-day {
        min-height: 110px;
        padding: 10px;
    }

    .ecp-day-number {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .ecp-day-events {
        gap: 3px;
        margin-top: 6px;
    }

    .ecp-event-title {
        font-size: 0.75rem;
        padding: 4px 8px;
        border-radius: 3px;
    }

    .ecp-more-events {
        font-size: 0.75rem;
        padding: 4px 8px;
    }

    .ecp-event-details {
        padding: 24px;
    }

    .ecp-event-item {
        padding: 20px;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .ecp-calendar-wrapper {
        box-shadow: none;
        padding: 0;
    }

    .ecp-nav-btn {
        display: none;
    }

    .ecp-day-has-events:hover {
        background-color: transparent;
    }

    .ecp-event-details {
        display: none;
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.ecp-calendar-wrapper:focus-within {
    outline: 2px solid var(--ecp-primary-color);
    outline-offset: 2px;
}

.ecp-day:focus {
    outline: 2px solid var(--ecp-primary-color);
    outline-offset: -2px;
    z-index: 1;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .ecp-calendar-wrapper *,
    .ecp-calendar-wrapper *::before,
    .ecp-calendar-wrapper *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .ecp-calendar-wrapper {
        --ecp-border-color: #000000;
        --ecp-text-muted: #333333;
    }

    .ecp-day {
        border-width: 2px;
    }

    .ecp-nav-btn {
        border-width: 2px;
    }
}

/* ==========================================================================
   Popup Modal
   ========================================================================== */

/* Overlay */
.ecp-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ecp-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Container */
.ecp-popup-modal {
    position: relative;
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.ecp-popup-overlay.active .ecp-popup-modal {
    transform: scale(1) translateY(0);
}

/* Close Button */
.ecp-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 300;
    line-height: 1;
    color: #666666;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
}

.ecp-popup-close:hover {
    color: #333333;
    background-color: #f0f0f0;
    transform: scale(1.1);
}

.ecp-popup-close:focus {
    outline: 2px solid var(--ecp-primary-color);
    outline-offset: 2px;
}

/* Content Area */
.ecp-popup-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}

.ecp-popup-content::-webkit-scrollbar {
    width: 6px;
    display: block;
}

.ecp-popup-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.ecp-popup-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.ecp-popup-content::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Image Container */
.ecp-popup-image {
    display: none;
    width: 100%;
    max-height: 300px;
    overflow: hidden;
    background-color: #f5f5f5;
}

.ecp-popup-image.has-image {
    display: block;
}

.ecp-popup-image img {
    width: 100%;
    height: 100%;
    max-height: 300px;
    object-fit: cover;
    display: block;
}

/* Title */
.ecp-popup-title {
    margin: 0;
    padding: 24px 24px 12px;
    font-size: 1.5rem;
    font-weight: 600;
    color: #333333;
    line-height: 1.3;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

/* Badge */
.ecp-popup-badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ecp-popup-badge-completed {
    background-color: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

/* Date */
.ecp-popup-date {
    padding: 0 24px 16px;
    font-size: 0.9375rem;
    color: #666666;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ecp-popup-date::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666666' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

/* Description */
.ecp-popup-description {
    padding: 0 24px 24px;
    font-size: 0.9375rem;
    color: #444444;
    line-height: 1.7;
}

.ecp-popup-description p {
    margin: 0 0 1em;
}

.ecp-popup-description p:last-child {
    margin-bottom: 0;
}

.ecp-popup-description img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Actions */
.ecp-popup-actions {
    padding: 16px 24px 24px;
    border-top: 1px solid #e0e0e0;
    margin-top: auto;
}

.ecp-popup-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #ffffff;
    background-color: var(--ecp-primary-color, #2563eb);
    border-radius: 6px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.ecp-popup-link:hover {
    background-color: var(--ecp-primary-hover, #1d4ed8);
    color: #ffffff;
}

/* Loading State */
.ecp-popup-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.ecp-popup-modal.loading .ecp-popup-loading {
    opacity: 1;
    visibility: visible;
}

.ecp-popup-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e0e0e0;
    border-top-color: var(--ecp-primary-color, #2563eb);
    border-radius: 50%;
    animation: ecp-spin 0.8s linear infinite;
}

/* Error State */
.ecp-popup-error {
    padding: 40px 24px;
    text-align: center;
}

.ecp-popup-error p {
    margin: 0 0 20px;
    font-size: 1rem;
    color: #666666;
}

.ecp-popup-error-close {
    padding: 10px 24px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #ffffff;
    background-color: var(--ecp-primary-color, #2563eb);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.ecp-popup-error-close:hover {
    background-color: var(--ecp-primary-hover, #1d4ed8);
}

/* Day Events List in Popup */
.ecp-popup-day-events {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 24px 24px;
}

.ecp-popup-day-event-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    background-color: #f8fafc;
    border: 1px solid var(--ecp-border-color, #e0e0e0);
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    transition: box-shadow 0.2s ease, background-color 0.2s ease;
}

.ecp-popup-day-event-item:hover {
    background-color: #eef2ff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ecp-popup-day-event-item.ecp-event-item-past {
    border-left: 4px solid #dc2626;
}

.ecp-popup-day-event-item.ecp-event-item-future {
    border-left: 4px solid #2563eb;
}

.ecp-popup-day-event-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #333333;
    line-height: 1.4;
}

.ecp-popup-day-event-excerpt {
    font-size: 0.8125rem;
    color: #666666;
    line-height: 1.5;
}

@media screen and (max-width: 599px) {
    .ecp-popup-day-events {
        padding: 0 20px 20px;
        gap: 6px;
    }

    .ecp-popup-day-event-item {
        padding: 10px 12px;
    }

    .ecp-popup-day-event-title {
        font-size: 0.875rem;
    }

    .ecp-popup-day-event-excerpt {
        font-size: 0.75rem;
    }
}

/* Body scroll lock when popup is open */
body.ecp-popup-open {
    overflow: hidden !important;
}

/* Popup Responsive - Mobile */
@media screen and (max-width: 599px) {
    .ecp-popup-overlay {
        padding: 12px;
    }

    .ecp-popup-modal {
        max-height: 90vh;
        border-radius: 12px;
    }

    .ecp-popup-close {
        top: 8px;
        right: 8px;
        width: 32px;
        height: 32px;
        font-size: 24px;
    }

    .ecp-popup-title {
        padding: 20px 20px 10px;
        font-size: 1.25rem;
    }

    .ecp-popup-date {
        padding: 0 20px 12px;
        font-size: 0.875rem;
    }

    .ecp-popup-description {
        padding: 0 20px 20px;
        font-size: 0.875rem;
    }

    .ecp-popup-actions {
        padding: 12px 20px 20px;
    }

    .ecp-popup-link {
        width: 100%;
        justify-content: center;
    }
}

/* Hide popup during print */
@media print {
    .ecp-popup-overlay {
        display: none !important;
    }
}
