/**
 * Public Calendar Styles - Modern Premium Design
 * Font: Outfit (Google Fonts)
 */

/* Main Wrapper */
.gec-calendar-wrapper {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1f2937;
}

.gec-calendar-wrapper.gec-loading-active {
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-ring {
    0% {
        transform: translateX(-50%) scale(0.8);
        box-shadow: 0 0 0 0 rgba(234, 88, 12, 0.7);
    }

    70% {
        transform: translateX(-50%) scale(1.2);
        box-shadow: 0 0 0 10px rgba(234, 88, 12, 0);
    }

    100% {
        transform: translateX(-50%) scale(0.8);
        box-shadow: 0 0 0 0 rgba(234, 88, 12, 0);
    }
}

/* Filter Bar - Glassmorphism & Gradient */
.gec-filter-bar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 32px;
    margin-bottom: 40px;
    border-radius: 24px;
    box-shadow:
        0 10px 40px -10px rgba(234, 179, 8, 0.1),
        0 0 0 1px rgba(234, 179, 8, 0.1);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.5s ease-out;
}

/* Subtle decorative gradient on top */
.gec-filter-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #ea580c, #f59e0b, #fbbf24);
}

.gec-filter-row {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.gec-filter-item {
    flex: 1;
    min-width: 220px;
}

.gec-filter-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #92400e;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Search Input Wrapper */
.gec-search-wrapper {
    position: relative;
    width: 100%;
}

.gec-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #f59e0b;
    pointer-events: none;
    transition: color 0.3s ease;
}

/* Inputs & Selects */
.gec-filter-select,
.gec-filter-input {
    width: 100%;
    padding: 14px 18px;
    height: 52px;
    border: 2px solid #f3f4f6;
    border-radius: 16px;
    font-size: 16px;
    background: #f9fafb;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    font-family: inherit;
    color: #374151;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.gec-search-wrapper .gec-filter-input {
    padding-left: 48px;
}

.gec-filter-select:hover,
.gec-filter-input:hover {
    border-color: #fcd34d;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.1);
}

.gec-filter-select:focus,
.gec-filter-input:focus {
    outline: none;
    border-color: #f59e0b;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15);
}

.gec-search-wrapper:focus-within .gec-search-icon {
    color: #ea580c;
}

/* Buttons */
.gec-button {
    padding: 14px 32px;
    height: 52px;
    border: none;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    letter-spacing: 0.02em;
}

.gec-button-secondary {
    background: linear-gradient(135deg, #FFF7ED 0%, #FFFBEB 100%);
    color: #d97706;
    border: 1px solid #fcd34d;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.05);
}

.gec-button-secondary:hover {
    background: #fff;
    border-color: #f59e0b;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(245, 158, 11, 0.15);
    color: #ea580c;
}

.gec-button-secondary:active {
    transform: translateY(0);
}

/* Calendar Container */
.gec-calendar-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 32px;
    margin-bottom: 40px;
    animation: fadeInUp 0.6s ease-out 0.1s backwards;
}

@media screen and (max-width: 1024px) {
    .gec-calendar-container {
        grid-template-columns: 1fr;
    }
}

.gec-calendar-main {
    background: #ffffff;
    padding: 36px;
    border-radius: 24px;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.02),
        0 20px 48px -12px rgba(234, 179, 8, 0.08);
    border: 1px solid rgba(243, 244, 246, 0.8);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gec-calendar-main:hover {
    transform: translateY(-2px);
    box-shadow:
        0 20px 25px -5px rgba(0, 0, 0, 0.02),
        0 25px 50px -12px rgba(234, 179, 8, 0.12);
}

/* FullCalendar Customization */
.fc {
    font-family: inherit;
}

.fc .fc-toolbar {
    margin-bottom: 32px;
}

.fc .fc-toolbar-title {
    font-size: 2em;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.03em;
}

.fc .fc-button {
    padding: 12px 20px;
    font-weight: 600;
    border-radius: 12px;
    border: none !important;
    background: #f3f4f6 !important;
    color: #4b5563 !important;
    box-shadow: none !important;
    transition: all 0.2s ease;
}

.fc .fc-button:hover {
    background: #e5e7eb !important;
    color: #1f2937 !important;
    transform: translateY(-1px);
}

.fc .fc-button-active {
    background: #f59e0b !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3) !important;
}

.fc .fc-button:disabled {
    opacity: 0.5;
}

/* Calendar Grid */
.fc .fc-theme-standard td,
.fc .fc-theme-standard th {
    border-color: #f3f4f6;
}

.fc .fc-col-header-cell {
    padding: 16px 0;
    font-weight: 700;
    font-size: 13px;
    color: #92400e;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: #fffbeb;
    border-bottom: 2px solid #fcd34d !important;
}

