/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Montserrat:wght@400;500;600;700;800&display=swap');

/* Base Styles */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #0B132B;
    color: #F8F9FA;
}

/* Gradients and Patterns */
.gradient-text {
    background: linear-gradient(90deg, #3A86FF, #8338EC, #FF006E);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.gradient-bg {
    background: linear-gradient(135deg, #0B132B, #1C2541);
}

.card-gradient {
    background: linear-gradient(135deg, rgba(28, 37, 65, 0.8), rgba(11, 19, 43, 0.9));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(58, 134, 255, 0.2);
}

.hero-pattern {
    position: relative;
    overflow: hidden;
}

.hero-pattern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(58, 134, 255, 0.1) 1%, transparent 10%),
        radial-gradient(circle at 75% 75%, rgba(131, 56, 236, 0.1) 1%, transparent 10%),
        radial-gradient(circle at 50% 50%, rgba(255, 0, 110, 0.1) 1%, transparent 10%);
    background-size: 60px 60px, 80px 80px, 100px 100px;
    animation: move-pattern 20s linear infinite;
}

@keyframes move-pattern {
    from {
        background-position: 0 0, 0 0, 0 0;
    }

    to {
        background-position: 600px 600px, 800px 800px, 1000px 1000px;
    }
}

.grid-pattern {
    background-image: linear-gradient(rgba(58, 134, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(58, 134, 255, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Animations */
.floating {
    animation: float 6s ease-in-out infinite;
}

.floating-delay-1 {
    animation: float 6s ease-in-out 1s infinite;
}

.floating-delay-2 {
    animation: float 6s ease-in-out 2s infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }

    100% {
        transform: translateY(0px);
    }
}

/* Component Styles */
.service-card {
    transition: all 0.3s ease;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 25px -5px rgba(58, 134, 255, 0.1), 0 10px 10px -5px rgba(58, 134, 255, 0.04);
}

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

.service-card:hover .service-icon {
    transform: scale(1.2) rotate(10deg);
    color: #FF006E;
}

.mobile-nav {
    backdrop-filter: blur(10px);
    background: rgba(11, 19, 43, 0.8);
    border-top: 1px solid rgba(58, 134, 255, 0.2);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0B132B;
}

::-webkit-scrollbar-thumb {
    background: #3A86FF;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #8338EC;
}

/* Clip Paths */
.clip-path-slant {
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
}

.clip-path-slant-reverse {
    clip-path: polygon(0 15%, 100% 0, 100% 100%, 0 100%);
}

.hexagon {
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
}

/* Futuristic Header Styles */
.header-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.5s ease;
}

.header-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(10px);
    background: rgba(11, 19, 43, 0.7);
    z-index: -1;
}

.header-glow {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 1px;
    width: 100%;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(58, 134, 255, 0.5) 20%,
            rgba(131, 56, 236, 0.5) 50%,
            rgba(255, 0, 110, 0.5) 80%,
            transparent 100%);
    z-index: -1;
}

.nav-item {
    position: relative;
    transition: all 0.3s ease;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #3A86FF, #8338EC);
    transition: width 0.3s ease;
}

.nav-item:hover::after,
.nav-item.active::after {
    width: 100%;
}

.nav-item.active {
    color: #3A86FF;
}

.menu-blob {
    position: absolute;
    background: radial-gradient(circle, rgba(58, 134, 255, 0.2) 0%, rgba(131, 56, 236, 0.1) 70%, transparent 100%);
    border-radius: 50%;
    pointer-events: none;
    transition: all 0.5s ease;
    z-index: -1;
}

.logo-container {
    position: relative;
    overflow: hidden;
}

