/* ========================================
   Upcoming Events Section
   ======================================== */

.upcoming-events-section {
    padding: 100px 0;
    background: #ffffff;
    position: relative;
    overflow: hidden;
}

/* Events Timeline */
.events-timeline {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}

.events-timeline::before {
    content: "";
    position: absolute;
    left: 80px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, #5b9bd5, #5b9bd5);
}

/* Event Item */
.event-item {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    position: relative;
}

.event-item:last-child {
    margin-bottom: 0;
}

/* Event Date Badge */
.event-date-badge {
    width: 160px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #5b9bd5, #5b9bd5);
    border-radius: 4px;
    padding: 20px 20px 15px 20px;
    text-align: center;
    color: #ffffff;
    box-shadow: 0 10px 30px rgba(43, 79, 135, 0.3);
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden; /* IMPORTANT: Contains the stars */
}

/* Shooting Stars Container - INSIDE DATE BADGE */
.badge-shooting-stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

/* Shooting Star - Smaller for badge */
.badge-shooting-star {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    box-shadow: 0 0 6px currentColor, 0 0 12px currentColor;
    animation: badgeShootingStar var(--star-duration, 2.5s) ease-out forwards;
    animation-delay: var(--star-delay, 0s);
}

.badge-shooting-star::before {
    content: "";
    position: absolute;
    top: 50%;
    right: 0;
    height: 1px;
    width: 30px;
    background: linear-gradient(90deg, transparent, currentColor);
    transform: translateX(2px) translateY(-50%) rotate(var(--star-angle, -45deg));
    border-radius: 100%;
    animation: badgeShootingStarTail var(--star-duration, 2.5s) ease-out forwards;
    animation-delay: var(--star-delay, 0s);
}

@keyframes badgeShootingStar {
    0% {
        transform: translate(var(--star-start-x, 0), var(--star-start-y, 0));
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    70% {
        opacity: 0.8;
    }
    100% {
        transform: translate(var(--star-end-x, -50px), var(--star-end-y, 50px));
        opacity: 0;
    }
}

@keyframes badgeShootingStarTail {
    0% {
        width: 0;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    30% {
        width: 30px;
        opacity: 1;
    }
    70% {
        opacity: 0.5;
    }
    100% {
        width: 0;
        opacity: 0;
    }
}

/* Ensure date content stays above stars */
.date-month,
.date-day,
.date-year,
.event-type-icon {
    position: relative;
    z-index: 1;
}

.date-month {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.date-day {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    margin: 10px 0;
}

.date-year {
    font-size: 0.875rem;
    font-weight: 600;
    opacity: 0.9;
    margin-bottom: 15px;
}

/* Event Type Icon */
.event-type-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: auto;
    transition: all 0.3s ease;
}

.event-date-badge:hover .event-type-icon {
    transform: translateY(-5px) scale(1.05);
}

.event-type-icon i {
    font-size: 1.5rem;
    color: #ffffff;
}

/* Event Content */
.event-content {
    flex: 1;
    background: #ffffff;
    border-radius: 4px;
    padding: 35px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.event-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(91, 155, 213, 0.15);
    border-color: #5b9bd5;
}

/* Event Header */
.event-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.event-category {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.event-category.workshop {
    background: #e3f2fd;
    color: #5b9bd5;
}

.event-category.conference {
    background: #f3e5f5;
    color: #9c27b0;
}

.event-category.webinar {
    background: #e8f5e9;
    color: #2e7d32;
}

.event-category.hackathon {
    background: #fff3e0;
    color: #e65100;
}

.event-status {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.event-status.upcoming {
    background: #e8f5e9;
    color: #2e7d32;
}

/* Event Title */
.event-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #5b9bd5;
    margin-bottom: 15px;
    line-height: 1.3;
}

/* Event Description */
.event-description {
    font-size: 0.95rem;
    color: #6c757d;
    line-height: 1.7;
    margin-bottom: 20px;
}

/* Event Meta */
.event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 2px solid #f0f7ff;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: #6c757d;
}

.meta-item i {
    color: #5b9bd5;
    font-size: 1rem;
}

/* Event Actions */
.event-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-event-register {
    display: inline-flex;
    align-items: center;
    padding: 12px 28px;
    background: #5b9bd5;
    color: #ffffff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(43, 79, 135, 0.2);
}

.btn-event-register:hover {
    background: #5b9bd5;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(43, 79, 135, 0.3);
    color: #ffffff;
}

.btn-event-details {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: transparent;
    color: #5b9bd5;
    text-decoration: none;
    border: 2px solid #5b9bd5;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.btn-event-details:hover {
    background: #5b9bd5;
    color: #ffffff;
}

.btn-event-details i {
    transition: transform 0.3s ease;
}

.btn-event-details:hover i {
    transform: translateX(5px);
}

/* View All Events Button */
.btn-view-all-events {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 40px;
    background: #5b9bd5;
    color: #ffffff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.3);
}

.btn-view-all-events:hover {
    background: #5b9bd5;
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(43, 79, 135, 0.4);
    color: #ffffff;
}

/* Empty State */
.events-empty-state {
    max-width: 500px;
    margin: 0 auto;
}

.empty-icon-wrapper {
    width: 100px;
    height: 100px;
    background: rgba(91, 155, 213, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.empty-icon-wrapper i {
    font-size: 2.5rem;
    color: #5b9bd5;
}

.empty-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #5b9bd5;
    margin-bottom: 12px;
}

.empty-description {
    font-size: 1rem;
    color: #6c757d;
    line-height: 1.7;
    margin-bottom: 25px;
}

/* Responsive */
@media (max-width: 991px) {
    .upcoming-events-section {
        padding: 80px 0;
    }

    .events-timeline::before {
        left: 70px;
    }

    .event-date-badge {
        width: 140px;
        padding: 15px;
    }

    .date-day {
        font-size: 2.5rem;
    }

    .event-type-icon {
        width: 45px;
        height: 45px;
    }

    .event-type-icon i {
        font-size: 1.25rem;
    }
}

@media (max-width: 768px) {
    .events-timeline::before {
        display: none;
    }

    .event-item {
        flex-direction: column;
        gap: 20px;
    }

    .event-date-badge {
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
        flex-direction: row;
        justify-content: space-between;
        padding: 20px;
    }

    .date-content {
        display: flex;
        gap: 15px;
        align-items: center;
    }

    .date-month {
        font-size: 0.875rem;
    }

    .date-day {
        font-size: 2.5rem;
        margin: 0;
    }

    .date-year {
        font-size: 0.75rem;
        margin: 0;
    }

    .event-type-icon {
        margin-top: 0;
    }

    .event-content {
        padding: 25px;
    }

    .event-title {
        font-size: 1.25rem;
    }

    .event-meta {
        flex-direction: column;
        gap: 12px;
    }

    .event-actions {
        flex-direction: column;
    }

    .btn-event-register,
    .btn-event-details {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .event-date-badge {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }

    .event-type-icon {
        margin-top: 10px;
    }
}
