/* Base Animation Classes */

/* Custom Scrollbar - html element */
html {
    min-height: 100vh;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-width: auto !important;
}

body {
    min-height: 100vh;
}

/* Custom Scrollbar */
html::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #333 !important;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb {
    background: #888 !important;
    border-radius: 6px;
    border: 2px solid #333 !important;
}

::-webkit-scrollbar-thumb:hover {
    background: #666 !important;
}

/* Firefox Scrollbar */
* {
    scrollbar-width: auto;
    scrollbar-color: #888 #f1f1f1;
}

/* Override button hover/active/focus colors to blue */
.btn-custom:hover,
.btn-custom:focus,
.btn-custom:active {
    background-color: rgb(43, 108, 176) !important;
    border-color: rgb(43, 108, 176) !important;
    box-shadow: none !important;
    outline: none !important;
}

.btn-custom-outline:hover,
.btn-custom-outline:focus,
.btn-custom-outline:active {
    background-color: rgb(43, 108, 176) !important;
    border-color: rgb(43, 108, 176) !important;
    color: white !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Remove yellow focus outline from all buttons */
a.btn:focus,
button.btn:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Hero Carousel Fix - Enable slideshow */
#heroCarousel {
    position: relative;
    z-index: 1;
    margin-top: -76px; /* Move up behind header */
}

#heroCarousel .carousel-inner {
    position: relative;
    height: 110vh;
}

#heroCarousel .carousel-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInBottom {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-10deg) scale(0.9);
    }
    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Animation Classes */
.animate-fadeInUp {
    animation: fadeInUp 1s ease forwards;
}

.animate-fadeInLeft {
    animation: fadeInLeft 1s ease forwards;
}

.animate-fadeInRight {
    animation: fadeInRight 1s ease forwards;
}

.animate-scaleIn {
    animation: scaleIn 1s ease forwards;
}

.animate-slideInBottom {
    animation: slideInBottom 1s ease forwards;
}

