/* CSS Variables & Design System */
:root {
    --primary-color: #0A1A2F;
    /* Dark Blue */
    --secondary-color: #6E7A88;
    /* Gray */
    --white: #FFFFFF;
    /* White */
    --accent-color: #4CAF50;
    /* Green */

    /* Typography */
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Hierarchy */
    --h1-size: clamp(36px, 10vw, 48px);
    --h2-size: clamp(28px, 8vw, 32px);
    --h3-size: clamp(20px, 6vw, 24px);
    --body-size: clamp(16px, 4vw, 18px);

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 8rem;

    /* Effects */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --glass-blur: blur(10px);

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: var(--body-size);
    line-height: 1.6;
    color: var(--white);
    background-color: var(--primary-color);
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
.heading-font {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
}

h1 {
    font-size: var(--h1-size);
}

h2 {
    font-size: var(--h2-size);
}

h3 {
    font-size: var(--h3-size);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Utility Classes */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.section-padding {
    padding: var(--spacing-xl) 0;
}

.text-gray {
    color: var(--secondary-color);
}

.text-accent {
    color: var(--accent-color);
}

.bg-dark {
    background-color: var(--primary-color);
}

.bg-gray {
    background-color: #1a2a3f;
}

#about .grid {
    background: transparent;
    backdrop-filter: none;
    border: none;
    box-shadow: none;
    padding: 0;
}

#services .container>.grid {
    padding: 2rem;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 16px 64px 0 rgba(0, 0, 0, 0.3);
    border-radius: 24px;
}

#services.section-padding {
    padding: 4rem 0;
}

#services h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

#services p {
    font-size: 0.95rem;
}

#services img {
    max-height: 350px;
    object-fit: cover;
    margin: 0 auto;
}

/* Darker gray variant for backgrounds */

/* Glassmorphism */
.glass,
.glass-section {
    background: rgba(15, 25, 45, 0.7);
    /* More solid background for better perf */
    backdrop-filter: blur(10px);
    /* Reduced blur */
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 16px 64px 0 rgba(0, 0, 0, 0.3);
    border-radius: 24px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background-color: var(--accent-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: #45a049;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(76, 175, 80, 0.3);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--white);
    color: var(--white);
}

.btn-outline:hover {
    background-color: var(--white);
    color: var(--primary-color);
    transform: translateY(-3px);
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity, transform;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle .bar {
    height: 3px;
    width: 100%;
    background-color: var(--white);
    border-radius: 3px;
    transition: var(--transition);
}

.menu-toggle.is-active .bar:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.menu-toggle.is-active .bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.is-active .bar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Header */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 0;
    transition: var(--transition);
}

header.scrolled {
    background: rgba(10, 26, 47, 0.98);
    backdrop-filter: blur(15px);
    padding: 0.8rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 95%;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--white);
}

.logo span {
    color: var(--accent-color);
}

.nav-links {
    display: flex;
    gap: 1.8rem;
    align-items: center;
}

.nav-links li {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-links a {
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.nav-links a:hover {
    color: var(--accent-color);
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 250px;
    background: rgba(10, 26, 47, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-menu li {
    padding: 0;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1.5rem;
    font-size: 0.95rem;
    color: var(--white);
    transition: var(--transition);
}

.dropdown-menu a i {
    width: 20px;
    color: var(--accent-color);
    text-align: center;
}

.dropdown-menu a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-color);
    padding-left: 2rem;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    background: linear-gradient(rgba(10, 26, 47, 0.5), rgba(10, 26, 47, 0.5)), url('../assets/Background_HighRes.png') center/cover;
}

.hero-content {
    max-width: 800px;
}

.hero h1 {
    margin-top: 4rem;
    /* Push it down away from header/dropdown */
    margin-bottom: 1rem;
    /* Keep it close to the text below */
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 3rem;
    color: var(--white);
    font-weight: 500;
}

.hero-btns {
    display: flex;
    gap: 1.5rem;
}

/* Grid Layouts */
.grid {
    display: grid;
    gap: 2rem;
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

/* Feature Cards */
.feature-card {
    padding: 2.5rem 2rem;
    text-align: left;
    transition: var(--transition);
    background: transparent;
}

.feature-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.feature-card p {
    font-size: 0.9rem;
    line-height: 1.4;
}

.feature-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-10px);
}

.icon-box {
    width: 48px;
    height: 48px;
    background: rgba(76, 175, 80, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    color: var(--accent-color);
    font-size: 1.5rem;
}

/* Brand Cards */
.brand-card {
    padding: 2rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
    transition: var(--transition);
}

.brand-card h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--white);
    opacity: 0.8;
}