.logo-glow {
    position: absolute;
    width: 150%;
    height: 150%;
    top: -25%;
    left: -25%;
    background: radial-gradient(circle, rgba(58, 134, 255, 0.4) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.logo-container:hover .logo-glow {
    opacity: 1;
}

.header-animated-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
}

.header-particle {
    position: absolute;
    background-color: rgba(58, 134, 255, 0.3);
    border-radius: 50%;
    pointer-events: none;
}

/* Mobile Menu Animation */
.mobile-menu-enter {
    transform: translateY(-100%);
    opacity: 0;
}

.mobile-menu-enter-active {
    transform: translateY(0);
    opacity: 1;
    transition: all 0.3s ease;
}

.mobile-menu-exit {
    transform: translateY(0);
    opacity: 1;
}

.mobile-menu-exit-active {
    transform: translateY(-100%);
    opacity: 0;
    transition: all 0.3s ease;
}

/* Futuristic Menu Toggle */
.menu-toggle {
    width: 30px;
    height: 30px;
    position: relative;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    position: absolute;
    height: 2px;
    width: 100%;
    background: white;
    border-radius: 2px;
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    transition: .25s ease-in-out;
}

.menu-toggle span:nth-child(1) {
    top: 8px;
}

.menu-toggle span:nth-child(2),
.menu-toggle span:nth-child(3) {
    top: 16px;
}

.menu-toggle span:nth-child(4) {
    top: 24px;
}

.menu-toggle.open span:nth-child(1) {
    top: 16px;
    width: 0%;
    left: 50%;
}

.menu-toggle.open span:nth-child(2) {
    transform: rotate(45deg);
}

.menu-toggle.open span:nth-child(3) {
    transform: rotate(-45deg);
}

.menu-toggle.open span:nth-child(4) {
    top: 16px;
    width: 0%;
    left: 50%;
}

/* AI Meets Creativity Animation */
.ai-creativity-container {
    position: relative;
    width: 100%;
    height: 400px;
    /* Adjust as needed */
    overflow: hidden;
    border-radius: 16px;
    /* Tailwind's rounded-2xl */
    background: linear-gradient(135deg, rgba(11, 19, 43, 0.8), rgba(28, 37, 65, 0.9));
}

.ai-grid {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(58, 134, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(58, 134, 255, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.5;
}

.ai-node {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #3A86FF;
    /* accent color */
    border-radius: 50%;
    transform: scale(0);
    animation: nodeAppear 0.5s forwards;
}

@keyframes nodeAppear {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

.ai-connection {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, #3A86FF, #8338EC);
    /* accent to highlight */
    transform-origin: left center;
    opacity: 0;
    /* Start hidden */
}

@keyframes connectionGrow {
    0% {
        transform: scaleX(0);
        opacity: 0;
    }

    100% {
        transform: scaleX(1);
        opacity: 1;
    }
}

.creative-element {
    position: absolute;
    opacity: 0;
    /* Start hidden */
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.rotate {
    animation: rotate 10s linear infinite;
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.brain-container {
    position: absolute;
    top: 50%;
    left: 30%;
    /* Adjusted for balance */
    transform: translate(-50%, -50%);
    width: 120px;
    /* Adjust size as needed */
    height: 120px;
}

.brain {
    width: 100%;
    height: 100%;
    fill: url(#brain-gradient);
    filter: drop-shadow(0 0 8px rgba(58, 134, 255, 0.6));
}

.art-container {
    position: absolute;
    top: 50%;
    right: 30%;
    /* Adjusted for balance */
    transform: translate(50%, -50%);
    /* Corrected transform for right positioning */
    width: 120px;
    /* Adjust size as needed */
    height: 120px;
}

.art-palette {
    width: 100%;
    height: 100%;
    fill: url(#art-gradient);
    filter: drop-shadow(0 0 8px rgba(255, 0, 110, 0.6));
}

.connection-main {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40%;
    /* Span between brain and art */
    height: 4px;
    background: linear-gradient(90deg, #3A86FF, #FF006E);
    /* accent to energy */
    opacity: 0;
    /* Start hidden */
}

.data-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: white;
    top: calc(50% - 4px);
    /* Center on the line */
    left: 30%;
    /* Start position */
    opacity: 0;
    /* Start hidden */
}

@keyframes particleMove {
    0% {
        left: 30%;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        left: 70%;
        opacity: 0;
    }
}

.center-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, #8338EC, #FF006E);
    /* highlight to energy */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    opacity: 0;
    /* Start hidden */
    box-shadow: 0 0 20px rgba(131, 56, 236, 0.8);
}

.idea-spark {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #FFD700;
    /* Gold color for sparks */
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    /* Star shape */
    opacity: 0;
    /* Start hidden */
}

@keyframes sparkle {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }

    50% {
        transform: scale(1.2) rotate(180deg);
        opacity: 1;
    }

    100% {
        transform: scale(1) rotate(360deg);
        opacity: 0;
    }
}

.orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    /* Orbit diameter */
    height: 300px;
    border: 1px dashed rgba(58, 134, 255, 0.3);
    /* accent with opacity */
    border-radius: 50%;
    opacity: 0;
    /* Start hidden */
}

.orbit-particle {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #3A86FF;
    /* accent color */
    /* Positioned by JS */
    top: 0;
    /* Initial position for JS to take over */
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    /* Start hidden */
}

@keyframes orbit {
    0% {
        transform: rotate(0deg) translateX(150px) rotate(0deg);
    }

    /* 150px is radius of 300px orbit */
    100% {
        transform: rotate(360deg) translateX(150px) rotate(-360deg);
    }
}

/* --- Responsive Styles for Mobile --- */

/* Hide the entire AI animation container on screens smaller than 768px (tablets and phones) */
@media (max-width: 768px) {
    .ai-creativity-container {
        display: none;
    }
}

@media (max-width: 768px) {
    .w-full h-96 rounded-2xl overflow-hidden card-gradient grid-pattern {
        display: none;
    }
}

/* --- Final Clip-Path Stacking Fix --- */

/* This places the Services section on a higher visual layer, fixing the overlap 
   with the About section that comes after it. */
#services {
    position: relative;
    z-index: 5;
}

/* This does the same for the Portfolio section, fixing its overlap
   with the Contact section that follows. */
#portfolio {
    position: relative;
    z-index: 3;
}

/* --- Mobile Fix for Portfolio Hover Effect --- */

@media (max-width: 768px) {

    /* On mobile, disable the hover effect and make the "View Project" button always visible
       with a slightly transparent background for better readability. */
    .portfolio-item-overlay {
        opacity: 1 !important;
        /* Force visibility */
        background-color: rgba(11, 19, 43, 0.75) !important;
        /* Add a consistent background overlay */
    }
}

/* New styles for the tabbed services section */
.service-tabs-container {
    display: flex;
    justify-content: center;
    border-bottom: 2px solid #1C2541;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    /* Added for mobile responsiveness */
}

.service-tab-btn {
    padding: 1rem 1.5rem;
    cursor: pointer;
    position: relative;
    font-weight: 600;
    color: #9ca3af;
    transition: color 0.3s ease;
    margin-bottom: 0.5rem;
    /* Added margin for mobile wrap */
}

.service-tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: transparent;
    transition: background-color 0.3s ease;
}

.service-tab-btn.active {
    color: #F8F9FA;
}

.service-tab-btn.active::after {
    background-color: #3A86FF;
}

/* New styles for a better grid layout in the solutions section */
.service-content-grid {
    display: none;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.service-content-grid.active {
    display: grid;
    animation: fadeIn 0.5s ease-in-out;
}

@media (min-width: 1024px) {
    .service-content-grid.active {
        grid-template-columns: 2fr 1fr;
        /* 2/3 text, 1/3 placeholder */
        gap: 4rem;
    }
}

.service-feature {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.service-feature-icon {
    color: #3A86FF;
    font-size: 1.5rem;
    margin-right: 1rem;
    min-width: 1.5rem;
}

.placeholder-box {
    background: linear-gradient(135deg, rgba(28, 37, 65, 0.8), rgba(11, 19, 43, 0.9));
    border-radius: 0.5rem;
    border: 1px solid rgba(58, 134, 255, 0.2);
    height: 100%;
    min-height: 200px;
}


/* Accordion-specific styles */
.accordion-item {
    background-color: #1C2541;
    border: 1px solid rgba(58, 134, 255, 0.2);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.accordion-header {
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.25rem;
    font-weight: 600;
    color: #F8F9FA;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.accordion-header:hover {
    background-color: #3A86FF;
    color: #0B132B;
}

.accordion-header:hover .accordion-icon {
    color: #0B132B;
}

.accordion-icon {
    font-size: 1.5rem;
    transition: transform 0.3s ease, color 0.3s ease;
    color: #3A86FF;
}

.accordion-content {
    background-color: #0B132B;
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s ease-out;
}

/* The content wrapper now handles the padding, making the animation smoother */
.accordion-content-wrapper {
    overflow: hidden;
    padding: 0 1.5rem;
}

.accordion-content.open {
    grid-template-rows: 1fr;
}

.accordion-content.open .accordion-content-wrapper {
    padding: 1.25rem 1.5rem;
    /* Animation for content inside the accordion */
    animation: fadeIn 0.5s ease-in-out;
}

.accordion-header.active {
    background-color: #3A86FF;
    color: #0B132B;
}

.accordion-header.active .accordion-icon {
    transform: rotate(180deg);
    color: #0B132B;
}

/* --- New Contact Form Styles --- */

/* Style for the pills of selected services */
.service-pill {
    display: inline-flex;
    align-items: center;
    background-color: rgba(58, 134, 255, 0.2);
    /* bg-accent/20 */
    color: #F8F9FA;
    /* light color */
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    /* rounded-full */
    font-size: 0.875rem;
    /* text-sm */
    font-weight: 500;
    /* font-medium */
}

.service-pill .remove-service-btn {
    margin-left: 0.5rem;
    color: #9ca3af;
    /* text-gray-400 */
    cursor: pointer;
    transition: color 0.2s ease;
}

.service-pill .remove-service-btn:hover {
    color: #FF006E;
    /* energy color */
}

/* Style for the services dropdown */
#services-dropdown div {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#services-dropdown div:hover {
    background-color: rgba(58, 134, 255, 0.1);
    /* bg-accent/10 */
}

/* Style for hiding already selected services in the dropdown */
#services-dropdown div.selected {
    display: none;
}

/* Validation Styles */
.form-input.invalid {
    border-color: #f87171;
    /* red-400 */
}

.error-message {
    display: none;
    /* Hidden by default */
}

.error-message.show {
    display: block;
    /* Show when there's an error */
}

/* --- Contact Form Submission Styles --- */

/* Success Message Overlay */
#success-message {
    display: flex;
    /* Use flex to center content */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#success-message.show {
    opacity: 1;
    visibility: visible;
}

/* Validation Styles */
.form-input.invalid {
    border-color: #f87171;
    /* red-400 */
}

.error-message {
    display: none;
    /* Hidden by default */
}

.error-message.show {
    display: block;
    /* Show when there's an error */
}