/*
 * Banner carousel (Views/Shared/_HeroCarousel.cshtml), used on the public portal.
 * Self-contained: theme tokens have fallbacks so it works with or without amoozdar-theme.css.
 */

/* Display font for the slide titles (the portal loads Vazirmatn/Estedad only). */
@font-face { font-family: 'YekanBakh'; src: url('../fonts/YekanBakh/fonnts.com-YekanBakh-Bold.ttf') format('truetype'); font-weight: 700; font-style: normal; font-display: swap; }

html body .hero-carousel {
    border-radius: 22px;
    overflow: hidden;
    box-shadow: var(--ui-shadow, 0 1px 2px rgba(30, 27, 75, .04), 0 10px 28px -12px rgba(30, 27, 75, .16));
    isolation: isolate;
}

html body .hero-slide {
    --hero-bg: linear-gradient(120deg, #3730a3 0%, #4f46e5 45%, #818cf8 100%);
    --hero-ink: #3730a3;
    position: relative;
    background: var(--hero-bg);
    color: #ffffff;
    overflow: hidden;
}

html body .hero-tone-teal { --hero-bg: linear-gradient(120deg, #115e59 0%, #0d9488 50%, #2dd4bf 100%); --hero-ink: #0f766e; }
html body .hero-tone-amber { --hero-bg: linear-gradient(120deg, #9a3412 0%, #ea580c 50%, #fbbf24 100%); --hero-ink: #c2410c; }
html body .hero-tone-rose { --hero-bg: linear-gradient(120deg, #9f1239 0%, #e11d48 50%, #fb7185 100%); --hero-ink: #be123c; }
html body .hero-tone-violet { --hero-bg: linear-gradient(120deg, #4c1d95 0%, #7c3aed 50%, #a78bfa 100%); --hero-ink: #6d28d9; }

/* Decorative circles and dots */
html body .hero-slide::before,
html body .hero-slide::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

html body .hero-slide::before {
    width: 340px;
    height: 340px;
    inset-inline-end: -90px;
    top: -140px;
    background: radial-gradient(circle, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 70%);
}

html body .hero-slide::after {
    width: 220px;
    height: 220px;
    inset-inline-start: 34%;
    bottom: -130px;
    border: 28px solid rgba(255, 255, 255, .08);
}

html body .hero-slide-body {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 236px;
    padding: 28px 44px 42px;
    background-image: radial-gradient(rgba(255, 255, 255, .16) 1.2px, transparent 1.4px);
    background-size: 18px 18px;
    background-position: 0 0;
    -webkit-mask-image: none;
}

html body .hero-slide-text { max-width: 560px; }

html body .hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    padding: 4px 12px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    font-size: var(--ui-fs-xs, .75rem);
    font-weight: 600;
    backdrop-filter: blur(4px);
}

html body .hero-title {
    margin: 0 0 8px;
    color: #ffffff;
    font-family: var(--ui-font-display, 'YekanBakh', 'Vazirmatn', Tahoma, sans-serif);
    font-size: clamp(1.15rem, .95rem + .9vw, 1.6rem);
    font-weight: 700;
    line-height: 1.45;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .15);
}

html body .hero-text {
    margin: 0;
    color: rgba(255, 255, 255, .9);
    font-size: var(--ui-fs-lg, 1rem);
    line-height: 1.9;
}

html body .hero-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 9px 20px;
    border-radius: 999px;
    background: #ffffff;
    color: var(--hero-ink);
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 10px 22px -10px rgba(0, 0, 0, .45);
    transition: transform .15s ease, box-shadow .15s ease;
}

html body .hero-action:hover { color: var(--hero-ink); transform: translateY(-2px); box-shadow: 0 14px 26px -10px rgba(0, 0, 0, .5); }

html body .hero-slide-art { flex: none; display: flex; align-items: center; justify-content: center; }

html body .hero-slide-art img {
    width: clamp(200px, 26vw, 330px);
    height: auto;
    filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .22));
    animation: hero-float 6s ease-in-out infinite;
}

html body .carousel-item.active .hero-slide-text > * { animation: hero-rise .6s ease both; }
html body .carousel-item.active .hero-slide-text > :nth-child(2) { animation-delay: .06s; }
html body .carousel-item.active .hero-slide-text > :nth-child(3) { animation-delay: .12s; }
html body .carousel-item.active .hero-slide-text > :nth-child(4) { animation-delay: .18s; }

@keyframes hero-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes hero-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

html body .hero-carousel .carousel-indicators { margin-bottom: 14px; gap: 6px; }

html body .hero-carousel .carousel-indicators [data-bs-target] {
    width: 8px;
    height: 8px;
    margin: 0;
    border: 0;
    border-radius: 999px;
    background: #ffffff;
    opacity: .5;
    transition: width .25s ease, opacity .25s ease;
}

html body .hero-carousel .carousel-indicators .active { width: 26px; opacity: 1; }

html body .hero-carousel .carousel-control-prev,
html body .hero-carousel .carousel-control-next {
    top: 50%;
    bottom: auto;
    width: 40px;
    height: 40px;
    margin: 0 12px;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
    color: #ffffff;
    font-size: 1rem;
    opacity: 0;
    transform: translateY(-50%);
    backdrop-filter: blur(6px);
    transition: opacity .2s ease, background-color .2s ease;
}

html body .hero-carousel:hover .carousel-control-prev,
html body .hero-carousel:hover .carousel-control-next,
html body .hero-carousel .carousel-control-prev:focus-visible,
html body .hero-carousel .carousel-control-next:focus-visible { opacity: 1; }

html body .hero-carousel .carousel-control-prev:hover,
html body .hero-carousel .carousel-control-next:hover { background: rgba(255, 255, 255, .32); }

/* Bootstrap's LTR build puts "prev" on the left; in RTL the previous slide is on the right. */
html[dir="rtl"] body .hero-carousel .carousel-control-prev { right: 0; left: auto; }
html[dir="rtl"] body .hero-carousel .carousel-control-next { left: 0; right: auto; }
html[dir="ltr"] body .hero-carousel .carousel-control-prev i,
html[dir="ltr"] body .hero-carousel .carousel-control-next i { transform: scaleX(-1); }

html[data-theme="dark"] body .hero-slide { filter: saturate(.92) brightness(.9); }

@media (max-width: 767.98px) {
    html body .hero-slide-body { flex-direction: column-reverse; align-items: flex-start; gap: 6px; min-height: 0; padding: 20px 20px 40px; }
    html body .hero-slide-art { align-self: center; }
    html body .hero-slide-art img { width: 170px; }
    html body .hero-text { font-size: var(--ui-fs-md, .875rem); }
    html body .hero-carousel .carousel-control-prev,
    html body .hero-carousel .carousel-control-next { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    html body .hero-slide-art img,
    html body .carousel-item.active .hero-slide-text > * { animation: none; }
}

@media print {
    html body .hero-carousel { display: none !important; }
}
