/* calendars.css - Calendar-specific styles */

/* Calendar Tabs */
.calendar-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.calendar-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 2px solid #E0E0E0;
    background-color: #FFFFFF;
    color: #343A40;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.calendar-tab i {
    font-size: 1.1rem;
}

.calendar-tab:hover {
    border-color: #703ABD;
    background-color: #f0f0f0;
    transform: translateY(-2px);
}

.calendar-tab.active {
    background-color: #703ABD;
    border-color: #703ABD;
    color: #FFFFFF;
    box-shadow: 0 4px 8px rgba(112, 58, 189, 0.3);
}

/* Calendar Container */
.calendar-container {
    border: none;
    transition: box-shadow 0.3s ease;
    background: linear-gradient(to bottom, #fafafa 0%, #ffffff 100%);
}

.calendar-container:hover {
    box-shadow: 0 8px 24px rgba(112, 58, 189, 0.15) !important;
}

.calendar-header {
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.calendar-header h3 {
    color: #703ABD;
    font-weight: 700;
    font-size: 1.5rem;
}

.calendar-header button {
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.3s ease;
}

.calendar-header button:hover {
    background-color: #703ABD;
    color: white;
    transform: scale(1.1);
}

/* Weekday Headers */
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    margin-bottom: 0;
    background: linear-gradient(135deg, #703ABD 0%, #50208C 100%);
    border-radius: 10px 10px 0 0;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.weekday {
    padding: 14px;
    text-align: center;
    font-weight: 700;
    color: #ffffff;
    border: none;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Calendar Days Grid */
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    border: 1px solid #e0e0e0;
    border-radius: 0 0 10px 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.calendar-day {
    aspect-ratio: 1;
    padding: 12px 8px;
    border: 1px solid #e8e8e8;
    text-align: center;
    cursor: pointer;
    position: relative;
    background-color: #FFFFFF;
    transition: all 0.2s ease;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.calendar-day:hover {
    background: linear-gradient(135deg, #f3f0ff 0%, #e9d5ff 100%);
    transform: scale(1.05);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(112, 58, 189, 0.2);
}

@media (hover: none) and (pointer: coarse) {
    .calendar-day:active {
        background: linear-gradient(135deg, #f3f0ff 0%, #e9d5ff 100%);
        transform: scale(0.98);
    }
}

.calendar-day.other-month {
    background-color: #f8f9fa;
    color: #ccc;
}

.calendar-day.today {
    background: linear-gradient(135deg, #703ABD, #50208C);
    color: white;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(112, 58, 189, 0.4);
    transform: scale(1.02);
}

.calendar-day.today .day-number {
    color: white;
    font-weight: 800;
}

.calendar-day.selected {
    box-shadow: inset 0 0 0 3px #703ABD;
    background-color: #f3f0ff;
    transform: scale(1.03);
}

.day-number {
    font-weight: 700;
    color: #2d3748;
    font-size: 1rem;
    margin-bottom: 6px;
    font-family: 'Poppins', sans-serif;
}

/* Event Indicators */
.day-events {
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: flex-start;
    align-items: center;
    flex: 1;
    margin-top: 4px;
}

/* Event Titles in Calendar Boxes */
.event-title {
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    color: #1a1a1a !important;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 2px 4px;
    border-radius: 3px;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    text-align: center;
    line-height: 1.2;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.calendar-day.today .event-title {
    background-color: rgba(255, 255, 255, 0.95);
    color: #1a1a1a !important;
    font-weight: 700 !important;
}

.calendar-day.selected .event-title {
    background-color: rgba(255, 255, 255, 0.95);
    color: #1a1a1a !important;
}

.event-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.event-dot.food {
    background-color: #FF6B6B;
}

.event-dot.transportation {
    background-color: #4ECDC4;
}

.event-dot.volunteer {
    background-color: #95E1D3;
}

.event-dot.activities {
    background-color: #FFD93D;
}

.event-dot.maintenance {
    background-color: #6C63FF;
}

/* Sidebar */
.calendar-sidebar {
    border: 1px solid #e0e0e0;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.calendar-sidebar h4 {
    color: #703ABD;
    font-weight: 700;
    font-size: 1.1rem;
    border-bottom: 2px solid #E9D5FF;
    padding-bottom: 10px;
}

.events-list {
    max-height: 400px;
    overflow-y: auto;
}

.events-list::-webkit-scrollbar {
    width: 6px;
}

.events-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.events-list::-webkit-scrollbar-thumb {
    background: #703ABD;
    border-radius: 10px;
}

.event-card {
    padding: 12px;
    margin-bottom: 10px;
    border-left: 4px solid #703ABD;
    background-color: #f8f9fa;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.event-card:hover {
    background-color: #E9D5FF;
    transform: translateX(4px);
}

.event-card.food {
    border-left-color: #FF6B6B;
}

.event-card.transportation {
    border-left-color: #4ECDC4;
}

.event-card.volunteer {
    border-left-color: #95E1D3;
}

.event-card.activities {
    border-left-color: #FFD93D;
}

.event-card.maintenance {
    border-left-color: #6C63FF;
}

.event-card h6 {
    margin: 0 0 4px 0;
    color: #703ABD;
    font-weight: 700;
}

.event-card p {
    margin: 0;
    font-size: 0.85rem;
    color: #666;
}

.event-card .event-time {
    font-size: 0.8rem;
    color: #999;
    margin-top: 4px;
}

.event-card .event-location {
    font-size: 0.8rem;
    color: #999;
}

/* Legend */
.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: inline-block;
}

/* Modal Styling */
.modal-header {
    background-color: #E9D5FF;
    border-bottom: 2px solid #703ABD;
}

.modal-header .modal-title {
    color: #703ABD;
    font-weight: 700;
}

.modal-body .form-label {
    color: #703ABD;
    font-weight: 600;
}

.form-select:focus,
.form-control:focus {
    border-color: #703ABD;
    box-shadow: 0 0 0 0.2rem rgba(112, 58, 189, 0.25);
}

/* Button Styling */
.btn-primary {
    background-color: #703ABD;
    border-color: #703ABD;
}

.btn-primary:hover {
    background-color: #50208C;
    border-color: #50208C;
}

/* Desktop Styles - Ensure proper sizing */
@media (min-width: 769px) {
    .calendar-day {
        min-height: 120px;
        padding: 12px 8px;
    }

    .calendar-container {
        padding: 1.5rem !important;
    }

    .calendar-header h3 {
        font-size: 1.5rem;
    }

    .weekday {
        padding: 14px;
        font-size: 0.95rem;
    }

    .calendar-sidebar {
        position: sticky;
        top: 100px;
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .calendars-section {
        padding: 1.5rem 0 !important;
    }

    .calendar-container {
        padding: 1rem !important;
        margin-bottom: 1rem;
    }

    /* Force calendar grid to be responsive */
    .calendar-days {
        grid-template-columns: repeat(7, 1fr);
        width: 100%;
    }

    .calendar-tabs {
        gap: 6px;
        margin-bottom: 15px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 5px;
    }

    .calendar-tabs::-webkit-scrollbar {
        height: 4px;
    }

    .calendar-tab {
        padding: 8px 14px;
        font-size: 0.85rem;
        flex-shrink: 0;
    }

    .calendar-tab span {
        display: none;
    }

    .calendar-tab.active span {
        display: inline;
    }

    .calendar-header {
        padding-bottom: 10px;
        margin-bottom: 15px;
    }

    .calendar-header h3 {
        font-size: 1.1rem;
        padding: 0 10px;
    }

    .calendar-header button {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }

    .calendar-day {
        min-height: 60px !important;
        padding: 4px 2px !important;
        aspect-ratio: 1;
        max-height: none;
        height: auto;
        width: 100%;
    }

    .calendar-days {
        gap: 0;
        width: 100%;
    }
    
    .event-title {
        font-size: 0.6rem !important;
        padding: 1px 2px;
        line-height: 1.1;
    }

    .day-number {
        font-size: 0.75rem;
        margin-bottom: 2px;
    }

    .event-dot {
        width: 4px;
        height: 4px;
    }

    .calendar-sidebar {
        position: static;
        margin-top: 20px;
        padding: 1rem !important;
    }

    .calendar-sidebar h4 {
        font-size: 0.95rem;
        padding-bottom: 8px;
    }

    .weekday {
        padding: 6px 2px;
        font-size: 0.7rem;
        letter-spacing: 0;
    }

    .calendar-weekdays {
        border-radius: 8px 8px 0 0;
    }

    .calendar-days {
        border-radius: 0 0 8px 8px;
    }

    .event-card {
        padding: 10px;
        margin-bottom: 8px;
    }

    .event-card h6 {
        font-size: 0.9rem;
    }

    .event-card p {
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .calendars-section {
        padding: 1rem 0 !important;
    }

    .calendar-container {
        padding: 0.75rem !important;
    }

    .calendar-tabs {
        gap: 4px;
    }

    .calendar-tab {
        padding: 6px 10px;
        font-size: 0.75rem;
        border-radius: 20px;
    }

    .calendar-tab i {
        font-size: 0.85rem;
    }

    .calendar-header h3 {
        font-size: 0.95rem;
        padding: 0 8px;
    }

    .calendar-header button {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .calendar-day {
        min-height: 45px !important;
        padding: 3px 1px !important;
        aspect-ratio: 1;
        max-height: none;
        height: auto;
        width: 100%;
    }

    .calendar-days {
        gap: 0;
        width: 100%;
    }

    .day-events {
        gap: 2px;
        margin-top: 2px;
    }

    .day-number {
        font-size: 0.65rem;
        margin-bottom: 1px;
    }

    .event-title {
        font-size: 0.55rem !important;
        padding: 1px;
        line-height: 1;
    }

    .weekday {
        padding: 5px 1px;
        font-size: 0.65rem;
    }

    .calendar-sidebar {
        padding: 0.75rem !important;
    }

    .calendar-sidebar h4 {
        font-size: 0.85rem;
    }

    .event-card {
        padding: 8px;
        margin-bottom: 6px;
    }

    .event-card h6 {
        font-size: 0.85rem;
    }

    .event-card p {
        font-size: 0.75rem;
    }
}

/* Animation for events appearing */
@keyframes slideInEvent {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.event-card {
    animation: slideInEvent 0.3s ease forwards;
}

.event-card:nth-child(1) { animation-delay: 0.05s; }
.event-card:nth-child(2) { animation-delay: 0.1s; }
.event-card:nth-child(3) { animation-delay: 0.15s; }
.event-card:nth-child(4) { animation-delay: 0.2s; }

/* Text hover effect for sidebar links */
.text-light-hover {
    color: #f8f9fa;
    text-decoration: none;
    transition: color 0.3s ease;
}

.text-light-hover:hover {
    color: #703ABD;
}