.animate-rotateIn {
    animation: rotateIn 1s ease forwards;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-shimmer {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    background-size: 1000px 100%;
    animation: shimmer 3s infinite;
}

/* Delay Classes */
.delay-1 {
    animation-delay: 0.2s;
    opacity: 0;
}
.delay-2 {
    animation-delay: 0.4s;
    opacity: 0;
}
.delay-3 {
    animation-delay: 0.6s;
    opacity: 0;
}
.delay-4 {
    animation-delay: 0.8s;
    opacity: 0;
}
.delay-5 {
    animation-delay: 1s;
    opacity: 0;
}

/* Scroll Animation Classes */
.scroll-fadeInUp {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-fadeInLeft {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-fadeInRight {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-scaleIn {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-visible {
    opacity: 1 !important;
    transform: translate(0) scale(1) !important;
}

/* Stagger Children Animation (NOT applied to services) */
.stagger-children:not(#services .stagger-children) > * {
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
}

.stagger-children:not(#services .stagger-children) > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children:not(#services .stagger-children) > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-children:not(#services .stagger-children) > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-children:not(#services .stagger-children) > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-children:not(#services .stagger-children) > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-children:not(#services .stagger-children) > *:nth-child(6) { animation-delay: 0.6s; }
.stagger-children:not(#services .stagger-children) > *:nth-child(7) { animation-delay: 0.7s; }
.stagger-children:not(#services .stagger-children) > *:nth-child(8) { animation-delay: 0.8s; }

/* Smooth Section Transitions */
section:not(#services) {
    position: relative;
    overflow: hidden;
}

section:not(#services)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.05), transparent);
    pointer-events: none;
    z-index: 1;
}

/* Hover Effects (NOT applied to services) */
.hover-lift:not(#services .hover-lift) {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:not(#services .hover-lift):hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(43, 108, 176, 0.2);
}

.hover-scale:not(#services .hover-scale) {
    transition: transform 0.3s ease;
}

.hover-scale:not(#services .hover-scale):hover {
    transform: scale(1.05);
}

.hover-rotate:not(#services .hover-rotate) {
    transition: transform 0.3s ease;
}

.hover-rotate:not(#services .hover-rotate):hover {
    transform: rotate(5deg);
}

.hover-glow:not(#services .hover-glow) {
    transition: box-shadow 0.3s ease;
}

.hover-glow:not(#services .hover-glow):hover {
    box-shadow: 0 0 30px rgba(43, 108, 176, 0.5);
}

/* Parallax Effect */
.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Disable parallax on mobile for performance */
@media (max-width: 768px) {
    .parallax {
        background-attachment: scroll;
    }
}

/* Featured Works Slideshow */
@keyframes grainShift {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-1%, -1%); }
    20% { transform: translate(1%, 1%); }
    30% { transform: translate(-2%, 1%); }
    40% { transform: translate(2%, -1%); }
    50% { transform: translate(-1%, 2%); }
    60% { transform: translate(1%, -2%); }
    70% { transform: translate(-2%, -1%); }
    80% { transform: translate(2%, 1%); }
    90% { transform: translate(-1%, -2%); }
}

.slideshow-container {
    position: relative;
    width: 100%;
    height: 650px;
}

.slideshow-slide {
    display: none;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    position: absolute;
    top: 0;
    left: 0;
    cursor: pointer;
    transition: transform 0.5s ease;
    background-color: #333;
    animation: fadeIn 0.5s ease-in-out;
}

.slideshow-slide.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slideshow-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.95));
    color: white;
    padding: 2.5rem;
    text-align: center;
    backdrop-filter: blur(2px);
}

.slideshow-overlay h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.slideshow-overlay p {
    font-size: 1rem;
    opacity: 0.9;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.slideshow-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 10px;
}

.slideshow-indicators.dashes .dash {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
}

.slideshow-indicators.dashes .dash.active {
    background: rgb(43, 108, 176);
    width: 60px;
    box-shadow: 0 0 10px rgba(43, 108, 176, 0.5);
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Loading Animation */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(43, 108, 176, 0.3);
    border-top-color: rgb(43, 108, 176);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Scroll-triggered animations */
@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.scroll-slide-left {
    opacity: 0;
    transform: translateX(-100px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-slide-left.visible {
    animation: slideInFromLeft 0.8s ease forwards;
}

.scroll-slide-right {
    opacity: 0;
    transform: translateX(100px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-slide-right.visible {
    animation: slideInFromRight 0.8s ease forwards;
}

/* Progress Bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, rgb(43, 108, 176), #6c5ce7);
    z-index: 9999;
    transition: width 0.3s ease;
}

/* ===== SERVICES SECTION - WHITE BACKGROUND ===== */
#services {
    background-color: white !important;
    position: relative;
    z-index: 1;
    padding: 80px 0 !important;
}

#services .container {
    background-color: transparent !important;
}

#services h2 {
    color: #333 !important;
    font-size: 3.2rem !important;
    margin-bottom: 0.5rem !important;
}

#services h5 {
    color: #666 !important;
    font-size: 1.3rem !important;
    margin-bottom: 2rem !important;
}

#services .item {
    background: #f8f9fa !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 15px !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05) !important;
    transition: all 0.3s ease;
    cursor: pointer;
    padding: 3rem 1.5rem !important;
    text-align: center !important;
}

#services .item:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.1) !important;
}

#services .item i {
    color: #000000 !important;
    font-size: 2.5rem !important;
    margin-bottom: 1rem !important;
    display: block;
    transition: transform 0.3s ease;
}

#services .item:hover i {
    transform: rotate(15deg) scale(1.2);
}

#services .item h5 {
    color: #333 !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    margin-bottom: 0.5rem !important;
}

#services .item p {
    color: #666 !important;
    font-size: 0.9rem !important;
    line-height: 1.5 !important;
    margin: 0 !important;
}

/* Services wrapper grid */
.wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    justify-content: center;
    align-items: stretch;
    margin-top: 2rem;
}

/* ===== WHY CHOOSE US SECTION - WHITE BACKGROUND ===== */
#why-choose-us {
    background-color: white !important;
    position: relative;
    z-index: 1;
    padding: 3rem 0 !important;
}

#why-choose-us h2 {
    color: #333 !important;
    font-size: 2.5rem !important;
    font-weight: 700 !important;
}

#why-choose-us .section-divider {
    background: rgb(43, 108, 176) !important;
    width: 80px !important;
    height: 4px !important;
    margin: 20px auto !important;
}

#why-choose-us .card {
    background: #f8f9fa !important;
    border: 1px solid #e0e0e0 !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05) !important;
    border-radius: 1rem !important;
    overflow: hidden !important;
    height: 100% !important;
    transition: all 0.3s ease;
}

