/* =========================================================
   BASE.CSS
   Loaded on EVERY page (light-theme pages AND dark service pages).
   Contains: reset, shared variables, fonts, header, footer, and the
   small set of utility classes the header/footer markup depends on
   (.container, .btn family, .section-title/.section-subtitle).

   Deliberately does NOT touch `body` directly (besides the safe
   universal rules below) — each page's own stylesheet owns its body
   theme, so a dark service page can set its own body background
   without this file fighting it.
========================================================= */

:root {
    --primary-dark: #1a3a4a;
    --primary: #2d6b7a;
    --secondary: #4a9ba8;
    --accent: #6fc4d1;
    --text-light: #ffffff;
    --text-dark: #1a1a1a;
    --bg-light: #f5f7f8;
    --border-color: #e0e0e0;
}

@font-face {
    font-family: 'AlibabaSans';
    src: url('https://assets-persist.lovart.ai/agent-static-assets/AlibabaSans-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'AlibabaSans';
    src: url('https://assets-persist.lovart.ai/agent-static-assets/AlibabaSans-Medium.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'AlibabaSans';
    src: url('https://assets-persist.lovart.ai/agent-static-assets/AlimamaShuHeiTi-Bold.otf') format('opentype');
    font-weight: bold;
    font-style: normal;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
}

/* Prevent content overflow site-wide */
* {
    max-width: 100%;
}

/* ============ PAGE LOAD FADE-IN (site-wide, subtle) ============ */
body {
    animation: pageFadeIn 0.5s ease;
}
@keyframes pageFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============ REVEAL SYSTEM (shared site-wide) ============
   Plain CSS transitions + IntersectionObserver (see js/reveal.js). No
   dependency on scroll-position math, so it can never get "stuck"
   invisible regardless of layout shifts or late-loading fonts/images. */
.reveal, .reveal-left, .reveal-right, .reveal-scale {
    opacity: 0;
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal { transform: translateY(36px); }
.reveal-left { transform: translateX(-50px); }
.reveal-right { transform: translateX(50px); }
.reveal-scale { transform: scale(0.88); }
.reveal.in-view, .reveal-left.in-view, .reveal-right.in-view, .reveal-scale.in-view {
    opacity: 1;
    transform: none;
}
/* Hard fail-safe: if JS/observer ever fails, everything is forced visible after load */
body.force-visible .reveal, body.force-visible .reveal-left,
body.force-visible .reveal-right, body.force-visible .reveal-scale {
    opacity: 1 !important;
    transform: none !important;
}
/* If JS never runs at all, plain CSS still shows everything after 3.5s (belt & suspenders) */
@keyframes forceShow { to { opacity: 1; transform: none; } }
.reveal, .reveal-left, .reveal-right, .reveal-scale {
    animation: forceShow 0s 3.5s forwards;
}

/* ---------- Scroll progress bar (site-wide; dark service pages
   override the gradient colors via service-theme.css, loaded after this) ---------- */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    z-index: 9999;
    width: 0%;
}

/* ---------- Reusable classes (used by header + page content) ---------- */
.container {
    width: 1600px;
    margin: 0 auto;
    padding: 0 40px;
}

/* Fluid override — applies immediately, before any breakpoint (matches
   original source order: fixed width first, fluid override right after) */
.container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding-left: 40px;
    padding-right: 40px;
}

.section-title {
    font-size: 48px;
    font-weight: bold;
    color: var(--primary-dark);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.section-subtitle {
    font-size: 24px;
    color: var(--primary);
    margin-bottom: 60px;
}

.btn {
    display: inline-block;
    padding: 16px 32px;
    font-size: 18px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

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

.btn-primary:hover {
    background-color: var(--text-light);
}

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

.btn-outline:hover {
    background-color: var(--accent);
    color: var(--primary-dark);
}

/* ---------- Shared form input styling (used by any contact form on
   light-theme pages; dark service pages fully override every property
   these rules set, in their own page CSS, so loading this here is safe) ---------- */
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 18px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
    background-color: var(--bg-light);
}

.form-group textarea {
    height: 150px;
    resize: vertical;
}

/* ---------- Shared micro-interactions (every page, including dark service pages) ---------- */
nav > ul > li > a {
    position: relative;
}

nav > ul > li > a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

nav > ul > li > a:hover::after {
    width: 100%;
}

.btn-primary, .btn-outline {
    transition: all 0.3s ease, transform 0.2s ease;
}

.btn-primary:hover, .btn-outline:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(45, 107, 122, 0.25);
}

.logo img {
    transition: transform 0.3s ease;
}

.logo:hover img {
    transform: scale(1.04);
}

/* ---------- Header ---------- */
header {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--text-light);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    z-index: 1000;
    padding: 20px 0;
    font-family: 'AlibabaSans', sans-serif;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 80px;
    width: auto;
}

