/* Event Calendar Styles */
.event-calendar-container {
    max-width: 100%;
    margin: 20px 0;
    font-family: inherit;
    direction: rtl;
}

/* Calendar Header */
.event-calendar-header {
    margin-bottom: 20px;
}

.event-calendar-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
}

.event-calendar-month-display {
    text-align: center;
    flex: 1;
    min-width: 200px;
}

.gregorian-month {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.hijri-month {
    font-size: 1rem;
    color: #666;
    font-style: italic;
}

.event-calendar-prev,
.event-calendar-next {
    min-width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.event-calendar-prev:hover,
.event-calendar-next:hover {
    transform: scale(1.1);
}

/* Calendar Grid */
.event-calendar-grid {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.event-calendar-day-headers {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.event-calendar-day-header {
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    color: #495057;
    border-left: 1px solid #dee2e6;
    font-size: 0.875rem;
}

.event-calendar-day-header:first-child {
    border-left: none;
}

.event-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

/* Calendar Day Cells */
.event-calendar-day {
    min-height: 80px;
    border-left: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.event-calendar-day:first-child,
.event-calendar-day:nth-child(7n+1) {
    border-left: none;
}

.event-calendar-day:hover {
    background-color: #f8f9fa;
}

.event-calendar-day.empty {
    background-color: #f8f9fa;
    cursor: default;
}

.event-calendar-day.today {
    background-color: #e3f2fd;
    border: 2px solid #2196f3;
}

.event-calendar-day.has-events {
    background-color: #fff3e0;
}

.event-calendar-day.has-events:hover {
    background-color: #ffe0b2;
}

/* Day Content */
.day-content {
    padding: 8px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 2px;
}

.gregorian-date {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    line-height: 1;
}

.hijri-date {
    font-size: 0.875rem;
    color: #666;
    line-height: 1;
}

.hijri-month-short {
    font-size: 0.75rem;
    color: #999;
    line-height: 1;
}

/* Event Indicators */
.event-indicator {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.event-indicator .fas {
    color: #ff9800;
    font-size: 0.75rem;
}

.event-count {
    background: #ff9800;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Event Data (Hidden) */
.event-data {
    display: none;
}

/* Tooltip */
.event-calendar-tooltip {
    position: absolute;
    background: #333;
    color: white;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.875rem;
    max-width: 300px;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    pointer-events: none;
}

.event-calendar-tooltip::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.tooltip-content {
    line-height: 1.4;
}

.tooltip-event {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #555;
}

.tooltip-event:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.tooltip-event-title {
    font-weight: 600;
    margin-bottom: 4px;
    color: #fff;
}

.tooltip-event-details {
    font-size: 0.8rem;
    color: #ccc;
}

.tooltip-event-time,
.tooltip-event-location {
    display: block;
    margin-bottom: 2px;
}

.tooltip-event-link {
    color: #81c784;
    text-decoration: none;
    font-size: 0.8rem;
}

.tooltip-event-link:hover {
    color: #a5d6a7;
    text-decoration: underline;
}

/* Loading Indicator */
.event-calendar-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.event-calendar-loading .fas {
    margin-left: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .event-calendar-navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    .event-calendar-month-display {
        order: -1;
        margin-bottom: 10px;
    }
    
    .event-calendar-day {
        min-height: 60px;
    }
    
    .day-content {
        padding: 4px;
        gap: 1px;
    }
    
    .gregorian-date {
        font-size: 1rem;
    }
    
    .hijri-date {
        font-size: 0.75rem;
    }
    
    .hijri-month-short {
        font-size: 0.65rem;
    }
    
    .event-calendar-tooltip {
        max-width: 250px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .event-calendar-day {
        min-height: 50px;
    }
    
    .day-content {
        padding: 2px;
    }
    
    .gregorian-date {
        font-size: 0.9rem;
    }
    
    .hijri-date {
        font-size: 0.7rem;
    }
    
    .hijri-month-short {
        display: none; /* Hide on very small screens */
    }
    
    .event-calendar-day-header {
        padding: 8px 4px;
        font-size: 0.75rem;
    }
}

/* RTL Specific Adjustments */
[dir="rtl"] .event-calendar-container {
    direction: rtl;
}

[dir="rtl"] .event-calendar-navigation {
    direction: rtl;
}

[dir="rtl"] .event-calendar-prev {
    order: 2;
}

[dir="rtl"] .event-calendar-next {
    order: 0;
}

[dir="rtl"] .event-calendar-prev i::before {
    content: "\f054"; /* Right chevron for RTL */
}

[dir="rtl"] .event-calendar-next i::before {
    content: "\f053"; /* Left chevron for RTL */
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .event-calendar-day {
        border-width: 2px;
    }
    
    .event-calendar-day.has-events {
        background-color: #fff9c4;
    }
    
    .event-calendar-tooltip {
        background: #000;
        border: 2px solid #fff;
    }
}

/* Print Styles */
@media print {
    .event-calendar-navigation {
        display: none;
    }
    
    .event-calendar-tooltip {
        display: none;
    }
    
    .event-calendar-day {
        break-inside: avoid;
    }
}

