/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Smooth scrolling for anchor links */
html {
    scroll-behavior: smooth;
}

/* Ensure smooth scrolling works on all browsers */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* Header and Navigation */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 70px;
}

.logo {
    display: flex;
    align-items: center;
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: white;
    font-size: 24px;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.logo a:hover {
    transform: scale(1.05);
}

.logo-img {
    width: 112px;
    height: 52px;
    border-radius: 8px;
    margin-right: 15px;
    object-fit: cover;
}

.logo-text {
    font-size: 28px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 18px;
    padding: 10px 15px;
    border-radius: 25px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Navigation right section */
.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Hamburger menu button */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

/* Hamburger menu active state */
.hamburger-menu.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger-menu.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.lang-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.lang-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.lang-toggle .lang-text {
    font-size: 14px;
    font-weight: 600;
}

/* Language switching */
.lang[hidden] {
    display: none !important;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 100px 20px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 40px;
    opacity: 0.95;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 15px 30px;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-align: center;
    min-width: 160px;
}

.btn-primary {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
}

/* Features Section */
.features {
    padding: 80px 20px;
    text-align: center;
}

.features h2 {
    font-size: 2.5rem;
    margin-bottom: 60px;
    color: #2c3e50;
    position: relative;
}

.features h2::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: white;
    padding: 40px 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #2c3e50;
}

.feature-card p {
    color: #666;
    line-height: 1.8;
    margin-bottom: 25px;
}

.feature-card .btn {
    margin-top: 15px;
}

.post-date {
    font-size: 0.9rem;
    color: #888;
    margin-top: 15px;
    font-style: italic;
}

/* Installation Instructions */
.installation-instructions {
    margin-top: 40px;
    text-align: center;
}

.installation-instructions h3 {
    font-size: 2rem;
    margin-bottom: 30px;
    color: #2c3e50;
}

.instructions-content {
    text-align: left;
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.instructions-content ol,
.instructions-content ul {
    line-height: 2;
    margin-bottom: 20px;
}

.instructions-content h4 {
    margin-top: 30px;
    color: #667eea;
    font-size: 1.2rem;
}

.instructions-content a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.instructions-content a:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 40px 20px;
    margin-top: 80px;
}

.footer-content p {
    margin-bottom: 10px;
    opacity: 0.9;
}

.footer-content a {
    color: #3498db;
    text-decoration: none;
}

.footer-content a:hover {
    text-decoration: underline;
}

/* Utility classes */
.center {
    text-align: center;
}

/* Responsive design */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 20px;
        gap: 0;
    }
    
    .hamburger-menu {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 70px;
        right: 0;
        width: 10%;
        min-width: 200px;
        max-width: 250px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        transform: translateX(100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        box-shadow: -4px 0 10px rgba(0,0,0,0.1);
        z-index: 1000;
        border-radius: 8px 0 0 8px;
        padding: 0;
        overflow: hidden;
        pointer-events: none;
        max-height: fit-content;
        height: auto;
    }
    
    .nav-menu.active {
        pointer-events: auto;
    }
    
    .nav-menu.active {
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
    }
    
    /* Remove backdrop completely to prevent overlay */
    
    .nav-links {
        flex-direction: column;
        padding: 25px 25px;
        gap: 0;
        text-align: center;
        width: 100%;
        margin: 0;
        height: auto;
        overflow: visible;
        max-height: none;
    }
    
    .nav-links li {
        width: 100%;
        border-bottom: none;
        min-height: 50px;
    }
    
    .nav-links li:last-child {
        border-bottom: none;
    }
    
    .nav-menu .nav-links a,
    .nav-menu .nav-links a:link,
    .nav-menu .nav-links a:visited,
    .nav-menu .nav-links a:hover,
    .nav-menu .nav-links a:active {
        position: relative !important;
        display: grid !important;
        place-items: center !important;
        width: 100% !important;
        height: 50px !important;
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
        white-space: nowrap !important;
        transition: all 0.3s ease;
        box-sizing: border-box;
        text-align: center !important;
        background-color: transparent !important;
        color: white !important;
        text-decoration: none !important;
        font-weight: 500 !important;
        font-size: 18px !important;
        border: none !important;
        outline: none !important;
        font-family: inherit !important;
        overflow: hidden !important;
    }
    
    .nav-menu .nav-links a > * {
        display: inline-block !important;
        vertical-align: middle !important;
        font-size: 18px !important;
        margin: 0 !important;
        padding: 0 !important;
        line-height: 1 !important;
    }
    
    .nav-menu .nav-links a * {
        margin: 0 !important;
        padding: 0 !important;
        line-height: 1 !important;
        vertical-align: middle !important;
        background: none !important;
    }
    
    .nav-menu .nav-links a:hover,
    .nav-menu .nav-links a.active {
        background-color: transparent !important;
        transform: none !important;
        padding-left: 20px !important;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .contact-form-container {
        padding: 20px;
        margin: 0 20px;
        max-width: 95%;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .action-buttons .btn {
        min-width: 250px;
    }
    
    .instructions-content {
        padding: 20px;
        margin: 0 20px;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 15px;
    }
    
    .hero {
        padding: 60px 20px;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .features h2,
    .contact-result h1 {
        font-size: 2rem;
    }
    
    .logo-img {
        width: 96px;
        height: 44px;
        margin-right: 12px;
    }
    
    .logo-text {
        font-size: 24px;
    }
    
    .installation-instructions h3 {
        font-size: 1.5rem;
    }
    
    .hamburger-menu {
        width: 25px;
        height: 25px;
    }
    
    .hamburger-line {
        height: 2px;
    }
    
    /* Ensure mobile menu is properly sized on very small screens */
    .nav-menu {
        width: 15%;
        min-width: 180px;
        max-width: 220px;
    }
    
    .nav-links a {
        min-height: 45px;
        padding: 16px 20px;
    }
    
    .nav-links li {
        min-height: 45px;
    }
}

.error-message h3 {
    color: #dc3545;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 40px;
    flex-wrap: wrap;
}

/* Contact Form */
.contact-form-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.05);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    width: 100%;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

/* Downloads Section Specific Styles */
#downloads {
    scroll-margin-top: 100px; /* Account for sticky header */
    padding-top: 40px;
    margin-top: 20px;
}

#downloads .features-grid {
    margin-bottom: 40px;
}

