:root {
    --primary-color: #1b264f;
    --secondary-color: #3a4e91;
    --accent-color: #ff6b6b;
    --accent-gradient: linear-gradient(135deg, #ff6b6b, #ff8e6b);
    --dark-bg: #0f172a;
    --card-bg: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.18);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 15px 35px rgba(0, 0, 0, 0.2);
    --shadow-heavy: 0 25px 50px rgba(0, 0, 0, 0.3);
}

/* Enhanced Loading Screen */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--dark-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Modern Events Section */
.events-section {
    min-height: 100vh;
    background:
        radial-gradient(ellipse at top left, rgba(59, 130, 246, 0.15), transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(139, 92, 246, 0.15), transparent 50%),
        linear-gradient(135deg, var(--dark-bg) 0%, #1e293b 100%);
    padding: 6rem 0 4rem;
    position: relative;
    overflow: hidden;
}

.events-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Ccircle cx='30' cy='30' r='1'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    z-index: 0;
}

.section-header {
    text-align: center;
    margin-bottom: 5rem;
    position: relative;
    z-index: 1;
}

.section-title {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 4px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

.section-subtitle {
    font-size: 1.3rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Modern Events Grid */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 2.5rem;
    position: relative;
    z-index: 1;
    align-items: stretch;
}

/* Enhanced Event Card Layout with Fixed Positioning */
.event-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 0;
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 580px;
    /* ارتفاع أدنى لضمان ظهور جميع العناصر */
}

.event-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--accent-gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s ease;
    z-index: 2;
}

.event-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: var(--shadow-heavy);
    border-color: rgba(255, 255, 255, 0.3);
}

.event-card:hover::before {
    transform: scaleX(1);
}

/* Fixed Image Container */
.event-image {
    height: 220px;
    width: 100%;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.event-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.event-card:hover .event-image img {
    transform: scale(1.1);
}

.event-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
}

/* Category Badge - Fixed Position */
.event-category {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--accent-color);
    color: white;
    padding: 0.4rem 1.2rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 3;
}

/* Content Area - Fixed Structure */
.event-content {
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    /* استخدام gap للتباعد بدلاً من margin */
}

/* Fixed Title with Consistent Height */
.event-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    transition: color 0.3s ease;
    min-height: 4.2rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    /* إزالة الهامش السفلي */
}

.event-card:hover .event-title {
    color: var(--accent-color);
}

/* Fixed Meta Information */
.event-meta {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    flex-shrink: 0;
    margin: 0;
    /* إزالة الهامش السفلي */
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    min-height: 2rem;
}

.meta-icon {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* Fixed Description with Consistent Height */
.event-description {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    min-height: 4.8rem;
    margin: 0;
    /* إزالة الهامش السفلي */
}

/* Fixed Footer Layout */
.event-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    /* هذا يضمن بقاء الزر في الأسفل */
    flex-shrink: 0;
    padding-top: 1rem;
    /* إضافة مسافة علوية */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    /* خط فاصل */
}

.event-date-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 80px;
    text-align: center;
}

.event-button {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 0.8rem 1.8rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    min-width: 140px;
    justify-content: center;
}

.event-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

/* Enhanced Event Modal with Professional Gallery */
.event-modal {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgb(15 23 42 / 47%);
    backdrop-filter: blur(10px);
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.event-modal.active {
    opacity: 1;
    visibility: visible;
}

.event-modal-content {
    width: 100%;
    max-width: 800px; /* تم التخفيض لجعل النافذة أصغر قليلاً */
    max-height: 95vh;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: 28px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-heavy);
    overflow: hidden;
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    display: flex;
    flex-direction: column;
}

.event-modal.active .event-modal-content {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: static;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    align-self: flex-end;
    margin-bottom: 1rem;
    z-index: 11;
}

.modal-close:hover {
    background: var(--accent-color);
    transform: rotate(90deg);
}

/* Enhanced Modal Header */
.modal-header-event {
    padding: 2.5rem 2.5rem 1.5rem;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.modal-header-event-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
}