.fc .fc-daygrid-day {
    transition: background-color 0.2s ease;
}

.fc .fc-daygrid-day:hover {
    background-color: #fffbeb;
    cursor: pointer;
}

.fc .fc-daygrid-day-number {
    padding: 12px;
    font-size: 15px;
    font-weight: 500;
    color: #6b7280;
    z-index: 2;
    position: relative;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 4px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.fc .fc-daygrid-day:hover .fc-daygrid-day-number {
    color: #1f2937;
    background: rgba(255, 255, 255, 0.8);
}

/* Hide default events */
.fc-event,
.fc-daygrid-event-dot,
.fc-event-main {
    display: none !important;
}

/* Active Day Indicator (Dot) */
.fc-daygrid-day.gec-has-events .fc-daygrid-day-number {
    color: #ea580c;
    font-weight: 700;
    background: #fff7ed;
}

.fc-daygrid-day.gec-has-events .fc-daygrid-day-number::after {
    content: '';
    position: absolute;
    bottom: 6px;
    width: 6px;
    height: 6px;
    background: #ea580c;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(234, 88, 12, 0.6);
}

/* Selected Day */
.fc-daygrid-day.gec-selected-day .fc-daygrid-day-number {
    background: #ea580c;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.4);
}

.fc-daygrid-day.gec-selected-day .fc-daygrid-day-number::after {
    background: #ffffff;
}

/* Events Sidebar */
.gec-events-sidebar {
    background: #ffffff;
    border-radius: 24px;
    box-shadow:
        0 10px 30px -5px rgba(0, 0, 0, 0.05),
        0 0 0 1px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: fit-content;
    max-height: 800px;
}

.gec-sidebar-header {
    background: linear-gradient(135deg, #fff7ed 0%, #fff 100%);
    padding: 28px 32px;
    border-bottom: 1px solid #fed7aa;
}

.gec-sidebar-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #9a3412;
    letter-spacing: -0.01em;
}

.gec-events-list {
    padding: 24px;
    overflow-y: auto;
    background: #fafaf9;
    flex: 1;
    min-height: 300px;
}

.gec-no-selection,
.gec-no-events {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #9ca3af;
    font-weight: 500;
    font-style: italic;
    min-height: 200px;
}

/* Event Cards */
.gec-event-item {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.4s ease-out forwards;
}

.gec-event-item:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    border-color: rgba(251, 191, 36, 0.3);
}

/* Left colored accent strip */
.gec-event-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #f59e0b, #ea580c);
    opacity: 0.8;
}

.gec-event-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 16px;
    line-height: 1.4;
}

.gec-event-meta {
    font-size: 15px;
    color: #4b5563;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gec-event-time,
.gec-event-location {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gec-icon {
    color: #ea580c;
    font-size: 18px;
    opacity: 0.8;
}

.gec-label {
    font-weight: 600;
    color: #9a3412;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 60px;
}

/* Loading Spinner */
.gec-loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.gec-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #fed7aa;
    border-top-color: #ea580c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

.gec-loading p {
    margin: 0;
    font-weight: 600;
    color: #4b5563;
}

/* Error Message */
.gec-error-message {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    padding: 20px;
    border-radius: 12px;
    color: #991b1b;
    margin-bottom: 32px;
    font-weight: 500;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.1);
}

/* Responsive */
@media screen and (max-width: 768px) {
    .gec-filter-row {
        flex-direction: column;
        gap: 16px;
    }

    .gec-calendar-main {
        padding: 20px;
    }

    .gec-sidebar-header,
    .gec-events-list {
        padding: 20px;
    }

    .fc .fc-toolbar-title {
        font-size: 1.5em;
    }

    /* Mobile Day Grid Fixes */
    .fc .fc-daygrid-day-number {
        width: 28px;
        height: 28px;
        font-size: 13px;
        margin: 2px auto;
        /* Center it and reduce margin */
        padding: 0;
    }

    /* Smaller spacing for mobile header cells */
    .fc .fc-col-header-cell {
        padding: 8px 0;
        font-size: 11px;
    }

    /* Adjust dot position for smaller numbers */
    .fc-daygrid-day.gec-has-events .fc-daygrid-day-number::after {
        bottom: 4px;
        width: 4px;
        height: 4px;
    }
}

@media screen and (max-width: 480px) {
    .gec-calendar-wrapper {
        padding: 10px 5px;
    }

    .fc .fc-toolbar-title {
        font-size: 1.25em;
    }

    /* Even tighter for very small screens */
    .fc .fc-daygrid-day-number {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
}