.upcoming-events-section {
    padding: 2rem 0;
    background-color: #f5f8fa;
    direction: rtl;
}

.upcoming-events-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.upcoming-events-header {
    text-align: center;
    margin-bottom: 2rem;
    width: 100%;
}

.upcoming-events-header h2 {
    color: #1a237e;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.upcoming-events-header p {
    color: #555;
    font-size: 1rem;
}

.upcoming-events {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    width: 100%;
}

.upcoming-event {
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-height: 160px;
    width: 700px;
    max-width: 100%;
    margin: 0 auto;
}

.upcoming-event:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.upcoming-event.salary {
    background-color: #0D3D10; /* تغيير إلى لون أغمق للتباين الأفضل */
}

.upcoming-event.retirement {
    background-color: #072C6B; /* تغيير إلى لون أغمق للتباين الأفضل */
}

.upcoming-event.citizen {
    background-color: #2E0B59; /* تغيير إلى لون أغمق للتباين الأفضل */
}

.upcoming-event.academic {
    background-color: #7C2200; /* تغيير إلى لون أغمق للتباين الأفضل */
}

.event-date-large {
    text-align: center;
    line-height: 1;
    padding: 0.5rem 1rem;
}

.event-day {
    color: white;
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0;
}

.event-month {
    color: white; /* تغيير من rgba(255, 255, 255, 0.85) إلى white للتباين الأفضل */
    font-size: 1rem;
    margin-top: -3px;
    font-weight: 600; /* إضافة وزن خط أثقل للقراءة الأفضل */
}

.event-content {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.event-title {
    color: white;
    font-size: 1.2rem;
    margin: 0 0 0.5rem;
    font-weight: 600;
}

.event-date-details {
    color: white; /* تحسين التباين */
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 500; /* إضافة وزن خط أثقل للقراءة الأفضل */
}

.countdown-wrapper {
    margin-top: auto;
}

.countdown-title {
    color: white;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.countdown-timer {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

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

.time-value {
    color: white; /* تحسين التباين */
    font-size: 1.2rem;
    font-weight: 700;
}

.time-label {
    color: white; /* تحسين التباين */
    font-size: 0.8rem;
    font-weight: 500; /* إضافة وزن خط أثقل للقراءة الأفضل */
}

.event-link {
    color: white;
    text-decoration: none;
    text-align: center;
    padding: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 500;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

.event-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.no-events {
    text-align: center;
    color: #666;
    padding: 2rem;
    background: #fff;
    border-radius: 10px;
    font-size: 1.1rem;
    width: 100%;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.07);
}

/* استجابة للأجهزة المتوسطة (أقل من 992 بكسل) */
@media (max-width: 992px) {
    .upcoming-events-container {
        max-width: 100%;
        padding: 0 1rem;
    }
    
    .upcoming-event {
        width: 100%;
        max-width: 700px;
    }
}

/* استجابة للأجهزة اللوحية (أقل من 768 بكسل) */
@media (max-width: 767px) {
    .upcoming-events {
        grid-template-columns: 1fr;
        max-width: 100%;
        margin: 0 auto;
    }
    
    .upcoming-event {
        width: 100%;
        min-height: 150px;
    }
    
    .event-day {
        font-size: 1.8rem;
    }
    
    .event-month {
        font-size: 0.9rem;
    }
    
    .event-title {
        font-size: 1.1rem;
    }
}

/* استجابة للموبايل (أقل من 480 بكسل) */
@media (max-width: 480px) {
    .upcoming-events-container {
        padding: 0 0.5rem;
    }
    
    .upcoming-event {
        min-height: 140px;
    }
    
    .event-date-large {
        padding: 0.4rem 0.75rem;
    }
    
    .event-day {
        font-size: 1.5rem;
    }
    
    .event-month {
        font-size: 0.8rem;
    }
    
    .event-content {
        padding: 0.75rem;
    }
    
    .event-title {
        font-size: 0.95rem;
    }
    
    .event-date-details {
        font-size: 0.85rem;
        margin-bottom: 0.75rem;
    }
    
    .countdown-wrapper {
        padding: 0.5rem;
    }
    
    .countdown-title {
        font-size: 0.8rem;
    }
    
    .countdown-timer {
        font-size: 0.8rem;
    }
    
    .time-value {
        font-size: 0.9rem;
    }
    
    .time-label {
        font-size: 0.7rem;
    }
    
    .event-link {
        padding: 0.6rem;
        font-size: 0.8rem;
    }
}

/* استجابة للموبايل الصغير (أقل من 360 بكسل) */
@media (max-width: 360px) {
    .event-day {
        font-size: 1.3rem;
    }
    
    .event-title {
        font-size: 0.85rem;
    }
    
    .event-date-details {
        font-size: 0.75rem;
    }
    
    .time-value {
        font-size: 0.8rem;
    }
    
    .time-label {
        font-size: 0.6rem;
    }
}