.modal-header-event-main {
    flex: 1;
}

.modal-header-event-meta {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    min-width: 200px;
    text-align: right;
}

.modal-category {
    background: var(--accent-gradient);
    color: white;
    padding: 0.3rem 1rem;
    /* Reduced padding */
    border-radius: 16px;
    /* Slightly smaller radius */
    font-size: 0.75rem;
    /* Smaller font size */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.modal-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.3;
    margin: 0;
}

.modal-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.modal-meta-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.modal-meta-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.modal-meta-icon {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.modal-meta-item:hover .modal-meta-icon {
    background: var(--accent-color);
    transform: scale(1.1);
}

/* Compact meta items for header */
.modal-meta-item.compact {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 0;
    background: transparent;
    border: none;
    transition: none;
}

.modal-meta-item.compact:hover {
    background: transparent;
    transform: none;
}

.modal-meta-item.compact .modal-meta-icon {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}


/* Enhanced Modal Body with Professional Gallery */
.modal-body {
    padding: 2.5rem;
    max-height: calc(95vh - 300px);
    overflow-y: auto;
    flex: 1;
}

/* Main Media Section */
.modal-main-media {
    margin-bottom: 2.5rem;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-heavy);
    position: relative;
}

.modal-main-media img,
.modal-main-media video,
.modal-main-media iframe {
    width: 100%;
    border-radius: 16px;
    display: block;
    transition: transform 0.3s ease;
}

.modal-main-media:hover img {
    transform: scale(1.02);
}

/* Professional Image Gallery */
.modal-gallery-section {
    margin: 3rem 0;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.gallery-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.gallery-title i {
    color: var(--accent-color);
}

.gallery-count {
    background: var(--accent-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Enhanced Gallery Grid */
.modal-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.2rem;
    margin-bottom: 1.5rem;
}

.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-medium);
    cursor: pointer;
    transition: all 0.3s ease;
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.05);
}

