﻿/* ===========================
   Activities 頁面專用樣式
   =========================== */

/* 活動瀏覽頁面專用樣式 */
.activities-header {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(102, 126, 234, 0.05) 100%);
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.filter-sidebar {
    background: var(--bg-primary);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.filter-section {
    margin-bottom: 2rem;
}

    .filter-section h6 {
        color: var(--text-primary);
        font-weight: 600;
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
        border-bottom: 2px solid rgba(102, 126, 234, 0.2);
    }

.filter-option {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
}

    .filter-option input[type="radio"],
    .filter-option input[type="checkbox"] {
        margin-right: 0.75rem;
        transform: scale(1.2);
    }

    .filter-option label {
        cursor: pointer;
        margin-bottom: 0;
        flex: 1;
    }

    .filter-option:hover {
        background: rgba(102, 126, 234, 0.05);
        padding: 0.25rem;
        border-radius: 8px;
    }

.search-box {
    position: relative;
    margin-bottom: 1.5rem;
}

    .search-box input {
        width: 100%;
        padding: 0.75rem 1rem;
        border: 2px solid rgba(102, 126, 234, 0.2);
        border-radius: 25px;
        font-size: 0.95rem;
        transition: all 0.3s ease;
    }

        .search-box input:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
        }

.search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .search-btn:hover {
        transform: translateY(-50%) scale(1.1);
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    }

.results-header {
    background: var(--bg-primary);
    border-radius: 10px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.view-toggle {
    display: flex;
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 25px;
    overflow: hidden;
}

    .view-toggle button {
        background: transparent;
        border: none;
        padding: 0.5rem 1rem;
        cursor: pointer;
        transition: all 0.3s ease;
        min-width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

        .view-toggle button.active {
            background: var(--primary-gradient);
            color: white;
        }

.activity-grid {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

    .activity-grid.card-view {
        grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    }

    .activity-grid.list-view {
        grid-template-columns: 1fr;
    }

.activity-card {
    background: var(--bg-primary);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

    .activity-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 4px;
        height: 100%;
        background: var(--primary-gradient);
        transform: scaleY(0);
        transform-origin: top;
        transition: transform 0.3s ease;
    }

    .activity-card:hover {
        transform: translateY(-5px);
        box-shadow: var(--shadow-xl);
    }

        .activity-card:hover::before {
            transform: scaleY(1);
        }

    .activity-card.list-view {
        display: flex;
        align-items: center;
        gap: 2rem;
    }

.activity-date {
    min-width: 80px;
    text-align: center;
    background: var(--primary-gradient);
    color: white;
    border-radius: 12px;
    padding: 1rem 0.5rem;
    margin-bottom: 1rem;
}

.activity-card.list-view .activity-date {
    margin-bottom: 0;
    flex-shrink: 0;
}

.activity-date .month {
    font-size: 0.875rem;
    font-weight: 600;
    opacity: 0.9;
    margin-bottom: 0.25rem;
}

.activity-date .day {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}

.activity-content {
    flex: 1;
}

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.activity-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.activity-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.activity-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: 500;
}

    .activity-badge.type-school {
        background: rgba(40, 167, 69, 0.1);
        color: #28a745;
        border: 1px solid rgba(40, 167, 69, 0.2);
    }

    .activity-badge.type-custom {
        background: rgba(102, 126, 234, 0.1);
        color: #667eea;
        border: 1px solid rgba(102, 126, 234, 0.2);
    }

    .activity-badge.status-full {
        background: rgba(220, 53, 69, 0.1);
        color: #dc3545;
        border: 1px solid rgba(220, 53, 69, 0.2);
    }

    .activity-badge.has-food {
        background: rgba(255, 193, 7, 0.1);
        color: #ffc107;
        border: 1px solid rgba(255, 193, 7, 0.2);
    }

.activity-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.activity-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.activity-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .activity-meta-item i {
        width: 16px;
        color: var(--primary-color);
    }

.activity-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.registration-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

    .registration-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
        color: white;
    }

    .registration-btn:disabled,
    .registration-btn.disabled {
        background: #6c757d;
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }

.secondary-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    background: transparent;
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: var(--primary-color);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .action-btn:hover {
        background: var(--primary-gradient);
        color: white;
        border-color: transparent;
    }

.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
}

