/**
 * Expert Event Calendar - Public Styles
 *
 * @package Expert_Event_Calendar
 */

/* ==========================================================================
   CSS Custom Properties
   ========================================================================== */

:root {
    --eec-primary-color: #003150;
    --eec-secondary-color: #4a90a4;
    --eec-accent-color: #f5a623;
    --eec-text-color: #333;
    --eec-light-text: #666;
    --eec-border-color: #e0e0e0;
    --eec-bg-light: #f8f9fa;
    --eec-white: #fff;
    --eec-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --eec-shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.2);
    --eec-radius: 8px;
    --eec-transition: 0.3s ease;
}

/* ==========================================================================
   Calendar Wrapper
   ========================================================================== */

.eec-calendar-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    color: var(--eec-text-color);
}

/* ==========================================================================
   Navigation
   ========================================================================== */

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

.eec-nav-left {
    display: flex;
    gap: 10px;
}

.eec-nav-btn {
    padding: 8px 16px;
    background: var(--eec-bg-light);
    border: 1px solid var(--eec-border-color);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--eec-text-color);
    cursor: pointer;
    transition: all var(--eec-transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.eec-nav-btn:hover {
    background: var(--eec-primary-color);
    color: var(--eec-white);
    border-color: var(--eec-primary-color);
}

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

.eec-month-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--eec-text-color);
    margin: 0;
    letter-spacing: 1px;
}

.eec-nav-arrows {
    display: flex;
    gap: 5px;
}

.eec-nav-arrow {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--eec-bg-light);
    border: 1px solid var(--eec-border-color);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--eec-transition);
}

.eec-nav-arrow:hover {
    background: var(--eec-primary-color);
    color: var(--eec-white);
    border-color: var(--eec-primary-color);
}

.eec-nav-arrow .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* ==========================================================================
   Month Jumper
   ========================================================================== */

.eec-month-jumper {
    background: var(--eec-white);
    padding: 15px;
    border-radius: var(--eec-radius);
    box-shadow: var(--eec-shadow);
    margin-bottom: 20px;
}

.eec-jumper-content {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.eec-jumper-month,
.eec-jumper-year {
    padding: 8px 12px;
    border: 1px solid var(--eec-border-color);
    border-radius: 4px;
    font-size: 14px;
}

.eec-jumper-go {
    padding: 8px 20px;
    background: var(--eec-primary-color);
    color: var(--eec-white);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background var(--eec-transition);
}

.eec-jumper-go:hover {
    background: #004a7a;
}

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

.eec-calendar-grid {
    background: var(--eec-white);
    border-radius: var(--eec-radius);
    overflow: hidden;
    box-shadow: var(--eec-shadow);
}

.eec-calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--eec-primary-color);
    color: var(--eec-white);
}

.eec-calendar-day-name {
    padding: 15px;
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 1px;
}

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

.eec-calendar-day {
    position: relative;
    min-height: 80px;
    padding: 10px;
    border: 1px solid var(--eec-border-color);
    border-top: none;
    border-left: none;
    text-align: center;
    transition: background var(--eec-transition);
}

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

.eec-calendar-day:hover:not(.eec-day-empty) {
    background: var(--eec-bg-light);
}

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

.eec-day-number {
    font-size: 16px;
    font-weight: 500;
    color: var(--eec-light-text);
}

.eec-has-events {
    background: #f0f0f0;
    cursor: pointer;
}

.eec-has-events .eec-day-number {
    font-weight: 700;
    color: var(--eec-text-color);
}

.eec-today {
    background: rgba(245, 166, 35, 0.1);
}

.eec-today .eec-day-number {
    color: var(--eec-accent-color);
    font-weight: 700;
}

.eec-event-indicator {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 3px;
}

.eec-dot {
    width: 6px;
    height: 6px;
    background: var(--eec-text-color);
    border-radius: 50%;
}

/* ==========================================================================
   Events List
   ========================================================================== */

.eec-events-list {
    margin-top: 20px;
}

.eec-event-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: var(--eec-radius);
    color: var(--eec-white);
    cursor: pointer;
    transition: transform var(--eec-transition), box-shadow var(--eec-transition);
}

.eec-event-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--eec-shadow);
}

.eec-event-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 50px;
    margin-right: 20px;
}

.eec-event-day {
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
}

.eec-event-month {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}

.eec-event-title {
    font-size: 16px;
    font-weight: 600;
    flex-grow: 1;
}

/* ==========================================================================
   Modal - High z-index to ensure it appears above all page elements
   ========================================================================== */

/* Body class when modal is open - prevents background scrolling */
body.eec-modal-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
}

.eec-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 2147483646 !important; /* Max safe z-index - 1, ensures it's on top of everything */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    isolation: isolate !important; /* Creates new stacking context */
}

.eec-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.75) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    z-index: -1 !important; /* Behind modal content but part of modal */
}

.eec-modal-content {
    position: relative !important;
    background: var(--eec-white) !important;
    border-radius: var(--eec-radius) !important;
    max-width: 600px !important;
    width: 100% !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5) !important;
    animation: eec-modal-in 0.3s ease !important;
    z-index: 1 !important; /* Above overlay */
    transform: translateZ(0) !important; /* Forces GPU acceleration */
}