.gallery-item:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: var(--shadow-heavy);
    z-index: 2;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
    display: flex;
    align-items: flex-end;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-zoom {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    background: rgba(255, 255, 255, 0.9);
    color: var(--dark-bg);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.gallery-item:hover .gallery-zoom {
    opacity: 1;
    transform: scale(1);
}

/* Gallery Navigation */
.gallery-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.gallery-pagination {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.gallery-actions {
    display: flex;
    gap: 0.8rem;
}

.gallery-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gallery-btn:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
}

/* Enhanced Description Section */
.modal-description-section {
    margin: 2.5rem 0;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.description-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.description-icon {
    width: 48px;
    height: 48px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.description-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.modal-description {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.8;
    margin: 0;
}

/* Enhanced Modal Actions */
.modal-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-action-btn {
    padding: 0.9rem 1.8rem;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
}

.modal-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Professional Lightbox */
.image-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.image-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 12px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    display: block;
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.lightbox-close:hover {
    background: var(--accent-color);
    transform: rotate(90deg);
}

.lightbox-navigation {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.lightbox-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.lightbox-btn:hover {
    background: var(--accent-color);
    transform: scale(1.1);
}

.lightbox-caption {
    color: white;
    text-align: center;
    margin-top: 1rem;
    font-size: 1.1rem;
    max-width: 600px;
}

.modal-media.reduced-size {
    max-height: 300px;
    margin-bottom: 1.5rem;
}

.modal-media.reduced-size img,
.modal-media.reduced-size video,
.modal-media.reduced-size iframe {
    max-height: 300px;
    object-fit: contain;
    cursor: pointer;
    transition: transform 0.3s ease;
    border-radius: 12px;
}

.modal-media.reduced-size img:hover {
    transform: scale(1.02);
}

/* Enhanced Gallery Styles */
.modal-gallery-container {
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-gallery-container .gallery-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.modal-gallery-container .gallery-title i {
    color: var(--accent-color);
}

.modal-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
}

.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-medium);
    cursor: pointer;
    transition: all 0.3s ease;
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.05);
}

.gallery-item:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: var(--shadow-heavy);
    z-index: 2;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
    display: flex;
    align-items: flex-end;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-zoom {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    background: rgba(255, 255, 255, 0.9);
    color: var(--dark-bg);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.gallery-item:hover .gallery-zoom {
    opacity: 1;
    transform: scale(1);
}

/* Enhanced Responsive Design for Small Screens */
@media (max-width: 768px) {

    /* Reduce main image size on mobile */
    .modal-media.reduced-size {
        max-height: 200px;
        margin-bottom: 1rem;
    }

    .modal-media.reduced-size img,
    .modal-media.reduced-size video,
    .modal-media.reduced-size iframe {
        max-height: 200px;
    }

    /* Reduce modal header size on mobile */
    .modal-header-event {
        padding: 1.5rem 1.5rem 1rem;
        gap: 1rem;
    }

    .modal-header-event-top {
        flex-direction: column;
        gap: 1rem;
    }

    .modal-header-event-meta {
        text-align: left;
        min-width: auto;
        width: 100%;
        order: -1;
        /* Move meta above title on mobile */
    }

    .modal-close {
        position: absolute;
        top: 1rem;
        right: 1rem;
        margin-bottom: 0;
        z-index: 11;
    }

    .modal-title {
        font-size: 1.8rem;
        order: 1;
        /* Move title below meta on mobile */
    }

    .modal-header-event-main {
        order: 2;
        /* Ensure main content comes after title */
    }

    .modal-category {
        margin-bottom: 0.5rem;
    }

    .modal-meta {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .modal-meta-item {
        padding: 0.8rem;
        font-size: 0.9rem;
    }

    .modal-meta-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    /* Reduce modal body padding */
    .modal-body {
        padding: 1.5rem;
        max-height: calc(95vh - 200px);
    }

    /* Adjust gallery for mobile */
    .modal-gallery-container {
        padding: 1rem;
        margin: 1.5rem 0;
    }

    .modal-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 0.8rem;
    }

    .modal-gallery-container .gallery-title {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    /* Reduce description section */
    .modal-description {
        padding-top: 1rem;
    }

    .modal-description h4 {
        font-size: 1.2rem;
        margin-bottom: 0.8rem;
    }

    .modal-description p {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    /* Adjust modal actions for mobile */
    .modal-actions {
        padding-top: 1.5rem;
    }

    .modal-action-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* Responsive Design for Enhanced Modal */
@media (max-width: 1200px) {
    .event-modal-content {
        max-width: 80%;
        /* تم التخفيض من 95% إلى 85% */
    }

    /* تقليل حجم الخطوط ومسافات الحشو لتصغير العناصر الداخلية */
    .modal-header-event {
        padding: 2rem 2rem 1rem;
        /* تقليل مسافات الحشو العلوية والسفلية والجانبية */
    }

    .modal-title {
        font-size: 2.2rem;
        /* تم التخفيض من 2.5rem */
    }

    .modal-body {
        padding: 2rem;
        /* تقليل الحشو */
    }

    .modal-description {
        font-size: 1rem;
        /* تم التخفيض من 1.1rem */
    }

    .modal-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        /* تقليل عرض الأعمدة */
    }

}

@media (max-width: 992px) {
    .event-modal-content {
        max-width: 90%;
        /* عرض أكبر قليلاً لهذا النطاق */
    }

    .modal-title {
        font-size: 1.8rem;
        /* تم التخفيض من 2rem */
    }

    .modal-body {
        padding: 1.5rem;
        /* تقليل الحشو */
        max-height: calc(95vh - 250px);
    }

    .modal-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        /* تقليل عرض الأعمدة */
        gap: 0.8rem;
    }

    .modal-meta-item {
        font-size: 0.95rem;
    }
}

@media (max-width: 768px) {
    .event-modal {
        padding: 1rem;
    }

    .modal-header-event {
        padding: 2rem 1.5rem 1rem;
    }

    .modal-body {
        padding: 1.5rem;
        max-height: calc(95vh - 250px);
    }

    .modal-title {
        font-size: 1.8rem;
    }

    .modal-gallery-section {
        padding: 1.5rem;
        margin: 2rem 0;
    }

    .modal-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.8rem;
    }

    .gallery-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-action-btn {
        width: 100%;
        justify-content: center;
    }

    .lightbox-content {
        max-width: 95%;
    }
}

@media (max-width: 576px) {
    .modal-media.reduced-size {
        max-height: 180px;
    }

    .modal-media.reduced-size img,
    .modal-media.reduced-size video,
    .modal-media.reduced-size iframe {
        max-height: 180px;
    }

    .modal-header-event {
        padding: 1rem 1rem 0.5rem;
    }

    .modal-title {
        font-size: 1.5rem;
    }

    .modal-close {
        top: 0.8rem;
        right: 0.8rem;
        width: 2.2rem;
        height: 2.2rem;
        font-size: 1rem;
        z-index: 11;
    }

    .modal-meta-item.compact {
        font-size: 0.85rem;
    }

    .modal-meta-item.compact .modal-meta-icon {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .modal-body {
        padding: 1rem;
        max-height: calc(95vh - 150px);
    }

    .modal-gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.6rem;
    }

    .modal-gallery-container .gallery-title {
        font-size: 1rem;
    }

    .modal-description-section {
        padding: 1.5rem;
    }

    .description-header {
        flex-direction: column;
        text-align: center;
        gap: 0.8rem;
    }

    .lightbox-navigation {
        gap: 0.5rem;
    }

    .lightbox-btn {
        width: 45px;
        height: 45px;
    }
}

/* Animation Enhancements */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-gallery-section {
    animation: fadeInUp 0.6s ease-out;
}

.gallery-item {
    animation: fadeInUp 0.6s ease-out;
}

@media (max-width: 480px) {
    .event-modal-content {
        margin: 0.5rem;
        max-height: 98vh;
    }

    .modal-close {
        top: 0.8rem;
        right: 0.8rem;
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.2rem;
    }
}

/* Lightbox mobile optimizations */
@media (max-width: 768px) {
    .lightbox-content {
        max-width: 95%;
    }

    .lightbox-image {
        max-height: 60vh;
    }

    .lightbox-close {
        top: -40px;
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }

    .lightbox-btn {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    .lightbox-caption {
        font-size: 1rem;
    }
}

.gallery-item:nth-child(1) {
    animation-delay: 0.1s;
}

.gallery-item:nth-child(2) {
    animation-delay: 0.2s;
}

.gallery-item:nth-child(3) {
    animation-delay: 0.3s;
}

.gallery-item:nth-child(4) {
    animation-delay: 0.4s;
}

.gallery-item:nth-child(5) {
    animation-delay: 0.5s;
}

.gallery-item:nth-child(6) {
    animation-delay: 0.6s;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

    .gallery-item,
    .modal-gallery-section {
        animation: none;
    }

    .gallery-item:hover,
    .modal-action-btn:hover,
    .lightbox-btn:hover {
        transform: none;
    }
}

/* تصغير الهيدر بشكل أكبر للمودال */
@media (max-width: 1366px) and (min-width: 1024px) {
    .modal-header-event {
        padding: 0.6rem 1rem 0.4rem; /* تقليل الحشو العلوي والسفلي */
        margin-bottom: 0.3rem;       /* تقليل المسافة بين الهيدر والمحتوى */
    }

    .modal-title {
        font-size: 1.5rem; /* تصغير حجم العنوان بشكل واضح */
        line-height: 1.2;  /* تقليل الفراغ حول النص */
    }

    .modal-header-event-top {
        gap: 0.3rem; /* تقليل الفراغ بين العناصر داخل الهيدر */
    }

    .modal-body {
        max-height: calc(95vh - 100px); /* رفع المحتوى ليكون واضح */
        padding-top: 0.8rem;
    }
}