.brand-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.brand-card:hover h3 {
    opacity: 1;
    color: var(--accent-color);
}

/* Partner Boxes Hover */
.partner-box {
    transition: var(--transition);
}

.partner-box:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    border-left-width: 8px !important;
}

/* Footer */
footer {
    border-top: 1px solid var(--glass-border);
    padding: 4rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-info p {
    margin-top: 1rem;
    color: var(--secondary-color);
}

.footer-links h4 {
    margin-bottom: 1.5rem;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-bottom {
    text-align: center;
    color: var(--secondary-color);
    font-size: 0.9rem;
    border-top: 1px solid var(--glass-border);
    padding-top: 2rem;
}

/* Responsive */
@media (max-width: 992px) {
    .menu-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        max-width: 100%; /* Ensure full width overlay to center content perfectly */
        height: 100vh;
        background: rgba(10, 26, 47, 0.98);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding-top: 100px; /* Space for header */
        overflow-y: auto;   /* Allow scrolling inside the menu instead of covering items */
        transition: right 0.4s ease;
        z-index: 1000;
        box-shadow: -5px 0 20px rgba(0,0,0,0.5);
    }
    
    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        margin: 1.5rem 0;
        width: 100%;
        flex-direction: column;  /* Stack dropdown below link */
        align-items: center;     /* Center link perfectly */
    }
    
    .nav-links li > a {
        display: flex;
        justify-content: center;
        width: 100%;
    }
    .dropdown-menu {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 12px;
        box-shadow: none;
        border: none;
        display: none;
        padding: 1rem;
        margin: 0.5rem auto 0 auto; /* Center the box */
        width: 90%;
        max-width: 320px; /* Constrain width so it forms a nice neat centered block */
        box-sizing: border-box;
    }
    
    .dropdown.active .dropdown-menu,
    .dropdown:hover .dropdown-menu {
        display: block;
        transform: none !important; /* Prevents shifting when touched (desktop hover conflict) */
        animation: fadeIn 0.3s ease;
    }

    .nav-links .dropdown-menu li {
        margin: 0.5rem 0; /* Tighter vertical spacing */
        width: 100%;
        align-items: flex-start; /* Reset align items to not stretch */
    }
    
    .dropdown-menu a {
        display: flex;
        justify-content: flex-start; /* Align left inside the centered box for neat reading */
        align-items: center;
        padding: 0.5rem 1rem;
        font-size: 0.95rem;
        color: rgba(255, 255, 255, 0.9);
    }

    .dropdown-menu a:hover {
        padding-left: 1rem; /* Prevent shifting */
        background: transparent;
    }
    
    .desktop-only-btn {
        display: none !important;
    }
    
    .mobile-only-btn {
        display: block !important;
        margin-top: 1rem !important;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        width: 100%;
    }

    /* Fix horizontal scroll and overflowing grids */
    .grid, .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    /* Scaling down typography and spacing for mobile */
    h1 { font-size: clamp(28px, 8vw, 34px); }
    h2 { font-size: clamp(22px, 6vw, 26px); }
    h3 { font-size: clamp(18px, 5vw, 20px); }
    
    .section-padding {
        padding: 3rem 0;
    }

    /* Homepage Hero layout fix - reducing the top gap */
    .hero {
        height: auto;
        min-height: 100vh;
        padding-top: 100px;
        padding-bottom: 50px;
    }

    .hero h1 {
        margin-top: 1rem;
    }

    .hero-content {
        text-align: center;
    }

    .hero-btns {
        flex-direction: column;
        align-items: stretch;
    }
    
    .hero-btns .btn {
        text-align: center;
        width: 100%;
        margin-bottom: 0.5rem;
    }

    /* Prevent iOS auto-zoom on form inputs */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    textarea {
        font-size: 16px !important;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    /* Fix image and box sizes (images in boxes/modals) */
    #services img {
        max-height: 250px;
        width: 100%;
        border-radius: 12px !important;
    }
    
    #services .grid.grid-2 {
        margin-bottom: 3rem !important; 
        padding: 1.5rem !important;
    }

    .glass-section, .glass, #services .container > .grid {
        padding: 1.5rem !important;
        border-radius: 16px !important;
    }

    .feature-card {
        padding: 1.5rem 1rem !important;
    }

    .partner-box {
        padding: 1.25rem !important;
    }

    /* Consistent flow of Text -> Image on mobile */
    .grid-2 > div {
        order: 0 !important;
    }
    
    .image-grid {
        grid-template-columns: 1fr;
    }

    /* Modal scaling for mobile */
    #modal-title {
        font-size: 2rem !important;
    }
    
    #modal-description, #modal-feature-text {
        font-size: 1rem !important;
    }

    .modal-content {
        width: 100%;
    }

    .tabs-header {
        padding: 0 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .tabs-body {
        padding: 1.5rem !important;
    }
}