#why-choose-us .card:hover {
    transform: translateY(-10px) !important;
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.1) !important;
}

#why-choose-us .card h4 {
    color: #333 !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    margin-bottom: 1rem !important;
}

#why-choose-us .card p {
    color: #666 !important;
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
    margin-bottom: 1.5rem !important;
}

#why-choose-us .choose-icon-circle {
    background: rgba(43, 108, 176, 0.1) !important;
    width: 80px !important;
    height: 80px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto 1rem !important;
    transition: all 0.3s ease;
}

#why-choose-us .card:hover .choose-icon-circle {
    background: rgba(43, 108, 176, 0.2) !important;
    transform: scale(1.1);
}

#why-choose-us .choose-icon-circle i {
    color: rgb(43, 108, 176) !important;
    font-size: 2.5rem !important;
}

#why-choose-us .badge {
    background: transparent !important;
    border: 2px solid rgb(43, 108, 176) !important;
    color: #333 !important;
    padding: 0.5rem 1rem !important;
    border-radius: 2rem !important;
    font-weight: 500 !important;
    transition: all 0.3s ease;
}

#why-choose-us .card:hover .badge {
    background: rgb(43, 108, 176) !important;
    color: white !important;
}

/* ===== HERO SECTION EXTRA SMALL SCREENS ===== */
@media (max-width: 480px) {
    #heroCarousel, .carousel-item {
        height: 85vh;
    }
    
    .carousel-caption {
        left: 3% !important;
        right: 3% !important;
        max-width: 94% !important;
        padding: 0 5px !important;
    }
    
    .carousel-caption h1 {
        font-size: 1.5rem !important;
        line-height: 1.2;
    }
    
    .carousel-caption p {
        font-size: 0.85rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .carousel-caption .d-flex {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    
    .btn-custom, .btn-custom-outline {
        padding: 6px 15px !important;
        font-size: 0.8rem !important;
        width: 100%;
        text-align: center;
    }
    
    .carousel-indicators.dashes {
        bottom: 15px;
    }
    
    .carousel-indicators.dashes button {
        width: 20px;
        height: 3px;
    }
    
    .carousel-indicators.dashes button.active {
        width: 30px;
    }
}

/* ===== FEATURED WORKS SECTION EXTRA RESPONSIVE ===== */
@media (max-width: 576px) {
    .slideshow-container,
    .slide-in-right {
        height: 350px !important;
        border-radius: 15px !important;
    }
    
    .featured-works-section {
        padding: 50px 0 !important;
    }
    
    .featured-works-section .display-4 {
        font-size: 2rem !important;
    }
    
    .fade-in h4 {
        font-size: 1.5rem !important;
    }
    
    .fade-in p {
        font-size: 0.9rem !important;
        padding: 0 1rem;
    }
    
    .btn-hover {
        padding: 12px 25px !important;
        font-size: 1rem !important;
    }
}

@media (max-width: 480px) {
    .slideshow-container,
    .slide-in-right {
        height: 280px !important;
    }
    
    .slideshow-indicators {
        bottom: 10px;
        gap: 6px;
    }
    
    .slideshow-indicators.dashes .dash {
        width: 18px;
        height: 3px;
    }
    
    .slideshow-indicators.dashes .dash.active {
        width: 28px;
    }
}

/* ===== ABOUT SECTION RESPONSIVE ===== */
@media (max-width: 992px) {
    #mission-vision {
        min-height: auto !important;
        padding: 40px 0 !important;
    }
    
    .about-us-container {
        margin-bottom: 2rem !important;
    }
    
    .about-content {
        max-width: 100% !important;
        padding: 1.5rem !important;
    }
    
    .about-slideshow-card {
        max-width: 100% !important;
    }
}

@media (max-width: 576px) {
    #mission-vision .display-5 {
        font-size: 1.8rem !important;
    }
    
    .about-content h3 {
        font-size: 1.4rem !important;
        line-height: 1.3;
    }
    
    .about-content p {
        font-size: 0.9rem !important;
        line-height: 1.6;
    }
    
    .feature-item {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .feature-icon {
        margin-bottom: 0.5rem !important;
    }
    
    .about-content .mt-4 {
        flex-direction: column;
        gap: 1rem;
    }
    
    .about-content .mt-4 .btn {
        width: 100%;
        text-align: center;
    }
    
    .about-slideshow-card {
        height: 300px !important;
    }
}

