/* HCTV Community Calendar Styles */

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f5f5f5; }

.calendar-header { background: linear-gradient(90deg, #224191, #E12E29); color: white; padding: 30px 20px; text-align: center; }
.calendar-header h1 { color: white; font-weight: 700 !important; font-size: 2rem; margin-bottom: 0px; display: flex; align-items: center; justify-content: center; gap: 15px; }
.calendar-header .subtitle { font-size: 1.1rem; opacity: 0.9; }
.event-count-badge { display: inline-block; background: #E12E29; color: white; padding: 5px 15px; border-radius: 20px; font-size: 0.9rem; margin-top: 10px; font-weight: 600; }

.control-bar { background: white; padding: 12px 20px; display: flex; flex-wrap: nowrap; gap: 15px; align-items: center; justify-content: space-between; box-shadow: 0 2px 10px rgba(0,0,0,0.1); position: sticky; top: 0; z-index: 100; }
.view-toggle { display: flex; gap: 5px; flex-shrink: 0; }
.view-toggle button { font-size: 13px !important; padding: 8px 16px; background: #E12E29 !important; color: #fff; cursor: pointer; font-weight: 600; transition: all 0.2s; border-radius: 5px; margin-right: 5px; border: none; }
.view-toggle button.active { background: #224191 !important; color: white; }
.view-toggle button:hover:not(.active) { background: #CB2925 !important; }
.filters { display: flex; flex-wrap: nowrap; gap: 10px; align-items: center; }
.filter-select, .search-input { padding: 4px 12px; border: 1px solid #ddd; border-radius: 5px; font-size: 0.85rem; min-width: 140px; }
.search-input { padding: 2px 12px; margin-bottom: 0px !important; }
.search-input { min-width: 180px; }
.filter-select:focus, .search-input:focus { outline: none; border-color: #224191; box-shadow: 0 0 0 2px rgba(34, 65, 145, 0.2); }

/* Submit Event Banner */
.submit-event-banner { margin: 20px auto 0px auto !important; max-width: 1360px; background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); border-radius: 12px; padding: 20px 30px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; border-left: 4px solid #E12E29; }
.banner-content { display: flex; align-items: center; gap: 15px; }
.banner-icon { width: 50px; height: 50px; background: linear-gradient(135deg, #E12E29 0%, #c41e1e 100%); border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.banner-icon i { color: white; font-size: 22px; }
.banner-text h4 { color: white; font-size: 16px; font-weight: 600; margin: 0 0 4px 0; }
.banner-text span { color: rgba(255,255,255,0.6); font-size: 13px; margin: 0; }
.banner-link { background: rgba(225, 46, 41, 0.15); border: 1px solid rgba(225, 46, 41, 0.3); border-radius: 8px; padding: 12px 20px; display: flex; align-items: center; gap: 10px; text-decoration: none; }
.banner-link i { color: #E12E29; }
.banner-link span { color: white; font-weight: 600; font-size: 14px; }
.banner-link:hover { background: rgba(225, 46, 41, 0.25); }

.calendar-container { max-width: 1400px; margin: 0 auto; padding: 20px; }
.month-group { margin-bottom: 40px; }
.month-header { background: linear-gradient(90deg, #224191, #E12E29); color: white; padding: 12px 20px; font-size: 1.3rem; font-weight: 700; margin-bottom: 20px; border-radius: 8px; display: flex; align-items: center; justify-content: space-between; }
.month-event-count { background: rgba(255,255,255,0.2); padding: 4px 12px; border-radius: 15px; font-size: 0.85rem; }

/* Grid View */
.events-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }
.event-card { background: white; border-radius: 12px; overflow: hidden; box-shadow: 0 3px 15px rgba(0,0,0,0.1); transition: transform 0.2s, box-shadow 0.2s; cursor: pointer; display: flex; flex-direction: column; }
.event-card:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0,0,0,0.15); }
.event-image { width: 100% !important; height: 160px !important; object-fit: cover !important; object-position: center 25% !important; background: linear-gradient(135deg, #224191, #E12E29) !important; }
.event-image.portrait { object-position: center 20% !important; }
.event-image.landscape { object-position: center 33% !important; }
.event-image.square { object-position: center center !important; }
.event-image-placeholder { width: 100%; height: 160px; background: linear-gradient(135deg, #224191, #E12E29); display: flex; align-items: center; justify-content: center; color: white; font-size: 3rem; }
.event-content { padding: 0 15px 15px 15px; display: flex; flex-direction: column; flex: 1; }
.event-category { display: block; padding: 5px 10px; border-radius: 0; font-size: 0.75rem; font-weight: 600; margin: 0 -15px 8px -15px; text-transform: uppercase; text-align: center; }
.event-list-content .event-category { display: inline-block; padding: 3px 10px; border-radius: 15px; margin: 0; flex-shrink: 0; }

/* Category Colors */
.cat-sports { background: #E12E29; color: white; }
.cat-comedy { background: #9C27B0; color: white; }
.cat-music { background: #2196F3; color: white; }
.cat-family { background: #4CAF50; color: white; }
.cat-food { background: #FF9800; color: white; }
.cat-nature { background: #8BC34A; color: white; }
.cat-arts { background: #E91E63; color: white; }
.cat-education { background: #00BCD4; color: white; }
.cat-community { background: #607D8B; color: white; }

.event-title { font-size: 1.1rem; font-weight: 700; color: #224191; margin-bottom: 8px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.event-date { font-size: 0.9rem; color: #E12E29; font-weight: 600; margin-bottom: 5px; }
.event-venue { font-size: 0.85rem; color: #666; display: flex; align-items: center; gap: 5px; }
.event-venue::before { content: "📍"; }
.venue-rating { display: flex; align-items: center; gap: 3px; margin-top: auto; padding-top: 8px; font-size: 0.8rem; color: #ffc107; }
.venue-rating span { color: #666; }

/* List View */
.events-list { display: none; }
.events-list.active { display: block; }
.events-grid.hidden { display: none; }
.event-list-item { background: white; border-radius: 8px; padding: 0; margin-bottom: 10px; display: flex; gap: 0; align-items: stretch; box-shadow: 0 2px 8px rgba(0,0,0,0.08); cursor: pointer; transition: background 0.2s; overflow: hidden; }
.event-list-item:hover { background: #f8f9ff; }
.event-list-image { width: 120px; height: 80px; object-fit: cover; border-radius: 0; flex-shrink: 0; margin: 0; padding: 0; }
.event-list-content { flex: 1; padding: 10px 15px; display: flex; flex-direction: column; justify-content: center; }
.event-list-title-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.event-list-title { font-weight: 700; color: #224191; flex: 1; font-size: 18px; }
.event-list-date { font-size: 0.85rem; color: #E12E29; }
.event-list-venue { font-size: 0.8rem; color: #666; }

/* Calendar View Styles */
.calendar-view { display: none; }
.calendar-view.active { display: block; }
.calendar-nav { display: flex; align-items: center; justify-content: center; gap: 20px; margin-bottom: 20px; }
.calendar-nav button { background: #224191; color: white; border: none; padding: 10px 20px; border-radius: 5px; cursor: pointer; font-weight: 600; transition: background 0.2s; }
.calendar-nav button:hover { background: #1a3270; }
.calendar-nav h2 { font-size: 1.5rem; color: #224191; min-width: 200px; text-align: center; }
.calendar-day-headers { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: #ddd; border-radius: 10px 10px 0 0; overflow: hidden; box-shadow: 0 3px 15px rgba(0,0,0,0.1); }
.calendar-day-header { background: #224191; color: white; padding: 12px; text-align: center; font-weight: 600; }
.calendar-grid { display: grid !important; grid-template-columns: repeat(7, 1fr) !important; gap: 1px !important; background: #ddd !important; border-radius: 0 0 10px 10px !important; overflow: hidden !important; box-shadow: 0 3px 15px rgba(0,0,0,0.1) !important; border: #ddd solid 1px !important; }
.calendar-day { background: white !important; height: 150px !important; min-height: 150px !important; max-height: 150px !important; padding: 5px !important; position: relative !important; overflow: hidden !important; box-sizing: border-box !important; }
.calendar-day.other-month { background: #f9f9f9 !important; }
.calendar-day.other-month .day-number { color: #bbb; }
.calendar-day.today { background: #fff8e1 !important; }
.day-number { font-weight: 700 !important; color: #224191 !important; margin-bottom: 2px !important; font-size: 0.8rem !important; height: 14px !important; line-height: 14px !important; overflow: hidden !important; }
.day-events { display: flex !important; flex-direction: column !important; gap: 1px !important; height: 110px !important; max-height: 110px !important; overflow: hidden !important; box-sizing: border-box !important; }
.day-event { font-size: 0.7rem !important; font-weight: 500; padding: 1px 4px !important; border-radius: 2px !important; cursor: pointer !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; width: 100% !important; max-width: 100% !important; display: block !important; height: 15px !important; max-height: 15px !important; line-height: 13px !important; box-sizing: border-box !important; }
.day-event:hover { filter: brightness(0.95); font-weight: 600; }

/* Day Event Category Colors */
.day-event.cat-sports { background: #ffebee; color: #c62828; border-left: 3px solid #E12E29; }
.day-event.cat-comedy { background: #f3e5f5; color: #7b1fa2; border-left: 3px solid #9C27B0; }
.day-event.cat-music { background: #e3f2fd; color: #1565c0; border-left: 3px solid #2196F3; }
.day-event.cat-family { background: #e8f5e9; color: #2e7d32; border-left: 3px solid #4CAF50; }
.day-event.cat-food { background: #fff3e0; color: #ef6c00; border-left: 3px solid #FF9800; }
.day-event.cat-nature { background: #f1f8e9; color: #558b2f; border-left: 3px solid #8BC34A; }
.day-event.cat-arts { background: #fce4ec; color: #c2185b; border-left: 3px solid #E91E63; }
.day-event.cat-education { background: #e0f7fa; color: #00838f; border-left: 3px solid #00BCD4; }
.day-event.cat-community { background: #eceff1; color: #455a64; border-left: 3px solid #607D8B; }

.more-events { font-size: 0.65rem !important; color: #224191 !important; cursor: pointer !important; font-weight: 600 !important; padding: 1px 4px !important; height: 15px !important; line-height: 13px !important; overflow: hidden !important; }
.more-events:hover { text-decoration: underline; }

/* Day Detail Popup */
.day-popup-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 999; }
.day-popup-overlay.active { display: block; }
.day-popup { display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: white; border-radius: 12px; padding: 20px; max-width: 400px; width: 90%; max-height: 80vh; overflow-y: auto; z-index: 1001; box-shadow: 0 10px 40px rgba(0,0,0,0.3); }
.day-popup.active { display: block; }
.day-popup-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 2px solid #224191; }
.day-popup-header h3 { color: #224191; margin: 0; }
.day-popup-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #666; }
.day-popup-event { padding: 10px; margin-bottom: 8px; border-radius: 8px; cursor: pointer; transition: background 0.2s; }
.day-popup-event:hover { background: #f5f5f5; }
.day-popup-event-title { font-weight: 600; color: #224191; margin-bottom: 3px; }
.day-popup-event-time { font-size: 0.85rem; color: #E12E29; }
.day-popup-event-venue { font-size: 0.8rem; color: #666; }

/* Modal */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7); z-index: 1000; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.active { display: flex; }
.modal { background: white; border-radius: 15px; max-width: 700px; width: 100%; max-height: 90vh; overflow-y: auto; position: relative; }
.modal-close { position: absolute; top: 15px; right: 15px; background: rgba(0,0,0,0.5); color: white; border: none; width: 35px; height: 35px; border-radius: 50%; cursor: pointer; font-size: 1.2rem; z-index: 10; }
.modal-image { width: 100%; height: 300px; object-fit: cover; }
.modal-content { padding: 25px; }
.modal-category { display: inline-block; padding: 4px 12px; border-radius: 15px; font-size: 0.8rem; font-weight: 600; margin-bottom: 10px; text-transform: uppercase; }
.modal-title { font-size: 1.5rem; color: #224191; margin-bottom: 15px; }
.modal-details { margin-bottom: 20px; }
.modal-detail { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; font-size: 0.95rem; }
.modal-detail-icon { font-size: 1.2rem; width: 25px; }
.modal-description { color: #555; margin-bottom: 20px; line-height: 1.7; }
.modal-venue-info { background: #f5f5f5; padding: 15px; border-radius: 8px; margin-bottom: 20px; }
.modal-venue-name { font-weight: 700; margin-bottom: 5px; }
.modal-venue-rating { display: flex; align-items: center; gap: 5px; color: #ffc107; }
.modal-venue-rating span { color: #666; }
.modal-link { display: inline-block; background: #E12E29; color: white; padding: 12px 25px; border-radius: 8px; text-decoration: none; font-weight: 600; transition: background 0.2s; }
.modal-link:hover { background: #c42520; }

/* No Results & Loading */
.no-results { text-align: center; padding: 60px 20px; color: #666; }
.no-results h3 { color: #224191; margin-bottom: 10px; }
.loading-spinner { text-align: center; padding: 60px 20px; color: #666; font-size: 1.1rem; }

/* Category Legend */
.category-legend { display: flex; flex-wrap: wrap; justify-content: center; margin: 0; padding: 8px 10px; background: white; border-radius: 0; box-shadow: none; border-left: 1px solid #ddd; border-right: 1px solid #ddd; }
.legend-item { display: flex; align-items: center; gap: 5px; font-size: 0.8rem; margin: 0 10px; }
.legend-dot { width: 12px; height: 12px; border-radius: 50%; }

/* Responsive */
@media (max-width: 1400px) {
    .events-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1100px) {
    .events-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 850px) {
    .events-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .calendar-header h1 { font-size: 1.5rem; }
    .control-bar { flex-direction: column; align-items: stretch; }
    .filters { flex-direction: column; }
    .filter-select, .search-input { width: 100%; }
    .event-list-item { flex-direction: column; align-items: flex-start; }
    .event-list-image { width: 100%; height: 150px; }
    .modal-image { height: 200px; }
    .calendar-day { height: 120px !important; min-height: 120px !important; max-height: 120px !important; padding: 3px !important; }
    .calendar-day-header { padding: 8px 4px; font-size: 0.75rem; }
    .day-number { font-size: 0.75rem !important; }
    .day-event { font-size: 0.6rem !important; padding: 1px 3px !important; }
    .calendar-nav h2 { font-size: 1.1rem; min-width: 150px; }
    .submit-event-banner { flex-direction: column; text-align: center; }
    .banner-content { flex-direction: column; }
    .banner-link { width: 100%; justify-content: center; }
}
@media (max-width: 550px) {
    .events-grid { grid-template-columns: 1fr; }
}