#downloads .feature-card {
    position: relative;
    overflow: hidden;
}

#downloads .feature-card .btn {
    margin-top: 15px;
    display: inline-block;
}

.installation-instructions {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 20px;
    padding: 30px;
    margin-top: 40px;
    border: 1px solid rgba(0,0,0,0.05);
}

.installation-instructions h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.installation-instructions h4 {
    color: #495057;
    margin: 20px 0 10px 0;
    font-size: 1.2rem;
}

.instructions-content ol,
.instructions-content ul {
    margin: 15px 0;
    padding-left: 25px;
}

.instructions-content li {
    margin: 8px 0;
    line-height: 1.6;
}

.instructions-content a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.instructions-content a:hover {
    color: #5a6fd8;
    text-decoration: underline;
}

.post-date {
    font-size: 0.9rem;
    color: #6c757d;
    font-style: italic;
    margin-top: 10px;
}

/* RFQ Integration Styles */
.rfq-integration {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 4rem 0;
    margin: 2rem 0;
}

.rfq-integration h2 {
    text-align: center;
    margin-bottom: 3rem;
    color: #2c3e50;
    font-size: 2.5rem;
}

.rfq-showcase {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.rfq-content h3 {
    color: #e74c3c;
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.rfq-content p {
    margin-bottom: 2rem;
    color: #555;
    font-size: 1.1rem;
    line-height: 1.6;
}

.rfq-features {
    list-style: none;
    margin-bottom: 2rem;
}

.rfq-features li {
    display: flex;
    align-items: center;
    margin-bottom: 0.8rem;
    font-size: 1rem;
    color: #333;
}

.rfq-features i {
    color: #28a745;
    margin-right: 0.8rem;
    font-size: 1.1rem;
}

.rfq-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.rfq-actions .btn {
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.rfq-actions .btn-primary {
    background: #e74c3c;
    color: white;
    border: 2px solid #e74c3c;
}

.rfq-actions .btn-primary:hover {
    background: #c0392b;
    border-color: #c0392b;
    transform: translateY(-2px);
}

.rfq-actions .btn-secondary {
    background: transparent;
    color: #e74c3c;
    border: 2px solid #e74c3c;
}

.rfq-actions .btn-secondary:hover {
    background: #e74c3c;
    color: white;
    transform: translateY(-2px);
}

.rfq-preview {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
}

.preview-card h4 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.3rem;
}

.equipment-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.preview-item {
    display: flex;
    align-items: center;
    padding: 0.8rem;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.preview-item:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.preview-item i {
    color: #e74c3c;
    margin-right: 0.8rem;
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
}

.preview-item span {
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .rfq-showcase {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 1rem;
    }
    
    .rfq-integration h2 {
        font-size: 2rem;
    }
    
    .equipment-preview {
        grid-template-columns: 1fr;
    }
    
    .rfq-actions {
        flex-direction: column;
    }
    
    .rfq-actions .btn {
        text-align: center;
        justify-content: center;
    }
}

/* RFQ Link Styling */
.rfq-nav-link {
    color: #e74c3c !important;
    font-weight: 600 !important;
    position: relative !important;
    background: rgba(231, 76, 60, 0.1) !important;
    border-radius: 5px !important;
    padding: 8px 12px !important;
    margin: 2px !important;
}

.rfq-nav-link:hover {
    color: #c0392b !important;
    background-color: rgba(231, 76, 60, 0.2) !important;
    transform: translateY(-1px) !important;
}

.external-icon {
    font-size: 0.8em;
    margin-left: 0.3em;
    font-weight: bold;
}

/* Language-specific text visibility for RFQ navigation link and hero button */
.rfq-nav-link .lang-zh,
.btn-rfq .lang-zh {
    display: none !important;
}

.rfq-nav-link .lang-en,
.btn-rfq .lang-en {
    display: inline !important;
}

/* When Chinese language section is active, show Chinese text and hide English for RFQ elements */
.lang-zh .rfq-nav-link .lang-en,
.lang-zh .btn-rfq .lang-en {
    display: none !important;
}

.lang-zh .rfq-nav-link .lang-zh,
.lang-zh .btn-rfq .lang-zh {
    display: inline !important;
}

/* RFQ Button Styling */
.btn-rfq {
    background: linear-gradient(135deg, #e74c3c, #c0392b) !important;
    color: white !important;
    border: 2px solid #e74c3c !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    padding: 12px 24px !important;
    border-radius: 25px !important;
    transition: all 0.3s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3) !important;
}

.btn-rfq:hover {
    background: linear-gradient(135deg, #c0392b, #a93226) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4) !important;
    color: white !important;
}

.btn-rfq i {
    font-size: 1.1em;
}

/* RFQ Banner Styling */
.rfq-banner {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    padding: 1rem 0;
    position: relative;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(231, 76, 60, 0.3);
}

.rfq-banner .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.banner-text {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.1rem;
    flex: 1;
}

.banner-text i {
    font-size: 1.3rem;
    color: #ffd700;
}

.banner-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-banner {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-banner:hover {
    background: white;
    color: #e74c3c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.banner-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .banner-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .banner-text {
        font-size: 1rem;
    }
    
    .banner-actions {
        width: 100%;
        justify-content: center;
    }
}