/* Modern Custom Calendar Styles */

.modern-calendar-wrapper {
    min-height: calc(100vh - 80px);
    background: #f8f9fa;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

.calendar-header-new {
    background: white;
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.calendar-month-title {
    word-break: break-word;
}

/* Calendar Grid */
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e9ecef;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem 0.5rem 0 0;
    overflow: hidden;
    margin-bottom: 1px;
    width: 100%;
    max-width: 100%;
}

.weekday {
    background: #f8f9fa;
    padding: 0.875rem 0.5rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.8125rem;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e9ecef;
    border: 1px solid #e9ecef;
    border-radius: 0 0 0.5rem 0.5rem;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
}

.calendar-day-cell {
    background: white;
    min-height: 140px;
    padding: 0.75rem 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    border: 2px solid transparent;
    -webkit-tap-highlight-color: rgba(15, 76, 58, 0.1);
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.calendar-day-cell:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
    z-index: 10;
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.calendar-day-empty {
    background: #fafafa;
    cursor: default;
}

.calendar-day-empty:hover {
    transform: none;
    box-shadow: none;
}

.calendar-day-today {
    background: #e7f5ff !important;
    border-color: #0d6efd !important;
    border-width: 2px !important;
}

.calendar-day-today::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #0d6efd;
}

.calendar-day-today:hover {
    background: #d0ebff !important;
}

/* Day Number */
.day-number {
    font-weight: 600;
    font-size: 1rem;
    color: #212529;
    margin-bottom: 0.25rem;
}

.calendar-day-today .day-number {
    color: #0d6efd;
    font-weight: 700;
    font-size: 1.125rem;
}

.calendar-day-empty .day-number {
    color: transparent;
}


/* Events */
.day-events {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: auto;
}

.day-event {
    background: #0d6efd;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.day-event:hover {
    opacity: 0.9;
    transform: translateX(2px);
}

.day-event.friday-event {
    background: #ff9800;
    color: white;
}

.day-event-more {
    background: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 500;
    text-align: center;
}

/* Responsive - Mobile First Approach */
@media (max-width: 991px) {
    .modern-calendar-wrapper {
        padding: 0;
        min-height: calc(100vh - 60px);
    }
    
    .calendar-header-new {
        position: sticky;
        top: 0;
        z-index: 100;
        background: white;
        border-bottom: 1px solid #e9ecef;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }
    
    [data-theme="dark"] .calendar-header-new {
        background: #111827;
        border-color: rgba(255, 255, 255, 0.08);
    }
    
    .calendar-header-new .container-fluid {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    .calendar-header-new .d-flex {
        flex-wrap: wrap;
        gap: 0.5rem;
        align-items: center;
    }
    
    .calendar-header-new h2 {
        font-size: 1.125rem !important;
        margin-bottom: 0;
        line-height: 1.3;
        word-break: break-word;
    }
    
    .calendar-header-new .badge {
        display: none;
    }
    
    .calendar-header-new .btn {
        min-height: 44px; /* Touch target size */
        min-width: 44px;
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .calendar-header-new .btn-sm {
        min-width: 44px;
        min-height: 44px;
        padding: 0.5rem;
    }
    
    .calendar-header-new #todayBtn {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
        min-width: auto;
    }
    
    .calendar-grid,
    .calendar-weekdays {
        gap: 1px;
        border-radius: 0.5rem;
    }
    
    .calendar-day-cell {
        min-height: 80px;
        padding: 0.5rem 0.25rem;
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(15, 76, 58, 0.1);
    }
    
    .day-number {
        font-size: 0.875rem;
        margin-bottom: 0.25rem;
        font-weight: 600;
    }
    
    .calendar-day-today .day-number {
        font-size: 0.9375rem;
        font-weight: 700;
    }
    
    .day-event {
        font-size: 0.625rem;
        padding: 0.2rem 0.4rem;
        line-height: 1.3;
        margin-bottom: 0.15rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .day-event-more {
        font-size: 0.625rem;
        padding: 0.2rem 0.4rem;
        margin-top: 0.15rem;
    }
    
    .weekday {
        padding: 0.625rem 0.25rem;
        font-size: 0.75rem;
        font-weight: 600;
    }
    
    .card-body {
        padding: 0.75rem !important;
    }
    
    .container-fluid {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    .container-fluid.py-3,
    .container-fluid.py-4 {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }
}

@media (max-width: 576px) {
    .calendar-header-new {
        padding: 0.75rem 0;
    }
    
    .calendar-header-new .container-fluid {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    .calendar-header-new h2 {
        font-size: 1rem !important;
        line-height: 1.2;
    }
    
    .calendar-header-new .btn-group {
        width: 100%;
        display: flex;
        justify-content: flex-end;
        gap: 0.25rem;
    }
    
    .calendar-header-new .btn {
        min-height: 40px;
        min-width: 40px;
        padding: 0.375rem 0.5rem;
        font-size: 0.8125rem;
    }
    
    .calendar-header-new .btn-sm {
        min-width: 40px;
        min-height: 40px;
        padding: 0.375rem;
    }
    
    .calendar-header-new #todayBtn {
        font-size: 0.8125rem;
        padding: 0.375rem 0.75rem;
        flex: 0 0 auto;
    }
    
    .calendar-day-cell {
        min-height: 70px;
        padding: 0.375rem 0.125rem;
    }
    
    .day-number {
        font-size: 0.8125rem;
        margin-bottom: 0.125rem;
    }
    
    .calendar-day-today .day-number {
        font-size: 0.875rem;
    }
    
    .day-event {
        font-size: 0.5625rem;
        padding: 0.15rem 0.3rem;
        line-height: 1.2;
        margin-bottom: 0.1rem;
    }
    
    .day-event-more {
        font-size: 0.5625rem;
        padding: 0.15rem 0.3rem;
    }
    
    .weekday {
        padding: 0.5rem 0.125rem;
        font-size: 0.6875rem;
    }
    
    .card-body {
        padding: 0.5rem !important;
    }
    
    .container-fluid {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
}

@media (max-width: 375px) {
    .calendar-header-new h2 {
        font-size: 0.9375rem !important;
    }
    
    .calendar-header-new .btn {
        min-height: 36px;
        min-width: 36px;
        padding: 0.25rem 0.375rem;
        font-size: 0.75rem;
    }
    
    .calendar-day-cell {
        min-height: 65px;
        padding: 0.25rem 0.1rem;
    }
    
    .day-number {
        font-size: 0.75rem;
    }
    
    .day-event {
        font-size: 0.5rem;
        padding: 0.1rem 0.25rem;
    }
    
    .weekday {
        padding: 0.375rem 0.1rem;
        font-size: 0.625rem;
    }
}

/* Dark Mode Styles */
[data-theme="dark"] .modern-calendar-wrapper {
    background: #0f1419;
}

[data-theme="dark"] .calendar-header-new {
    background: #111827;
    border-color: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
}

[data-theme="dark"] .calendar-weekdays {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .weekday {
    background: #111827;
    color: #94a3b8;
}

[data-theme="dark"] .calendar-grid {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .calendar-day-cell {
    background: #1a1f2e;
    color: #e2e8f0;
}

[data-theme="dark"] .calendar-day-cell:hover {
    background: #1f2937;
    border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .calendar-day-empty {
    background: #0f1419;
}

[data-theme="dark"] .calendar-day-today {
    background: rgba(15, 76, 58, 0.25) !important;
    border-color: rgba(15, 76, 58, 0.6) !important;
}

[data-theme="dark"] .calendar-day-today::before {
    background: rgba(15, 76, 58, 0.8);
}

[data-theme="dark"] .calendar-day-today:hover {
    background: rgba(15, 76, 58, 0.35) !important;
}

[data-theme="dark"] .day-number {
    color: #e2e8f0;
}

[data-theme="dark"] .calendar-day-today .day-number {
    color: #60d4a8;
}

[data-theme="dark"] .day-event {
    background: rgba(15, 76, 58, 0.7) !important;
    color: #e2e8f0 !important;
    border: 1px solid rgba(15, 76, 58, 0.9);
}

[data-theme="dark"] .day-event:hover {
    background: rgba(15, 76, 58, 0.85) !important;
}

[data-theme="dark"] .day-event.friday-event {
    background: rgba(197, 160, 89, 0.7) !important;
    color: #e2e8f0 !important;
    border: 1px solid rgba(197, 160, 89, 0.9);
}

[data-theme="dark"] .day-event.friday-event:hover {
    background: rgba(197, 160, 89, 0.85) !important;
}

[data-theme="dark"] .day-event-more {
    background: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
}