/* Modal Overlay & Base Modal Styles */
.modal-overlay,
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 26, 47, 0.98);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 2rem;
}

.modal-overlay.active,
.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 1000px;
    margin: auto;
}

.modal-close {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: none;
    border: none;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    z-index: 2100;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--accent-color);
    transform: rotate(90deg);
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.img-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-color);
    overflow: hidden;
    position: relative;
}

.img-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.img-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1rem;
    background: linear-gradient(transparent, rgba(10, 26, 47, 0.9));
    color: white;
    font-weight: 500;
    text-align: center;
}



.modal-header {
    width: 100%;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

#brands-modal-title {
    display: inline-block;
    width: 100%;
    margin: 0;
}

#brands-modal-close.modal-close {
    position: absolute;
    top: -10px;
    right: 0;
    font-size: 2.5rem;
}

.brands-table tr {
    transition: var(--transition);
}

.brands-table tr:hover {
    background: rgba(76, 175, 80, 0.05) !important;
}

.brands-table td,
.brands-table th {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Modal Tabs Styling */
.tabs-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: none;
    margin-bottom: 0;
    padding: 0 2rem;
    margin-top: 0;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    padding: 1.5rem 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cta-tab-btn {
    background: var(--accent-color);
    color: var(--white) !important;
    padding: 0.7rem 1.8rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition);
    margin-left: 1rem;
    display: inline-block;
}

.cta-tab-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

.tab-btn.active {
    color: var(--accent-color);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-color);
}

.tab-content-item {
    display: none;
    animation: fadeIn 0.4s ease-out;
    text-align: left;
    margin-top: 3rem;
}

.tab-content-item.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 600px) {
    .tabs-header {
        flex-direction: column;
        gap: 0.5rem;
        border-bottom: none;
    }

    .tab-btn {
        text-align: left;
        padding: 0.75rem;
        border-left: 2px solid rgba(255, 255, 255, 0.1);
    }

    .tab-btn.active::after {
        display: none;
    }

    .tab-btn.active {
        border-left-color: var(--accent-color);
    }
}

/* Form Styles */
.input-wrapper {
    position: relative;
    width: 100%;
}

.input-wrapper.required::after {
    content: '';
    position: absolute;
    top: 1.35rem; /* Better vertical alignment */
    right: 1.25rem;
    width: 8px;
    height: 8px;
    background-color: var(--accent-color);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-color);
    pointer-events: none;
}

/* Ensure text inside required fields doesn't overlap the green indicator dot */
.input-wrapper.required input,
.input-wrapper.required textarea {
    padding-right: 3rem !important;
}