nav > ul {
    display: flex;
    list-style: none;
    gap: 40px;
}

nav > ul > li > a {
    text-decoration: none;
    color: var(--primary-dark);
    font-size: 18px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

nav > ul > li > a:hover {
    color: var(--primary);
}

/* ---------- Products dropdown ---------- */
.nav-dropdown {
    position: relative;
}

.nav-dropdown > a {
    display: flex;
    align-items: center;
    gap: 2px;
}

.dropdown-menu {
    display: block;
    position: absolute;
    top: calc(100% + 14px);
    left: 0;
    background: var(--text-light);
    box-shadow: 0 12px 28px rgba(0,0,0,0.14);
    border-radius: 8px;
    min-width: 240px;
    list-style: none;
    padding: 10px;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    z-index: 1001;
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu a {
    display: block;
    padding: 11px 14px;
    font-size: 15px;
    text-transform: none;
    letter-spacing: normal;
    font-weight: 500;
    color: var(--primary-dark);
    border-radius: 6px;
    font-family: 'AlibabaSans', sans-serif;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.dropdown-menu a:hover {
    background-color: var(--bg-light);
    color: var(--primary);
}

/* ---------- Hamburger toggle (hidden on desktop, shown at tablet/mobile) ---------- */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 28px;
    color: var(--primary-dark);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

/* ---------- Footer ---------- */
footer {
    background-color: #112631;
    color: var(--text-light);
    padding: 80px 0 40px;
    font-family: 'AlibabaSans', sans-serif;
}

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

.footer-logo {
    display: inline-block;
    background: var(--text-light);
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.footer-logo img {
    height: 50px;
    display: block;
}

.footer-desc {
    color: #a0a0a0;
    margin-bottom: 30px;
    max-width: 400px;
}

.social-links {
    display: flex;
    gap: 20px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255,255,255,0.1);
    color: var(--text-light);
    border-radius: 50%;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.social-links a:hover {
    background-color: var(--primary);
}

.footer-links h4 {
    font-size: 20px;
    margin-bottom: 25px;
    color: var(--accent);
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 15px;
}

.footer-links a {
    color: #a0a0a0;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--text-light);
}

.copyright {
    text-align: center;
    padding-top: 40px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #a0a0a0;
}

/* =========================================================
   RESPONSIVE — header, footer, .container, .btn, .section-title
   Same breakpoints as the original file, same source order.
========================================================= */

@media screen and (max-width: 1919px) {
    .container {
        width: 100%;
        max-width: 1500px;
    }
}

@media screen and (max-width: 1599px) {
    .container {
        max-width: 1400px;
        padding-left: 35px;
        padding-right: 35px;
    }

    .section-title {
        font-size: 44px;
    }

    .section-subtitle {
        font-size: 22px;
    }

    .footer-grid {
        gap: 40px;
    }
}

@media screen and (max-width: 1399px) {
    .container {
        max-width: 1200px;
        padding-left: 30px;
        padding-right: 30px;
    }

    header {
        padding: 18px 0;
    }

    .logo img {
        height: 70px;
    }

    nav > ul {
        gap: 28px;
    }

    nav > ul > li > a {
        font-size: 16px;
    }

    .section-title {
        font-size: 40px;
    }

    .section-subtitle {
        font-size: 20px;
        margin-bottom: 50px;
    }

    footer {
        padding: 70px 0 35px;
    }
}

@media screen and (max-width: 1199px) {
    .container {
        max-width: 100%;
        padding-left: 25px;
        padding-right: 25px;
    }

    header {
        padding: 16px 0;
    }

    .header-content {
        gap: 20px;
    }

    .logo img {
        height: 60px;
    }

    nav > ul {
        gap: 20px;
    }

    nav > ul > li > a {
        font-size: 15px;
    }

    .btn {
        padding: 14px 24px;
        font-size: 16px;
    }

    .section-title {
        font-size: 36px;
    }

    .section-subtitle {
        font-size: 18px;
    }

    .footer-grid {
        grid-template-columns: 1.5fr 1fr 1fr;
        gap: 30px;
    }
}

@media screen and (max-width: 991px) {
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }

    header {
        position: relative;
        padding: 15px 0;
    }

    .header-content {
        flex-wrap: nowrap;
        justify-content: space-between;
        gap: 16px;
    }

    .logo {
        width: auto;
        text-align: left;
    }

    .logo img {
        height: 55px;
    }

    .header-cta {
        display: none;
    }

    .nav-toggle {
        display: block;
    }

    nav {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--text-light);
        box-shadow: 0 16px 28px rgba(0,0,0,0.12);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease;
        z-index: 999;
    }

    nav.open {
        max-height: 80vh;
        overflow-y: auto;
    }

    nav > ul {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px 20px 24px;
    }

    nav > ul > li {
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }

    nav > ul > li:last-child {
        border-bottom: none;
    }

    nav > ul > li > a {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 4px;
        font-size: 15px;
        width: 100%;
    }

    /* Dropdown becomes an inline accordion instead of a flyout */
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: var(--bg-light);
        border-radius: 6px;
        min-width: 0;
        max-height: 0;
        overflow: hidden;
        padding: 0;
        margin: 0 0 8px;
        transition: max-height 0.3s ease, padding 0.3s ease;
    }

    .nav-dropdown.open .dropdown-menu {
        max-height: 400px;
        padding: 6px;
    }

    .dropdown-menu a {
        padding: 11px 12px;
    }

    .section-title {
        font-size: 34px;
        text-align: center;
    }

    .section-subtitle {
        text-align: center;
    }

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

    .footer-desc {
        max-width: 100%;
    }

    .social-links {
        justify-content: center;
    }
}

@media screen and (max-width: 767px) {
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    header {
        padding: 14px 0;
    }

    .logo img {
        height: 48px;
    }

    nav > ul {
        gap: 12px;
    }

    nav > ul > li > a {
        font-size: 13px;
    }

    .btn {
        padding: 12px 20px;
        font-size: 15px;
    }

    .section-title {
        font-size: 30px;
        margin-bottom: 15px;
    }

    .section-subtitle {
        font-size: 16px;
        margin-bottom: 40px;
    }

    .footer-links h4 {
        margin-bottom: 18px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 15px;
        font-size: 15px;
    }
}

@media screen and (max-width: 575px) {
    .container {
        padding-left: 14px;
        padding-right: 14px;
    }

    .logo img {
        height: 42px;
    }

    nav > ul > li > a {
        font-size: 13px;
    }

    .section-title {
        font-size: 26px;
        line-height: 1.3;
    }

    .section-subtitle {
        font-size: 15px;
    }

    footer {
        padding: 60px 0 30px;
    }

    .copyright {
        font-size: 14px;
    }
}
