/* Community Events Calendar - Frontend Styles */

.cec-calendar-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 100%;
    margin: 20px 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Calendar Filters */
.cec-calendar-filters {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.cec-calendar-filters select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    min-width: 150px;
}

/* Calendar Navigation */
.cec-calendar-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #fff;
    border-bottom: 1px solid #e9ecef;
}

.cec-nav-btn {
    background: #007cba;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.cec-nav-btn:hover {
    background: #005a87;
}

.cec-nav-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.cec-current-date {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

/* Calendar Grid */
.cec-calendar-grid {
    background: white;
}

.cec-calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.cec-day-header {
    padding: 15px 10px;
    text-align: center;
    font-weight: 600;
    color: #333;
    border-right: 1px solid #e9ecef;
    font-size: 14px;
}

.cec-day-header:last-child {
    border-right: none;
}

.cec-calendar-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    min-height: 400px;
}

/* Calendar Day */
.cec-calendar-day {
    min-height: 80px;
    border-right: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
    padding: 8px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cec-calendar-day:hover {
    background: #f8f9fa;
}

.cec-calendar-day:last-child {
    border-right: none;
}

.cec-calendar-day.other-month {
    background: #f8f9fa;
    opacity: 0.5;
}

.cec-calendar-day.current-month {
    background: white;
}

.cec-calendar-day.today {
    background: #e3f2fd;
}

.cec-day-number {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: #333;
}

.cec-calendar-day.other-month .cec-day-number {
    color: #999;
}

/* Events in Calendar */
.cec-day-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 60px;
    overflow: hidden;
}

.cec-event {
    background: #007cba;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    line-height: 1.2;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cec-event:hover {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cec-event-title {
    display: block;
}

/* Event Categories */
.cec-event.category-workshop {
    background: #28a745;
}

.cec-event.category-meeting {
    background: #fd7e14;
}

.cec-event.category-social {
    background: #e83e8c;
}

.cec-event.category-conference {
    background: #6f42c1;
}

/* Event Details Display */
.cec-event-details {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cec-event-meta {
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.5;
}

.cec-meta-label {
    font-weight: 600;
    color: #333;
}

.cec-meta-value {
    color: #666;
}

.cec-event-url a {
    color: #007cba;
    text-decoration: none;
    font-weight: 600;
}

.cec-event-url a:hover {
    text-decoration: underline;
}

/* Event Map */
.cec-event-map {
    margin-top: 20px;
}

.cec-event-map h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
}

.cec-map-container {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Upcoming Events List */
.cec-upcoming-events {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.cec-upcoming-events h3 {
    margin-bottom: 15px;
    color: #333;
    border-bottom: 2px solid #007cba;
    padding-bottom: 10px;
}

.cec-events-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cec-event-item {
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.cec-event-item h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
}

.cec-event-item h4 a {
    color: #007cba;
    text-decoration: none;
}

.cec-event-item h4 a:hover {
    text-decoration: underline;
}

.cec-event-date {
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
}

.cec-event-excerpt {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* Loading States */
.cec-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.cec-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: cec-spin 1s linear infinite;
}

@keyframes cec-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .cec-calendar-navigation {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .cec-nav-btn {
        min-width: 120px;
    }
    
    .cec-calendar-day {
        min-height: 60px;
        padding: 4px;
    }
    
    .cec-day-number {
        font-size: 12px;
    }
    
    .cec-event {
        font-size: 10px;
        padding: 1px 4px;
    }
    
    .cec-event-details {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .cec-calendar-container {
        margin: 10px 0;
        border-radius: 4px;
    }
    
    .cec-calendar-navigation {
        padding: 15px;
    }
    
    .cec-current-date {
        font-size: 16px;
    }
    
    .cec-calendar-day {
        min-height: 50px;
        padding: 2px;
    }
    
    .cec-day-events {
        max-height: 40px;
    }
    
    .cec-day-header {
        padding: 10px 5px;
        font-size: 12px;
    }
}

/* BuddyPress Integration Styles */
.bp-user-events .bp-event-item {
    padding: 15px;
    margin-bottom: 15px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.bp-user-events .bp-event-item h4 {
    margin: 0 0 8px 0;
}

.bp-user-events .event-date {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.bp-user-events .event-excerpt {
    color: #666;
    line-height: 1.5;
}

/* Accessibility */
.cec-calendar-day:focus {
    outline: 2px solid #007cba;
    outline-offset: -2px;
}

.cec-event:focus {
    outline: 2px solid #fff;
    outline-offset: -2px;
}

.cec-nav-btn:focus {
    outline: 2px solid #005a87;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .cec-calendar-navigation,
    .cec-calendar-filters {
        display: none;
    }
    
    .cec-calendar-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .cec-calendar-day {
        break-inside: avoid;
    }
}