/* Calendar Page Styles */
.calendar-page-content {
    padding: 2rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn-add-event {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.btn-add-event:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.view-switcher {
    display: flex;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.view-btn {
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.view-btn:not(:last-child) {
    border-right: 1px solid var(--border-color);
}

.view-btn:hover {
    background: var(--bg-secondary);
}

.view-btn.active {
    background: var(--primary-color);
    color: white;
}

/* Calendar Container */
.calendar-container {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.calendar-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.calendar-header h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    flex: 1;
    text-align: center;
}

.btn-nav {
    width: 36px;
    height: 36px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
}

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

.btn-today {
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

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

/* Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.weekday {
    background: var(--bg-secondary);
    padding: 1rem;
    text-align: center;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    border-bottom: 2px solid var(--border-color);
}

.calendar-day {
    background: var(--bg-primary);
    padding: 0.75rem;
    min-height: 100px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    color: var(--text-primary);
}

.calendar-day:hover {
    background: var(--bg-secondary);
}

.calendar-day.other-month {
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
}

.calendar-day.today {
    background: var(--primary-light);
    color: var(--primary-color);
    font-weight: 700;
}

.calendar-day.today::before {
    content: '';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 8px;
    height: 8px;
    background: var(--danger-color);
    border-radius: 50%;
}

/* Calendar Events */
.event {
    margin-top: 0.25rem;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 500;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.event-blue {
    background: var(--info-color);
}

.event-green {
    background: var(--success-color);
}

.event-orange {
    background: var(--warning-color);
}

.event-purple {
    background: #8b5cf6;
}

.event-red {
    background: var(--danger-color);
}

/* Schedule Section */
.schedule-section {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.schedule-section h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.schedule-item {
    display: flex;
    gap: 1.5rem;
    padding: 1.25rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s;
}

.schedule-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

.schedule-item.completed {
    opacity: 0.6;
    border-left-color: var(--success-color);
}

.schedule-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.schedule-time .time {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.schedule-time .duration {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.schedule-content {
    flex: 1;
}

.schedule-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.schedule-header h4 {
    font-size: 1rem;
    color: var(--text-primary);
    margin: 0;
}

.schedule-badge {
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    color: white;
}

.schedule-badge.orange {
    background: var(--warning-color);
}

.schedule-badge.blue {
    background: var(--info-color);
}

.schedule-badge.green {
    background: var(--success-color);
}

.schedule-content p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.schedule-meta {
    display: flex;
    gap: 1rem;
}

.schedule-meta span {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.btn-join {
    padding: 0.625rem 1.25rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-join:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.schedule-item.completed .btn-join {
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    cursor: not-allowed;
}

/* Upcoming Events */
.upcoming-section {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid var(--border-color);
}

.upcoming-section h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.upcoming-list {
    display: grid;
    gap: 1rem;
}

.upcoming-item {
    display: flex;
    gap: 1.5rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    transition: all 0.3s;
}

.upcoming-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

.upcoming-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: var(--primary-light);
    border-radius: 8px;
}

.upcoming-date .day {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.upcoming-date .month {
    font-size: 0.75rem;
    color: var(--primary-color);
}

.upcoming-content {
    flex: 1;
}

.upcoming-content h4 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.upcoming-content p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.time-left {
    font-size: 0.75rem;
    color: var(--warning-color);
    font-weight: 600;
}

/* Dark Theme */
body.dark-theme .calendar-container,
body.dark-theme .schedule-section,
body.dark-theme .upcoming-section {
    background: var(--bg-primary);
}

body.dark-theme .calendar-day {
    background: var(--bg-primary);
}

body.dark-theme .calendar-day:hover {
    background: var(--bg-secondary);
}

body.dark-theme .calendar-day.today {
    background: rgba(99, 102, 241, 0.1);
}

/* Responsive */
@media (max-width: 1024px) {
    .schedule-item {
        flex-direction: column;
    }
    
    .schedule-time {
        flex-direction: row;
        gap: 1rem;
    }
    
    .btn-join {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .calendar-page-content {
        padding: 1rem;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .view-switcher,
    .btn-add-event {
        width: 100%;
    }
    
    .calendar-container {
        padding: 1rem;
    }
    
    .calendar-header {
        flex-wrap: wrap;
    }
    
    .calendar-header h2 {
        order: -1;
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .calendar-day {
        min-height: 60px;
        font-size: 0.875rem;
    }
    
    .event {
        display: none;
    }
    
    .calendar-day.today .event:first-child {
        display: block;
    }
    
    .upcoming-item {
        flex-direction: column;
        text-align: center;
    }
    
    .upcoming-date {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .weekday {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
    
    .calendar-day {
        padding: 0.5rem;
        min-height: 50px;
    }
    
    .schedule-meta {
        flex-direction: column;
        gap: 0.25rem;
    }
}