/* Main element */
main {
    touch-action: pan-y; /* Allow vertical scrolling, prevent horizontal swiping outside carousels */
}

/* Swiper Container Wrapper */
.swiper-container-wrapper {
    touch-action: pan-y; /* Allow vertical scrolling within the carousel */
}

/* Swiper Container */
.swiper-container {
    width: 100%;
    padding: 20px 0;
    overscroll-behavior-x: contain; /* Prevent overscroll from affecting other carousels */
    overflow: hidden; /* Clip slides outside the viewport */
}

/* Swiper Wrapper */
.swiper-wrapper {
    width: 100%; /* Ensure the wrapper doesn't expand beyond the container */
}

/* Webinar Card */
.webinar-card {
    transition: transform 0.3s ease;
    margin-top: 20px; /* Gap above the card to prevent top border from hiding on hover */
    min-width: 300px;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.webinar-card:hover {
    transform: translateY(-5px); /* Reduced lift for better performance */
}

/* Card styling with solid background */
.card {
    background: #192339 !important; /* Solid dark blue background */
    border: 1px solid rgba(255, 255, 255, 0.2) !important; /* Default border */
    transition: border-color 0.3s ease !important; /* Smooth border color transition */
}

/* Card hover effect */
.webinar-card:hover .card {
    border-color: #DC2626 !important; /* Red border on hover */
}

/* Centered Card (Active Slide) */
.swiper-slide-active .webinar-card .card {
    border-color: #DC2626 !important; /* Red outline for the centered card (mobile) */
}

/* Swiper Slide */
.swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box; /* Ensure padding/margins are included in width calculations */
}

/* Pagination Dots for Featured Webinars */
.featured-webinar-carousel .swiper-pagination {
    position: relative;
    bottom: 0;
    margin-top: 10px; /* Reduced from 20px to decrease gap below cards */
}

.featured-webinar-carousel .swiper-pagination-bullet {
    background: rgba(255, 255, 255, 0.5); /* Default color for inactive dots */
    opacity: 1;
    width: 10px;
    height: 10px;
}

.featured-webinar-carousel .swiper-pagination-bullet-active {
    background: #DC2626; /* Primary red color for active dot */
    transform: scale(1.3); /* Slightly larger active dot */
}

/* Pagination Dots for Upcoming Webinars */
.upcoming-webinar-carousel .swiper-pagination {
    position: relative;
    bottom: 0;
    margin-top: 10px; /* Reduced from 20px to decrease gap below cards */
}

.upcoming-webinar-carousel .swiper-pagination-bullet {
    background: rgba(255, 255, 255, 0.5); /* Default color for inactive dots */
    opacity: 1;
    width: 10px;
    height: 10px;
}

.upcoming-webinar-carousel .swiper-pagination-bullet-active {
    background: #DC2626; /* Primary red color for active dot */
    transform: scale(1.3); /* Slightly larger active dot */
}

/* Ensure font consistency with Roboto, but exclude FontAwesome icons */
.card,
.card-body,
.card-body *:not(i),
.card-title,
.card-text,
.small,
.badge {
    font-family: 'Roboto', sans-serif !important; /* Apply Roboto to all card elements except <i> */
}

/* LIVE dot animation */
.live-dot {
    position: relative;
    width: 12px;
    height: 12px;
    background-color: #DC2626;
    border-radius: 50%;
    animation: pulse 2s infinite ease-in-out;
}

.live-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    background-color: #DC2626;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: pulse-ring 2s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }
}

@keyframes pulse-ring {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }
    100% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
    }
}

/* Badge styling */
.badge.bg-success {
    background-color: #28a745 !important;
}

.badge.bg-featured {
    background-color: #FFD700 !important;
    color: #000000 !important;
}

/* Optimize animations for mobile */
.webinar-card {
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
    will-change: opacity;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* Remove staggered delay to reduce load */
.webinar-card:nth-child(1),
.webinar-card:nth-child(2),
.webinar-card:nth-child(3),
.webinar-card:nth-child(4),
.webinar-card:nth-child(5) {
    animation-delay: 0s;
}

/* Hide Navigation Arrows on All Screen Sizes */
.swiper-button-next,
.swiper-button-prev {
    display: none !important; /* Hide the blue left and right arrows on all screen sizes */
}

/* Reduce gap between heading and cards for both sections */
#featured-webinars h2,
#upcoming-webinars h2 {
    margin-bottom: 1.5rem !important; /* Reduced from mb-5 (3rem) to 1.5rem (equivalent to mb-3) */
}

/* Desktop: Show multiple cards */
@media (min-width: 769px) {
    .swiper-container {
        width: 90%; /* Reduced side gap for smaller desktop screens */
        margin: 0 auto;
    }

    .webinar-card {
        min-width: 320px !important; /* Slightly smaller for smaller desktop screens */
        max-width: 320px !important;
    }

    /* Remove red border on active slide for desktop */
    .swiper-slide-active .webinar-card .card {
        border-color: rgba(255, 255, 255, 0.2) !important; /* Default border color, no red border unless hovered */
    }

    /* Ensure hover effect applies to active slide on desktop */
    .swiper-slide-active .webinar-card:hover .card {
        border-color: #DC2626 !important; /* Red border on hover, even for active slide */
    }
}

@media (min-width: 992px) {
    .swiper-container {
        width: 92%; /* Slightly wider for medium desktop screens */
        margin: 0 auto;
    }

    .webinar-card {
        min-width: 340px !important; /* Slightly larger for medium desktop screens */
        max-width: 340px !important;
    }
}

@media (min-width: 1200px) {
    .swiper-container {
        width: 94%; /* Even wider for large desktop screens */
        margin: 0 auto;
    }

    .webinar-card {
        min-width: 350px !important; /* Original size for large desktop screens */
        max-width: 350px !important;
    }
}