@keyframes eec-modal-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px) translateZ(0);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0) translateZ(0);
    }
}

.eec-modal-close {
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    width: 36px !important;
    height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: var(--eec-white) !important;
    border: none !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    z-index: 10 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
    transition: transform var(--eec-transition) !important;
}

.eec-modal-close:hover {
    transform: scale(1.1) !important;
    background: #f0f0f0 !important;
}

.eec-modal-close .dashicons {
    font-size: 22px !important;
    width: 22px !important;
    height: 22px !important;
    color: #333 !important;
}

/* Modal Header */
.eec-modal-header {
    display: flex;
    align-items: center;
    padding: 25px;
    color: var(--eec-white);
}

.eec-modal-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
    margin-right: 20px;
}

.eec-modal-day {
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
}

.eec-modal-month {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.eec-modal-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

/* Modal Sections */
.eec-modal-section {
    display: flex;
    padding: 20px 25px;
    border-bottom: 1px solid var(--eec-border-color);
}

.eec-section-icon {
    min-width: 40px;
}

.eec-section-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: var(--eec-primary-color);
}

.eec-section-content h4 {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--eec-text-color);
}

.eec-event-description {
    color: var(--eec-light-text);
    line-height: 1.6;
}

.eec-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
    padding: 8px 16px;
    background: var(--eec-primary-color);
    color: var(--eec-white);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: background var(--eec-transition);
}

.eec-more-btn:hover {
    background: #004a7a;
}

.eec-full-content {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--eec-border-color);
}

/* Modal Info Row */
.eec-modal-info-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid var(--eec-border-color);
}

.eec-modal-info-col {
    display: flex;
    padding: 20px 25px;
}

.eec-modal-info-col:first-child {
    border-right: 1px solid var(--eec-border-color);
}

.eec-timezone {
    color: var(--eec-secondary-color);
    font-size: 13px;
}

.eec-venue-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.eec-venue-address,
.eec-venue-contact {
    color: var(--eec-light-text);
    font-size: 13px;
}

.eec-other-events-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
    padding: 8px 16px;
    background: var(--eec-secondary-color);
    color: var(--eec-white);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: background var(--eec-transition);
}

.eec-other-events-btn:hover {
    background: #3a7a91;
    color: var(--eec-white);
}

/* Calendar Links */
.eec-modal-calendar-links {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    background: var(--eec-bg-light);
    border-bottom: 1px solid var(--eec-border-color);
}

.eec-modal-calendar-links .dashicons {
    color: var(--eec-primary-color);
}

.eec-modal-calendar-links a {
    color: var(--eec-primary-color);
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    letter-spacing: 0.5px;
}

.eec-modal-calendar-links a:hover {
    text-decoration: underline;
}

/* Directions */
.eec-modal-directions {
    display: flex;
    padding: 20px 25px;
}

.eec-directions-form {
    display: flex;
    gap: 10px;
    width: 100%;
}

.eec-directions-input {
    flex-grow: 1;
    padding: 12px 15px;
    border: 1px solid var(--eec-border-color);
    border-radius: 25px;
    font-size: 14px;
}

.eec-directions-input:focus {
    outline: none;
    border-color: var(--eec-secondary-color);
}

.eec-directions-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--eec-secondary-color);
    color: var(--eec-white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background var(--eec-transition);
}

.eec-directions-btn:hover {
    background: #3a7a91;
}

.eec-directions-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* ==========================================================================
   Loading State
   ========================================================================== */

.eec-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.eec-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--eec-border-color);
    border-top-color: var(--eec-primary-color);
    border-radius: 50%;
    animation: eec-spin 0.8s linear infinite;
}

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

/* ==========================================================================
   Responsive
   ========================================================================== */

@media screen and (max-width: 768px) {
    .eec-calendar-nav {
        flex-direction: column;
        align-items: flex-start;
    }

    .eec-nav-center {
        flex-direction: column;
        align-items: flex-start;
    }

    .eec-month-title {
        font-size: 20px;
    }

    .eec-calendar-day {
        min-height: 60px;
        padding: 5px;
    }

    .eec-day-number {
        font-size: 14px;
    }

    .eec-modal-info-row {
        grid-template-columns: 1fr;
    }

    .eec-modal-info-col:first-child {
        border-right: none;
        border-bottom: 1px solid var(--eec-border-color);
    }

    .eec-event-item {
        padding: 12px 15px;
    }

    .eec-event-date {
        min-width: 40px;
        margin-right: 15px;
    }

    .eec-event-day {
        font-size: 20px;
    }

    .eec-event-title {
        font-size: 14px;
    }
}

@media screen and (max-width: 480px) {
    .eec-calendar-day-name {
        padding: 10px 5px;
        font-size: 10px;
    }

    .eec-calendar-day {
        min-height: 50px;
    }

    .eec-day-number {
        font-size: 12px;
    }

    .eec-event-indicator {
        bottom: 5px;
    }

    .eec-dot {
        width: 4px;
        height: 4px;
    }
}
