/* Reset and base styles for enhanced calendar */
.i2i-calendar-wrapper {
    position: relative;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(100px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

/* Ensure enhanced calendar takes full space */
.i2i-calendar-enhanced {
    height: 100%;
    min-height: 500px;
}

/* Hide original calendar if enhanced is present */
.i2i-calendar-wrapper .i2i-calendar {
    display: none;
}

.fc-list-day-cushion.fc-cell-shaded a {
    color: #000000 !important;
}

/* Override FullCalendar default styles */
.i2i-calendar-enhanced .fc {
    background: transparent;
}

.i2i-calendar-enhanced .fc-toolbar {
    margin-bottom: 1.5em;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 15px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.i2i-calendar-enhanced .fc-toolbar-title {
    font-size: 1.5em;
    font-weight: 700;
    color: #2d3748;
}

.i2i-calendar-enhanced .fc-button-primary {
    background: rgba(55, 136, 216, 0.9);
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.i2i-calendar-enhanced .fc-button-primary:hover {
    background: rgba(55, 136, 216, 1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(55, 136, 216, 0.3);
}

.i2i-calendar-enhanced .fc-button-primary:not(:disabled).fc-button-active {
    background: #2c5aa0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Day grid styling */
.i2i-calendar-enhanced .fc-daygrid-day {
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.i2i-calendar-enhanced .fc-daygrid-day-top {
    padding: 8px;
}

.i2i-calendar-enhanced .fc-day-today {
    background: rgba(55, 136, 216, 0.1) !important;
}

/* Enhanced event styling */
.i2i-calendar-event {
    margin: 2px;
    border-radius: 8px !important;
    border: none !important;
    font-size: 12px;
    padding: 4px 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.i2i-calendar-event:hover,
.i2i-event-hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2) !important;
    z-index: 10;
}

/* Event content styling */
.i2i-event-content {
    line-height: 1.2;
}

.i2i-event-title {
    font-weight: 600;
    margin-bottom: 2px;
    font-size: 11px;
}

.i2i-event-meta {
    font-size: 10px;
    opacity: 0.9;
}

.i2i-event-time,
.i2i-event-author,
.i2i-event-series {
    display: block;
    margin: 1px 0;
}

/* Card style events */
.i2i-event-style-card {
    background: rgba(255, 255, 255, 0.95) !important;
    color: #2d3748 !important;
    border-left: 4px solid currentColor !important;
    backdrop-filter: blur(10px);
}

/* Badge style events */
.i2i-event-style-badge {
    border-radius: 20px !important;
    padding: 2px 8px !important;
    font-size: 10px !important;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Minimal style events */
.i2i-event-style-minimal {
    background: transparent !important;
    border-left: 3px solid currentColor !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Loading animation */
.i2i-calendar-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.i2i-loading-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 4px solid rgba(55, 136, 216, 0.3);
    border-radius: 50%;
    border-top-color: #3788d8;
    animation: i2i-spin 1s ease-in-out infinite;
}

@keyframes i2i-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Theme variations */
.i2i-theme-dark_mode {
    background: linear-gradient(145deg, #1a1a1a, #2d2d30);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.1);
}

.i2i-theme-dark_mode .fc-toolbar-title,
.i2i-theme-dark_mode .fc-col-header-cell-cushion {
    color: #ffffff;
}

.i2i-theme-dark_mode .fc-daygrid-day {
    border-color: rgba(255, 255, 255, 0.1);
}

.i2i-theme-minimal_clean {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.i2i-theme-gradient_vibrant {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
}

.i2i-theme-gradient_vibrant .fc-toolbar-title {
    color: #ffffff;
}

/* Popup styles */
.i2i-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    animation: i2i-fadeIn 0.3s ease-out;
}

.i2i-event-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 24px;
    max-width: 600px;
    width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 10001;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

@keyframes i2i-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes i2i-popupSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.i2i-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.i2i-popup-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a202c;
    margin: 0;
    line-height: 1.3;
    flex: 1;
    margin-right: 12px;
}

.i2i-popup-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.i2i-popup-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.i2i-popup-content {
    color: #4a5568;
    line-height: 1.5;
}

.i2i-popup-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 12px;
}

.i2i-popup-author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.i2i-popup-author-info h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
}

.i2i-popup-author-info p {
    margin: 0;
    font-size: 14px;
    color: #718096;
}

.i2i-popup-datetime {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-weight: 500;
    color: #2b6cb0;
    padding: 8px 12px;
    background: rgba(43, 108, 176, 0.1);
    border-radius: 8px;
}

.i2i-popup-series {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 16px;
}

.i2i-popup-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.i2i-popup-btn {
    flex: 1;
    min-width: 120px;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    display: inline-block;
}

.i2i-popup-btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.i2i-popup-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    color: white;
    text-decoration: none;
}

.i2i-popup-btn-secondary {
    background: rgba(0, 0, 0, 0.05);
    color: #4a5568;
}

.i2i-popup-btn-secondary:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #2d3748;
    text-decoration: none;
}

/* Responsive design */
@media (max-width: 768px) {
    .i2i-calendar-wrapper {
        padding: 15px;
        border-radius: 16px;
    }
    
    .i2i-event-popup {
        max-width: 95vw;
        padding: 20px;
    }
    
    .i2i-popup-actions {
        flex-direction: column;
    }
    
    .i2i-popup-btn {
        flex: none;
    }
    
    .fc-toolbar {
        flex-direction: column;
        gap: 10px;
    }
    
    .fc-toolbar-chunk {
        display: flex;
        justify-content: center;
    }
    
    .i2i-event-title {
        font-size: 10px;
    }
    
    .i2i-event-meta {
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    .i2i-calendar-wrapper {
        padding: 10px;
    }
    
    .fc-toolbar {
        padding: 8px 10px;
    }
    
    .fc-toolbar-title {
        font-size: 1.2em;
    }
    
    .fc-button-primary {
        padding: 6px 8px;
        font-size: 12px;
    }
}

/* Ensure no conflicts with existing calendar */
.i2i-calendar-wrapper.i2i-theme-modern_glass .i2i-calendar,
.i2i-calendar-wrapper.i2i-theme-dark_mode .i2i-calendar,
.i2i-calendar-wrapper.i2i-theme-minimal_clean .i2i-calendar,
.i2i-calendar-wrapper.i2i-theme-gradient_vibrant .i2i-calendar {
    display: none !important;
}
