@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Brand Colors */
    --openiot-brand: #2EAD62;
    --openiot-brand-dark: #248f50;
    --openiot-brand-light: #e8f5e9;

    /* Neutrals */
    --openiot-dark: #101318;
    /* Deep Graphite */
    --openiot-body: #1C1F26;
    /* Primary Text */
    --openiot-muted: #5e6b7c;
    /* Secondary Text */
    --openiot-border: #e2e5e9;
    /* Subtle Borders */
    --openiot-bg-light: #f9fafb;
    /* Section Backgrounds */
    --openiot-white: #ffffff;

    /* Shadows (Premium Multi-layer) */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--openiot-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* --- Typography Utilities --- */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--openiot-dark);
    font-weight: 700;
    letter-spacing: -0.02em;
    /* Tight tracking for modern feel */
}

.text-brand {
    color: var(--openiot-brand) !important;
}

.text-muted {
    color: var(--openiot-muted) !important;
}

.section-eyebrow {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    color: var(--openiot-brand);
    margin-bottom: 1rem;
    display: block;
}

.display-hero {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.lead-hero {
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--openiot-muted);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* --- Buttons (Pill shape, smooth transition) --- */
.btn {
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    /* Pill shape */
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--openiot-brand);
    border-color: var(--openiot-brand);
    box-shadow: 0 4px 6px rgba(46, 173, 98, 0.25);
}

.btn-primary:hover {
    background-color: var(--openiot-brand-dark);
    border-color: var(--openiot-brand-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px rgba(46, 173, 98, 0.3);
}

.btn-outline-dark {
    border-color: var(--openiot-border);
    color: var(--openiot-body);
}

.btn-outline-dark:hover {
    background-color: var(--openiot-dark);
    border-color: var(--openiot-dark);
    color: #fff;
}

/* --- Navbar (Glassmorphism / Sticky) --- */
.navbar {
    background: rgba(255, 255, 255, 1);
    /* Solid white on mobile/scrolled */
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem 0;
    z-index: 1050 !important;
    height: 72px;
    /* Fixed height for consistent menu positioning */
    display: flex;
    align-items: center;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.nav-link {
    font-weight: 500;
    color: var(--openiot-body) !important;
    font-size: 0.95rem;
    padding: 0.5rem 1rem !important;
}

.nav-link:hover {
    color: var(--openiot-brand) !important;
}

.dropdown-toggle::after {
    display: none !important;
}

/* --- Hero Section --- */
.hero-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 80px 0;
    /* Reduced padding since we have flex centering */
    /* Remove default background so slideshow is visible */
    background: #1C1F26;
    position: relative;
    overflow: hidden;
}

/* Dark Overlay */
.hero-wrapper::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    /* Dark overlay for text readability */
    background: rgba(0, 0, 0, 0.6);
    z-index: 1;
    /* Above slideshow, below content */
    pointer-events: none;
}

/* Slideshow Container */
.hero-bg-slideshow {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
    /* Base layer */
    overflow: hidden;
}

/* Individual Slides */
.hero-bg-slideshow .slide-item {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    animation: slideShowAnimation 12s infinite;
    /* 4 images * (2s hold + 1s fade approx) = 12s total cycle? 
       User wants 2s hold. Let's do 3s per slide (2s visible + 1s transition). 
       Total 12s. 
       0-16%: fade in? No. 
       Let's stick to a standard crossfade keyframe for 4 items.
    */
}

/* Stagger animations */
.hero-bg-slideshow .slide-item:nth-child(1) {
    animation-delay: 0s;
}

.hero-bg-slideshow .slide-item:nth-child(2) {
    animation-delay: 3s;
}

.hero-bg-slideshow .slide-item:nth-child(3) {
    animation-delay: 6s;
}

.hero-bg-slideshow .slide-item:nth-child(4) {
    animation-delay: 9s;
}

@keyframes slideShowAnimation {
    0% {
        opacity: 0;
    }

    8% {
        opacity: 1;
    }

    /* Fade in (1s) */
    25% {
        opacity: 1;
    }

    /* Stay (2s) -> 3s total = 25% of 12s */
    33% {
        opacity: 0;
    }

    /* Fade out (1s) */
    100% {
        opacity: 0;
    }
}

.hero-content {
    position: relative;
    z-index: 2;
    /* Content on top */
}

/* Force white text in hero for contrast against dark slides */
.hero-content h1,
.hero-content p,
.hero-content .text-muted {
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-content .text-brand {
    color: #4ade80 !important;
    /* Lighter green for dark bg */
}


/* --- Cards (Ecosystem & Features) --- */
.card {
    border: 1px solid var(--openiot-border);
    border-radius: 12px;
    background: var(--openiot-white);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Hover Lift Effect */
.hover-lift:hover,
.ecosystem-card:hover,
.feature-card-wide:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover) !important;
    border-color: transparent;
}