.pagination {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.page-btn {
    background: var(--bg-primary);
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: var(--text-primary);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

    .page-btn:hover,
    .page-btn.active {
        background: var(--primary-gradient);
        color: white;
        border-color: transparent;
    }

    .page-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    background: var(--bg-primary);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: var(--shadow-xl);
    text-align: center;
}

/* 空狀態樣式 */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

    .empty-state i {
        font-size: 4rem;
        margin-bottom: 1rem;
        opacity: 0.5;
    }

    .empty-state h4 {
        margin-bottom: 1rem;
    }

    .empty-state p {
        margin-bottom: 2rem;
        max-width: 500px;
        margin-left: auto;
        margin-right: auto;
    }

/* 篩選標籤 */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.filter-tag {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 15px;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .filter-tag .remove-filter {
        background: none;
        border: none;
        color: var(--primary-color);
        cursor: pointer;
        padding: 0;
        width: 16px;
        height: 16px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

        .filter-tag .remove-filter:hover {
            background: var(--primary-color);
            color: white;
        }

/* ===========================
   行事曆檢視樣式
   =========================== */

.calendar-grid {
    background: var(--bg-primary);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--primary-gradient);
    color: white;
}

    .calendar-header .calendar-cell {
        padding: 1rem;
        text-align: center;
        font-weight: 600;
        font-size: 0.9rem;
    }

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

.calendar-cell {
    border: 1px solid #e9ecef;
    min-height: 120px;
    position: relative;
    background: var(--bg-primary);
    transition: all 0.3s ease;
}

    .calendar-cell:hover {
        background: rgba(102, 126, 234, 0.05);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    .calendar-cell.other-month {
        background: #f8f9fa;
        color: #6c757d;
    }

    .calendar-cell.today {
        background: rgba(102, 126, 234, 0.1);
        border-color: var(--primary-color);
        box-shadow: inset 0 0 0 2px var(--primary-color);
    }

    .calendar-cell.has-events {
        cursor: pointer;
    }

.calendar-date {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.calendar-cell.today .calendar-date {
    background: var(--primary-color);
    color: white;
}

.calendar-events {
    position: absolute;
    top: 40px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    overflow: hidden;
}

.calendar-event {
    background: rgba(102, 126, 234, 0.8);
    color: white;
    font-size: 0.75rem;
    padding: 2px 6px;
    margin: 1px 0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

    .calendar-event:hover {
        background: var(--primary-color);
        transform: scale(1.02);
        z-index: 10;
        position: relative;
    }

    .calendar-event.school-event {
        background: rgba(40, 167, 69, 0.8);
    }

        .calendar-event.school-event:hover {
            background: #28a745;
        }

    .calendar-event.custom-event {
        background: rgba(102, 126, 234, 0.8);
    }

        .calendar-event.custom-event:hover {
            background: #667eea;
        }

.calendar-event-more {
    background: rgba(108, 117, 125, 0.8);
    color: white;
    font-size: 0.7rem;
    text-align: center;
    cursor: pointer;
}

    .calendar-event-more:hover {
        background: #6c757d;
    }

/* 行事曆導航 */
.calendar-navigation {
    background: var(--bg-primary);
    border-radius: 10px;
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.calendar-nav-buttons .btn {
    margin-right: 0.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

#calendarTitle {
    color: var(--text-primary);
    font-weight: 600;
}

/* 圖例樣式 */
.calendar-legend {
    background: var(--bg-primary);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 0.5rem;
    display: inline-block;
}

    .legend-dot.school-event {
        background: rgba(40, 167, 69, 0.8);
    }

    .legend-dot.custom-event {
        background: rgba(102, 126, 234, 0.8);
    }

    .legend-dot.today-marker {
        background: var(--primary-color);
    }

/* 模態框內活動項目樣式 */
.day-activity-item {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

    .day-activity-item:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }

    .day-activity-item.school-event {
        border-left-color: #28a745;
    }

    .day-activity-item.custom-event {
        border-left-color: #667eea;
    }

.activity-time {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.activity-type-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: 500;
}

    .activity-type-badge.school {
        background: rgba(40, 167, 69, 0.1);
        color: #28a745;
    }

    .activity-type-badge.custom {
        background: rgba(102, 126, 234, 0.1);
        color: #667eea;
    }

/* ===========================
   行事曆通知樣式
   =========================== */

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

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

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.calendar-notification {
    backdrop-filter: blur(10px);
    border-left: 4px solid currentColor;
}

    .calendar-notification.alert-success {
        background: rgba(40, 167, 69, 0.9);
        color: white;
        border-left-color: #28a745;
    }

    .calendar-notification.alert-danger {
        background: rgba(220, 53, 69, 0.9);
        color: white;
        border-left-color: #dc3545;
    }

    .calendar-notification.alert-info {
        background: rgba(102, 126, 234, 0.9);
        color: white;
        border-left-color: #667eea;
    }

/* ===========================
   響應式設計
   =========================== */

@media (max-width: 768px) {
    .activity-grid.card-view {
        grid-template-columns: 1fr;
    }

    .activity-card.list-view {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .results-info {
        flex-direction: column;
        align-items: flex-start;
    }

    .sort-controls {
        width: 100%;
        justify-content: space-between;
    }

    .activity-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .activity-actions {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .secondary-actions {
        justify-content: center;
    }

    /* 行事曆響應式 */
    .calendar-cell {
        min-height: 80px;
    }

    .calendar-date {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }

    .calendar-events {
        top: 32px;
    }

    .calendar-event {
        font-size: 0.7rem;
        padding: 1px 4px;
    }

    .calendar-navigation {
        padding: 0.75rem 1rem;
    }

    .calendar-nav-buttons .btn {
        font-size: 0.8rem;
        padding: 0.375rem 0.75rem;
    }

    #calendarTitle {
        font-size: 1.25rem;
        text-align: center;
        margin-top: 0.5rem;
    }

    .calendar-navigation .d-flex {
        flex-direction: column;
        align-items: center;
    }
}
