/* Base styles to prevent horizontal scroll */
* {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    max-width: 100%;
}

body {
    margin: 0;
    padding: 0;
}

/* Prevent any element from causing horizontal scroll */
.container, .w-10\/12, [class*="w-"] {
    max-width: 100%;
}

/* Fade-in animations */
.fade-in-section {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animation delays for child elements */
.fade-in-section .fade-in-item {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-section.is-visible .fade-in-item:nth-child(1) {
    transition-delay: 0.1s;
}

.fade-in-section.is-visible .fade-in-item:nth-child(2) {
    transition-delay: 0.2s;
}

.fade-in-section.is-visible .fade-in-item:nth-child(3) {
    transition-delay: 0.3s;
}

.fade-in-section.is-visible .fade-in-item:nth-child(4) {
    transition-delay: 0.4s;
}

.fade-in-section.is-visible .fade-in-item:nth-child(5) {
    transition-delay: 0.5s;
}

.fade-in-section.is-visible .fade-in-item:nth-child(6) {
    transition-delay: 0.6s;
}

.fade-in-section.is-visible .fade-in-item {
    opacity: 1;
    transform: translateY(0);
}

/* Hero section specific animation */
.hero-content {
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

.hero-content.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-content .hero-item {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.hero-content.is-visible .hero-item:nth-child(1) {
    transition-delay: 0.2s;
}

.hero-content.is-visible .hero-item:nth-child(2) {
    transition-delay: 0.4s;
}

.hero-content.is-visible .hero-item:nth-child(3) {
    transition-delay: 0.6s;
}

.hero-content.is-visible .hero-item {
    opacity: 1;
    transform: translateY(0);
}

/* Desktop hover effects only */
@media (min-width: 769px) {
    .service-card:hover {
        z-index: 10001;
    }

    .service-card .service-content {
        transition: all 0.3s ease;
    }

    .service-hover-content {
        background: #F86907;
        color: white;
        padding: 2rem;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        height: 535px;
        opacity: 0;
        transform: translateY(100%);
        transition: all 0.3s ease;
        position: absolute;
        top: 50%;
        left: 0;
        right: 0;
        transform-origin: center;
        margin-top: -267.5px;
        z-index: 10000;
    }

    .service-card:hover .service-hover-content {
        opacity: 1;
        transform: translateY(-50%);
    }

    .service-card:hover .service-content {
        opacity: 0;
        transform: translateY(-100%);
    }
}

/* Ensure services grid maintains spacing */
.services-grid {
    position: relative;
}

.services-grid .service-card {
    overflow: visible;
}

/* Upper row cards - hover content starts from top of card */
.services-grid .service-card:nth-child(1) .service-hover-content,
.services-grid .service-card:nth-child(2) .service-hover-content,
.services-grid .service-card:nth-child(3) .service-hover-content {
    top: 0;
    margin-top: 0;
}

.services-grid .service-card:nth-child(1):hover .service-hover-content,
.services-grid .service-card:nth-child(2):hover .service-hover-content,
.services-grid .service-card:nth-child(3):hover .service-hover-content {
    transform: translateY(0);
}

/* Lower row cards - hover content should touch the top of .services-grid (desktop only) */
@media (min-width: 769px) {
    .services-grid .service-card:nth-child(4) .service-hover-content,
    .services-grid .service-card:nth-child(5) .service-hover-content,
    .services-grid .service-card:nth-child(6) .service-hover-content {
        top: 0;
        margin-top: -264px; /* Move up by one card height to touch grid top */
    }
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
    }

    /* Fix container widths */
    .w-10\/12 {
        width: 95%;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .hero-content {
        padding: 1rem;
        max-width: 100%;
    }

    .services-grid {
        grid-template-columns: 1fr;
        width: 100%;
        max-width: 100%;
    }

    .service-card {
        height: auto;
        min-height: 250px;
        padding: 1.5rem;
        width: 100%;
        max-width: 100%;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .service-card h3 {
        font-size: 0.875rem;
        line-height: 1.2;
        margin-bottom: 1rem;
        word-wrap: break-word;
        hyphens: auto;
    }

    .service-card .service-content {
        gap: 1rem;
    }

    .service-card img {
        width: 4rem;
        height: 4rem;
    }

    /* Header adjustments */
    header .flex {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Mobile click effects - replace hover with click */
    .service-hover-content {
        display: none;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        opacity: 0;
        transition: all 0.3s ease;
    }

    /* Make services-grid relative for absolute positioning */
    .services-grid {
        position: relative;
    }

    /* Active state for clicked cards - overlays on top */
    .service-card.mobile-active {
        background: #F86907 !important;
        color: white !important;
        padding: 2rem !important;
        z-index: 999 !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        min-height: 450px !important;
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        border-radius: 0.5rem; 
    }

    .service-card.mobile-active .service-content {
        /* opacity: 0.3; */
        position: relative;
        z-index: 1;
        transition: opacity 0.3s ease;
    }

    .service-card.mobile-active .service-hover-content {
        display: flex !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        background: rgba(248, 105, 7, 0.95) !important;
        padding: 2rem !important;
        height: 100% !important;
        opacity: 1 !important;
        transform: none !important;
        margin-top: 0;
        max-width: 100%;
        text-align: center;
        width: 100%;
        z-index: 2;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        border-radius: 0.5rem;
    }

    .service-card.mobile-active .service-hover-title {
        color: white;
        font-size: 1rem;
        font-weight: 600;
        text-transform: uppercase;
        margin-bottom: 1rem;
        line-height: 1.3;
    }

    .service-card.mobile-active .service-hover-description {
        color: white;
        font-size: 0.875rem;
        line-height: 1.4;
        margin-bottom: 1.5rem;
    }

    .service-card.mobile-active .service-hover-button {
        background: rgba(255, 255, 255, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.3);
        color: white;
        padding: 0.75rem 1.5rem;
        border-radius: 0.5rem;
        font-weight: 500;
        font-size: 0.875rem;
        display: inline-block;
        text-decoration: none;
        margin-bottom: 2rem;
    }

    /* Close button for mobile active cards */
    .service-card.mobile-active::before {
        content: "×";
        position: absolute;
        top: 1rem;
        right: 1rem;
        font-size: 2rem;
        color: white;
        cursor: pointer;
        z-index: 10000;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.2);
        border-radius: 50%;
    }

    /* Reset desktop hover styles for cards 4, 5, 6 on mobile */
    .services-grid .service-card:nth-child(4) .service-hover-content,
    .services-grid .service-card:nth-child(5) .service-hover-content,
    .services-grid .service-card:nth-child(6) .service-hover-content {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        margin-top: 0 !important;
        z-index: 2 !important;
        transform: none !important;
        background: rgba(248, 105, 7, 0.95) !important;
        display: none !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 2rem !important;
        border-radius: 0.5rem !important;
        width: 100% !important;
        height: 100% !important;
        opacity: 0 !important;
        transition: all 0.3s ease !important;
        text-align: center !important;
    }

    /* Active state for cards 4, 5, 6 on mobile */
    .services-grid .service-card:nth-child(4).mobile-active .service-hover-content,
    .services-grid .service-card:nth-child(5).mobile-active .service-hover-content,
    .services-grid .service-card:nth-child(6).mobile-active .service-hover-content {
        display: flex !important;
        opacity: 1 !important;
    }

    .services-grid .service-card:nth-child(4).mobile-active,
    .services-grid .service-card:nth-child(5).mobile-active,
    .services-grid .service-card:nth-child(6).mobile-active {
        background: #F86907 !important;
        color: white !important;
        padding: 2rem !important;
        z-index: 999 !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        min-height: 450px !important;
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        border-radius: 0.5rem;
    }

    .services-grid .service-card:nth-child(4).mobile-active .service-content,
    .services-grid .service-card:nth-child(5).mobile-active .service-content,
    .services-grid .service-card:nth-child(6).mobile-active .service-content {
        /* opacity: 0.3; */
        position: relative !important;
        z-index: 1 !important;
    }

}

/* Extra small screens */
@media (max-width: 480px) {
    .w-10\/12 {
        width: 100%;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .hero-content {
        padding: 0.75rem;
    }

    .service-card {
        padding: 1rem;
        min-height: 220px;
    }

    .service-card h3 {
        font-size: 0.8rem;
        line-height: 1.1;
    }
}

/* Desktop hover effects for lower row cards */
@media (min-width: 769px) {
    .services-grid .service-card:nth-child(4):hover,
    .services-grid .service-card:nth-child(5):hover,
    .services-grid .service-card:nth-child(6):hover {
        z-index: 10002;
    }

    .services-grid .service-card:nth-child(4):hover .service-hover-content,
    .services-grid .service-card:nth-child(5):hover .service-hover-content,
    .services-grid .service-card:nth-child(6):hover .service-hover-content {
        z-index: 10003;
        transform: translateY(0);
    }
}

.service-hover-title {
    font-size: 1.125rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.service-hover-description {
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 2rem;
}

.service-hover-button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.service-hover-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Modal Styles */
.modal-overlay {
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

.modal-overlay.hidden {
    display: none !important;
}

.modal-content {
    animation: slideIn 0.3s ease-out;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Close button hover effect */
#closeModal:hover {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Notification styles */
.notification {
    animation: slideInRight 0.3s ease-out;
    transition: opacity 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Form loading states */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Form validation styles */
.form-error {
    border-color: #ef4444 !important;
}

.form-success {
    border-color: #10b981 !important;
}

/* Pulse animation for presentation button */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(248, 105, 7, 0.4);
    }
    70% {
        transform: scale(1.03);
        box-shadow: 0 0 0 10px rgba(248, 105, 7, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(248, 105, 7, 0);
    }
}

.presentation-btn {
    display: inline-block;
    color: white;
    background-color: #F86907;
    border: 2px solid #F86907;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: pulse 2s infinite;
}

.presentation-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(248, 105, 7, 0.3);
    background-color: #ff7b1c;
    border-color: #ff7b1c;
}

.presentation-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(248, 105, 7, 0.3);
}