.ecosystem-card {
    padding: 2rem 1.5rem;
    height: 100%;
}

.feature-card-wide {
    padding: 2rem;
}

.icon-box {
    width: 64px;
    height: 64px;
    background: var(--openiot-brand-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--openiot-brand);
    font-size: 1.75rem;
}

/* --- Dashboard Section --- */
.dashboard-display {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--openiot-border);
}

.nav-pills .nav-link {
    border-radius: 8px;
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: var(--openiot-muted);
}

.nav-pills .nav-link.active {
    background-color: var(--openiot-brand-light);
    color: var(--openiot-brand-dark);
    box-shadow: none;
}

/* --- Footer --- */
footer {
    background: var(--openiot-dark);
    color: #9ca3af;
    padding-top: 5rem;
    padding-bottom: 2rem;
}

footer h5,
footer h6 {
    color: #fff;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

footer a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.2s;
}

footer a:hover {
    color: #fff;
}

footer .form-control {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}

footer .form-control:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--openiot-brand);
    box-shadow: none;
}

/* --- Utilities --- */
.section-padding {
    padding: 5rem 0;
}

.bg-subtle {
    background-color: var(--openiot-bg-light);
}

/* --- Logo Slider --- */
.logo-slider {
    overflow: hidden;
    padding: 3rem 0;
    white-space: nowrap;
    position: relative;
}

.logo-slider::before,
.logo-slider::after {
    content: "";
    position: absolute;
    top: 0;
    width: 100px;
    height: 100%;
    z-index: 2;
}

.logo-slider::before {
    left: 0;
    background: linear-gradient(to right, white 0%, transparent 100%);
}

.logo-slider::after {
    right: 0;
    background: linear-gradient(to left, white 0%, transparent 100%);
}

.logo-slide-track {
    display: inline-block;
    animation: scroll 30s linear infinite;
}

.logo-slide {
    display: inline-block;
    padding: 0 40px;
}

.logo-slide img {
    height: 40px;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: all 0.3s ease;
}

.logo-slide:hover img {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.1);
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }

    /* Move half way (one set of logos) */
}

/* --- Mega Menu Premium UI --- */

/* Desktop Styles (992px and up) */
@media (min-width: 992px) {
    .dropdown-mega {
        position: static !important;
    }

    .dropdown-mega .dropdown-menu {
        border: 1px solid rgba(0, 0, 0, 0.05) !important;
        border-top: 4px solid var(--openiot-brand) !important;
        background: #ffffff;
        min-width: 1200px;
        padding: 2.5rem !important;
        border-radius: 1.25rem !important;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15) !important;
        margin-top: 10px !important;
        /* Slightly reduced gap */
        left: 50% !important;
        transform: translateX(-50%) translateY(10px) !important;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
        display: block !important;
        pointer-events: none;
    }

    /* Invisible bridge to prevent menu from closing when moving mouse through the gap */
    .dropdown-mega .dropdown-menu::before {
        content: "";
        position: absolute;
        top: -20px;
        left: 0;
        width: 100%;
        height: 20px;
        background: transparent;
    }

    .dropdown-mega:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0) !important;
        pointer-events: auto;
    }
}