/* ===== WHY CHOOSE US RESPONSIVE ===== */
@media (max-width: 992px) {
    #why-choose-us .row.g-4 {
        gap: 1.5rem !important;
    }
}

@media (max-width: 576px) {
    #why-choose-us {
        padding: 2rem 0 !important;
    }
    
    #why-choose-us h2 {
        font-size: 1.8rem !important;
    }
    
    #why-choose-us .fs-5 {
        font-size: 1rem !important;
    }
    
    #why-choose-us .row.g-4,
    #why-choose-us .row.g-4.mt-4 {
        padding: 0 1rem;
    }
    
    #why-choose-us .card-body {
        padding: 1.5rem 1rem !important;
    }
    
    .choose-icon-circle {
        width: 60px !important;
        height: 60px !important;
    }
    
    .choose-icon-circle i {
        font-size: 1.8rem !important;
    }
    
    #why-choose-us .card h4 {
        font-size: 1.1rem !important;
    }
    
    #why-choose-us .card p {
        font-size: 0.85rem !important;
        margin-bottom: 1rem !important;
    }
    
    .choose-badge .badge {
        font-size: 0.75rem !important;
        padding: 0.4rem 0.8rem !important;
    }
}

/* ===== SWIPER MODAL RESPONSIVE ===== */
@media (max-width: 768px) {
    #swiperModal .modal-dialog {
        margin: 0;
        max-width: 100%;
        height: 100%;
    }
    
    #swiperModal .modal-content {
        height: 100%;
        border-radius: 0;
    }
    
    #swiperModal .modal-header {
        top: 10px;
        right: 10px;
        padding: 10px;
    }
    
    #swiperModal .btn-close-white {
        padding: 10px;
    }
    
    #swiperModal .carousel-control-prev,
    #swiperModal .carousel-control-next {
        width: 40px !important;
        height: 40px !important;
    }
    
    #swiperModal [class*="position-fixed"][style*="top: 30px"] {
        top: 15px !important;
        left: 15px !important;
        font-size: 0.9rem !important;
        padding: 8px 15px;
    }
    
    #swiperModal .carousel-item img {
        max-height: 70vh !important;
    }
}

@media (max-width: 480px) {
    #swiperModal .modal-body {
        padding: 2rem 0.5rem !important;
    }
    
    #swiperModal .carousel-indicators {
        margin-bottom: 1rem !important;
    }
    
    #swiperModal .carousel-indicators button {
        width: 10px !important;
        height: 10px !important;
    }
}

/* ===== MAP MODAL RESPONSIVE ===== */
@media (max-width: 768px) {
    #mapModal .modal-body {
        padding: 1rem;
    }
    
    #mapModal #map {
        height: 300px !important;
    }
}

/* ===== READING PROGRESS BAR Z-INDEX ===== */
.reading-progress {
    z-index: 10000;
}

/* ===== AD MODAL RESPONSIVE ===== */
@media (max-width: 768px) {
    #adModal .modal-dialog {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
    
    #adModal .modal-content {
        border-width: 2px !important;
    }
    
    #adModal .modal-body {
        padding: 1.5rem !important;
    }
    
    #adModal .modal-body .fs-5 {
        font-size: 1.1rem !important;
    }
    
    #adModal .modal-body h5 {
        font-size: 1.1rem !important;
        margin-top: 1rem !important;
    }
    
    #adModal ul {
        padding-left: 1rem !important;
    }
    
    #adModal li {
        font-size: 0.9rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    #adModal .fs-4,
    #adModal .fw-bold.fs-5 {
        font-size: 1rem !important;
    }
    
    #adModal .animate-fadeInUp.delay-1,
    #adModal .animate-fadeInUp.delay-2,
    #adModal .animate-fadeInUp.delay-3 {
        font-size: 0.9rem !important;
    }
}

@media (max-width: 480px) {
    #adModal .modal-dialog {
        margin: 0.5rem;
    }
    
    #adModal .modal-body {
        padding: 1rem !important;
    }
    
    #adModal .modal-body .fs-5 {
        font-size: 1rem !important;
    }
}

/* ===== SPECIAL OFFER BUTTON RESPONSIVE ===== */
@media (max-width: 768px) {
    #reopenAdModalBtn {
        bottom: 80px !important;
        right: 10px !important;
        padding: 10px 15px !important;
        font-size: 0.85rem !important;
    }
}