/**
 * Calendar Public Page Styles
 * ปฏิทินกิจกรรม - หน้าสาธารณะ
 */

/* Calendar Content Container */
.calendar-content {
    padding-bottom: 80px;
}

/* Page Header Section */
.page-header-section {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    padding: 24px 0 20px;
    margin-top: 16px;
}

.page-header-section .page-title {
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-header-section .page-title i {
    font-size: 24px;
}

.page-header-section .page-subtitle {
    font-size: 14px;
    opacity: 0.9;
    margin: 0;
}

/* Filter Bar */
.filter-bar {
    background: #f8fafc;
    padding: 16px 0;
    border-bottom: 1px solid #e2e8f0;
}

.filter-bar .search-box {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-bar .search-box:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-bar .search-box i {
    color: #94a3b8;
    font-size: 18px;
    margin-right: 10px;
}

.filter-bar .search-box input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    background: transparent;
}

.filter-bar .search-box input::placeholder {
    color: #94a3b8;
}

.filter-bar .search-clear {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-bar .filter-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-bar .filter-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    flex: 1;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.filter-bar .filter-chips::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 13px;
    color: #64748b;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.filter-chip:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.filter-chip.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.filter-chip .cat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.filter-chip.active .cat-dot {
    border: 1px solid white;
}

.month-selector .month-input {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

/* Main Content */
.calendar-main {
    padding: 20px 0 100px;
    min-height: calc(100vh - 200px);
}

.results-info {
    margin-bottom: 16px;
    font-size: 14px;
    color: #64748b;
}

.results-info strong {
    color: #1e293b;
}

/* Events List */
.events-list-page {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.event-card {
    display: flex;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.event-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.event-card.highlighted {
    border: 2px solid #f59e0b;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

.event-date-box {
    width: 70px;
    min-width: 70px;
    padding: 16px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
}

.event-date-box .day {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}

.event-date-box .month {
    font-size: 13px;
    font-weight: 500;
    margin-top: 4px;
    text-transform: uppercase;
}

.event-content {
    flex: 1;
    padding: 14px 16px;
    min-width: 0;
}

.event-title {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: #64748b;
}

.event-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.event-meta i {
    font-size: 13px;
}

.event-time i { color: #3b82f6; }
.event-location i { color: #10b981; }
.event-category i { color: #8b5cf6; }

.event-desc {
    margin: 10px 0 0;
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
}

/* Loading */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 12px;
    color: #64748b;
}

/* Load More */
.load-more-container {
    text-align: center;
    padding: 20px 0;
}

.load-more-btn {
    border-radius: 12px;
    padding: 12px 24px;
    font-weight: 500;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.empty-state .empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h5 {
    color: #1e293b;
    font-weight: 600;
    margin-bottom: 8px;
}

/* Responsive */
@media (max-width: 576px) {
    .page-header-section {
        padding: 16px 0 14px;
    }

    .page-header-section .page-title {
        font-size: 18px;
        gap: 8px;
    }

    .page-header-section .page-title i {
        font-size: 20px;
    }

    .page-header-section .page-subtitle {
        font-size: 12px;
    }

    .event-date-box {
        width: 60px;
        min-width: 60px;
    }

    .event-date-box .day {
        font-size: 24px;
    }

    .event-date-box .month {
        font-size: 11px;
    }

    .event-content {
        padding: 12px;
    }

    .event-title {
        font-size: 14px;
    }

    .event-meta {
        gap: 8px;
    }

    .month-selector {
        display: none;
    }
}

/* Calendar Layout */
.calendar-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Calendar Sidebar - Hidden on mobile */
.calendar-sidebar {
    display: none;
}

/* Mini Calendar */
.mini-calendar {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
}

.mini-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.cal-month-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.cal-nav-btn {
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s;
}

.cal-nav-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.mini-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 8px;
}

.mini-calendar-weekdays span {
    font-size: 12px;
    font-weight: 500;
    color: #94a3b8;
    padding: 8px 0;
}

.mini-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    color: #334155;
}

.cal-day:hover {
    background: #f1f5f9;
}

.cal-day.other-month {
    color: #cbd5e1;
}

.cal-day.today {
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 600;
}

.cal-day.selected {
    background: #3b82f6;
    color: white;
    font-weight: 600;
}

.cal-day.has-event::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #f59e0b;
}

.cal-day.selected.has-event::after {
    background: white;
}

.mini-calendar-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

/* Event Legend */
.event-legend {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
    margin-top: 16px;
}

.legend-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px;
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.legend-item:hover {
    background: #f8fafc;
}

.legend-item.active {
    background: #eff6ff;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-text {
    font-size: 13px;
    color: #475569;
}

.legend-count {
    margin-left: auto;
    font-size: 12px;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 10px;
}

/* Events Content */
.events-content {
    flex: 1;
    min-width: 0;
}

/* Desktop Layout */
@media (min-width: 992px) {
    .calendar-layout {
        flex-direction: row;
        align-items: flex-start;
    }

    .calendar-sidebar {
        display: block;
        width: 300px;
        flex-shrink: 0;
        position: sticky;
        top: 20px;
    }

    .events-content {
        flex: 1;
    }

    .events-list-page {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .event-card {
        border-radius: 12px;
    }
}

@media (min-width: 1200px) {
    .calendar-sidebar {
        width: 320px;
    }

    .events-list-page {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}