/* Mobile & Tablet Styles (up to 991.98px) - Modern Side-Slide UX */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: #fff;
        position: fixed;
        top: 72px;
        /* Start below navbar */
        right: -100%;
        /* Slide entire menu out */
        width: 100%;
        height: calc(100vh - 72px);
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: block !important;
        padding: 0 !important;
        /* More space for header */
        z-index: 1040;
        /* Just below main navbar header */
        overflow: hidden;
    }

    .navbar-collapse.show {
        right: 0;
    }

    .navbar-nav {
        padding: 1rem !important;
        height: 100%;
        overflow-y: auto;
        background: #f8fafc;
        /* Subtle background for the menu area */
    }

    .navbar-nav .nav-item {
        margin-bottom: 0.75rem;
    }

    /* Main Menu Item Styling (Unified with Submenu items) */
    .navbar-nav .nav-link {
        background: #fff;
        padding: 1.25rem 1.5rem !important;
        border-radius: 12px;
        color: var(--openiot-dark) !important;
        font-weight: 600;
        font-size: 1.05rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
        border: 1px solid #edf2f7;
        transition: all 0.2s ease;
    }

    .navbar-nav .nav-link:active {
        background: #f1f5f9;
        transform: scale(0.98);
    }

    /* Add custom arrow to main menu items that have dropdowns */
    .navbar-nav .dropdown-toggle::after {
        display: inline-block !important;
        content: "";
        width: 0.5rem;
        height: 0.5rem;
        border-right: 2px solid #cbd5e0;
        border-bottom: 2px solid #cbd5e0;
        transform: rotate(-45deg);
        margin-left: 10px;
        transition: transform 0.3s ease;
    }

    /* Hide hardcoded chevrons in HTML to avoid duplicates */
    .navbar-nav .nav-link i.bi-chevron-down {
        display: none !important;
    }

    /* Submenu (Mega Menu) Mobile Styling */
    .dropdown-mega .dropdown-menu {
        position: fixed !important;
        top: 72px !important;
        left: 100%;
        /* Off-screen right */
        width: 100% !important;
        height: calc(100vh - 72px);
        background: #fff;
        z-index: 1060;
        /* Higher than everything to overlay */
        display: none !important;
        /* Start hidden */
        padding: 0 !important;
        margin: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        /* Enable scrolling for long menus */
    }

    /* When submenu is active */
    .dropdown-mega .dropdown-menu.active-submenu {
        display: block !important;
        left: 0;
    }

    /* Back Button inside submenu */
    .cc-menu-back {
        position: sticky;
        top: 0;
        left: 0;
        display: flex !important;
        align-items: center;
        background: #fff;
        color: var(--openiot-brand) !important;
        padding: 1.25rem 1.5rem;
        width: 100%;
        font-weight: 700;
        font-size: 1.1rem;
        cursor: pointer;
        border-bottom: 2px solid #f1f5f9;
        z-index: 110;
        border-radius: 0;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    }

    .cc-menu-back svg {
        margin-right: 12px;
        width: 20px;
        height: 20px;
    }

    /* List items in submenus */
    .dropdown-menu .row {
        padding: 1.5rem !important;
        margin: 0 !important;
        display: block !important;
    }

    .dropdown-menu .col-lg-4,
    .dropdown-menu .col-lg-3 {
        width: 100% !important;
        padding: 0 !important;
    }

    .mega-menu-item {
        background: #fff;
        padding: 1.25rem 1.5rem;
        margin-bottom: 0.75rem;
        border-radius: 12px;
        display: block;
        text-decoration: none;
        border: 1px solid #edf2f7;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    }

    .mega-icon-wrapper {
        display: none !important;
    }

    .mega-title {
        font-size: 1.05rem;
        font-weight: 600;
        color: var(--openiot-dark);
        margin: 0;
    }

    .mega-desc {
        display: none;
    }

    /* Language dropdown fix */
    .dropdown:not(.dropdown-mega) .dropdown-menu {
        position: static !important;
        display: none;
        border: 0;
        padding-left: 1rem !important;
        box-shadow: none !important;
    }

    .dropdown:not(.dropdown-mega) .dropdown-menu.show {
        display: block !important;
    }

    /* Hero Section Responsive */
    .hero-content {
        padding: 0 1rem;
        z-index: 2;
        position: relative;
    }

    .hero-content img {
        height: 80px !important;
        margin-bottom: 1.5rem !important;
    }

    .display-hero {
        font-size: 1.85rem;
        line-height: 1.3;
        margin-bottom: 1rem;
        font-weight: 800;
    }

    .lead-hero {
        font-size: 0.95rem;
        line-height: 1.6;
        margin-bottom: 2.5rem !important;
        opacity: 0.9;
    }

    .hero-content .d-flex {
        flex-direction: column !important;
        gap: 1rem !important;
        padding: 0 1rem;
    }

    .hero-content .btn {
        width: 100% !important;
        padding: 1rem !important;
        font-size: 1rem !important;
    }
}

.mega-menu-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-radius: 1rem;
    transition: all 0.2s ease;
    text-decoration: none;
    color: var(--openiot-body);
    height: 100%;
}

.mega-menu-item:hover {
    background: #f8fafc;
    transform: translateY(-2px);
}

.mega-icon-wrapper {
    width: 2.8rem;
    height: 2.8rem;
    background: #f1f5f9;
    border-radius: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1.4rem;
    flex-shrink: 0;
    color: var(--openiot-dark);
    transition: all 0.3s ease;
}

.mega-menu-item:hover .mega-icon-wrapper {
    background: var(--openiot-brand);
    color: white;
    box-shadow: 0 10px 15px -3px rgba(46, 173, 98, 0.3);
}

.mega-icon-wrapper img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    display: block;
    transition: all 0.3s ease;
}

.mega-menu-item:hover .mega-icon-wrapper img {
    transform: scale(1.1);
}

.mega-content {
    flex-grow: 1;
}

.mega-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.15rem;
    color: var(--openiot-dark);
    display: block;
}

.mega-desc {
    font-size: 0.75rem;
    color: var(--openiot-muted);
    font-weight: 400;
    line-height: 1.3;
}

.mega-section-title {
    font-size: 0.75rem;
    font-weight: 800;
    color: #94a3b8;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    padding-left: 0.5rem;
}

.mega-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #e2e8f0, transparent);
    margin: 2rem 0;
    border: 0;
}