/* Modern and Elegant Carousel Styles inspired by Amazon/Microsoft */

.main-page-carousel {
    position: relative;
    width: 100%;
    max-width: 900px; /* Adjusted for a slightly larger carousel */
    height: 400px; /* Increased height for better visual impact */
    margin: 0 auto 40px; /* More margin at the bottom */
    overflow: hidden;
    border-radius: 12px; /* Slightly more rounded corners */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1); /* Enhanced shadow */
    background: #f0f2f5; /* Light background for a clean look */
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-inner {
    display: flex;
    height: 100%;
    /* Revert: No transform transition here for fade effect */
}

.carousel-item {
    min-width: 100%; /* Keep for consistency, but display: none will hide it */
    height: 100%;
    flex-shrink: 0;
    display: none; /* Revert to display: none for non-active items */
    opacity: 0; /* Add opacity for fade effect */
    transition: opacity 0.6s ease-in-out; /* Fade transition */
    align-items: center;
    justify-content: center;
    background: #ffffff; /* White background for each item */
    position: absolute; /* Position items on top of each other for fade */
    top: 0;
    left: 0;
    width: 100%;
}

.carousel-item.active {
    display: flex; /* Only active item is flex */
    opacity: 1;
}

.announcement-image {
    max-width: 95%; /* Slightly more padding from edges */
    max-height: 95%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08); /* Subtle shadow for images */
    transition: transform 0.3s ease;
}

.announcement-image:hover {
    transform: scale(1.01); /* Slight zoom on hover */
}

/* Navigation Arrows - Modern and Elegant */
.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px; /* Larger buttons */
    height: 50px;
    background: rgba(255, 255, 255, 0.6); /* Slightly more transparent white */
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10; /* Ensure arrows are above everything */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); /* Slightly less intense shadow */
    transition: all 0.3s ease;
    color: #333; /* Darker arrow color */
    font-size: 28px; /* Larger arrow icon */
    backdrop-filter: blur(5px); /* Frosted glass effect */
    -webkit-backdrop-filter: blur(5px); /* For Safari */
}

.carousel-control.prev {
    left: 20px; /* Position further from the edge */
    /* SVG for left arrow */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 18 9 12 15 6'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 60%;
}

.carousel-control.next {
    right: 20px; /* Position further from the edge */
    /* SVG for right arrow */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 60%;
}

.carousel-control:hover {
    background: rgba(255, 255, 255, 0.9); /* Brighter white on hover */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2); /* Slightly less intense shadow on hover */
    transform: translateY(-50%) scale(1.05); /* Slightly smaller scale up */
    color: #0056b3; /* A more standard blue for highlight */
}

.carousel-control:active {
    transform: translateY(-50%) scale(0.98); /* Subtle press effect */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Pagination Dots - Subtle and Interactive */
.carousel-dots {
    position: absolute;
    bottom: 25px; /* Position slightly higher */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px; /* Increased gap between dots */
    z-index: 10;
    padding: 8px 15px;
    background: rgba(0, 0, 0, 0.25); /* Slightly more transparent background */
    border-radius: 20px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    position: relative; /* Needed for positioning the progress line */
}

.dot {
    width: 12px; /* Larger dots */
    height: 12px;
    background: rgba(255, 255, 255, 0.5); /* Semi-transparent white */
    border: 1px solid rgba(255, 255, 255, 0.7); /* Subtle border */
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    /* Removed position: relative; and ::after styles */
}

.dot.active {
    background: #ffffff; /* Solid white when active */
    transform: scale(1.2); /* Slightly smaller prominent active state */
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.6); /* Slightly less intense glow effect */
    border-color: #ffffff;
}

.carousel-progress-line {
    position: absolute;
    height: 2px; /* Thin line */
    background-color: #007bff; /* Blue line */
    border-radius: 1px;
    bottom: 0; /* Position at the bottom of carousel-dots */
    left: 0; /* Initial position */
    width: 0; /* Initial width */
    transition: all 0.3s ease-out; /* Smooth transition for movement and width change */
    z-index: 11; /* Ensure it's above dots */
}

.dot:hover {
    background: rgba(255, 255, 255, 0.8); /* Brighter on hover */
    transform: scale(1.1);
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .main-page-carousel {
        max-width: 768px;
        height: 350px;
        margin-bottom: 30px;
    }
    .carousel-control {
        width: 45px;
        height: 45px;
        font-size: 24px;
    }
    .carousel-control.prev {
        left: 15px;
    }
    .carousel-control.next {
        right: 15px;
    }
    .carousel-dots {
        bottom: 20px;
        gap: 8px;
    }
    .dot {
        width: 10px;
        height: 10px;
    }
}

@media (max-width: 768px) {
    .main-page-carousel {
        max-width: 100%;
        height: 280px;
        margin-bottom: 20px;
        border-radius: 8px;
    }
    .carousel-control {
        width: 40px;
        height: 40px;
        font-size: 20px;
        background: rgba(255, 255, 255, 0.85); /* Less transparent on small screens */
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
    .carousel-control.prev {
        left: 10px;
    }
    .carousel-control.next {
        right: 10px;
    }
    .carousel-dots {
        bottom: 15px;
        gap: 6px;
        padding: 6px 12px;
        background: rgba(0, 0, 0, 0.35);
    }
    .dot {
        width: 8px;
        height: 8px;
    }
    .announcement-image {
        max-width: 98%;
        max-height: 98%;
        border-radius: 6px;
    }
}

@media (max-width: 480px) {
    .main-page-carousel {
        height: 200px;
        margin-bottom: 15px;
    }
    .carousel-control {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    .carousel-control.prev {
        left: 5px;
    }
    .carousel-control.next {
        right: 5px;
    }
    .carousel-dots {
        bottom: 10px;
        gap: 5px;
        padding: 5px 10px;
    }
    .dot {
        width: 7px;
        height: 7px;
    }
}

/* RTL Support for carousel arrows - ensure both arrows are visible on mobile */
[dir="rtl"] .carousel-control.prev {
    left: unset;
    right: 20px;
}

[dir="rtl"] .carousel-control.next {
    right: unset;
    left: 20px;
}

@media (max-width: 1024px) {
    [dir="rtl"] .carousel-control.prev {
        right: 15px;
    }
    [dir="rtl"] .carousel-control.next {
        left: 15px;
    }
}

@media (max-width: 768px) {
    [dir="rtl"] .carousel-control.prev {
        right: 10px;
    }

    [dir="rtl"] .carousel-control.next {
        left: 10px;
    }
}

@media (max-width: 480px) {
    [dir="rtl"] .carousel-control.prev {
        right: 5px;
    }

    [dir="rtl"] .carousel-control.next {
        left: 5px;
    }
}

/* General performance and rendering improvements */
.main-page-carousel, 
.carousel-item, 
.announcement-image,
.carousel-control,
.carousel-dots,
.dot {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    transform-origin: center; /* Ensure transforms are smooth */
}
