:root {
    --primary-color: #193963;
    /*--secondary-color: #82bc00;*/
    --secondary-color: #669900;
    --text-dark: #333;
    --text-light: #666;
    --bg-light: #f8f9fa;
    --nav-height: 60px;
}


body {
    font-family: 'Noto Sans TC', sans-serif;
    color: var(--text-dark);
    margin: 0;
    padding: 0;
    font-size: 1.2rem;
}

/* Top Header */
.top-header {
    padding: 5px 0;
    background: #fff;
    border-bottom: 1px solid #eee;
    font-size: 0.85rem;
}
.top-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 25px;
}
.top-logo img {
    height: 60px;
    display: block;
}
.top-info-right {
    display: flex;
    align-items: center;
}
.top-header .info-item {
    margin-left: 25px;
    color: var(--text-light);
    font-weight: 500;
    font-size: 1.2rem;
}
.top-header .info-item i {
    color: var(--secondary-color);
    margin-right: 8px;
}
.top-info-right a {
    color: var(--text-light);
}
.top-info-right a:hover {
    color: var(--primary-color);
}
.nav-info-mobile a {
    color: var(--bg-light);
}
.nav-info-mobile a:hover {
    color: var(--text-light);
}
/* Custom Header */
.custom-header {
    background: var(--primary-color);
    width: 100%;
    z-index: 1000;
    position: sticky;
    top: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-header.scrolled {
    background: #003d66; /* Slightly darker deep blue */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.custom-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--nav-height);
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 25px;
    transition: all 0.4s ease;
}

.custom-header.scrolled .custom-navbar {
    height: 60px;
}

.nav-logo img {
    height: 45px;
    transition: height 0.4s ease;
    filter: brightness(0) invert(1); /* Make logo white if it's a dark logo */
}

.custom-header.scrolled .nav-logo img {
    height: 38px;
}

.nav-right-part {
    display: flex;
    align-items: center;
    height: 100%;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 100%;
    flex: 1; /* 讓選單佔滿剩餘空間 */
}

.nav-item {
    height: 100%;
    flex: 1; /* 平均分配選單項目寬度 */
    text-align: center;
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: center; /* 讓文字水平垂直置中 */
    padding: 0 10px;
    color: rgba(255, 255, 255, 0.8) !important;
    text-decoration: none !important;
    font-weight: 500;
    height: 100%;
    transition: all 0.3s;
    font-size: 1rem;
    letter-spacing: 0.8px;
    position: relative;
    text-transform: uppercase;
}

.nav-link::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--secondary-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover, .nav-item.active .nav-link {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.1);
}

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

/* Header Action Button */
.btn-nav-cta {
    background: var(--secondary-color);
    color: #fff !important;
    padding: 10px 22px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.3s;
    border: 1px solid var(--secondary-color);
    margin-left: 20px;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.btn-nav-cta:hover {
    background: transparent;
    color: var(--secondary-color) !important;
    box-shadow: 0 5px 15px rgba(130, 188, 0, 0.2);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 26px;
    height: 18px;
    cursor: pointer;
    z-index: 1001;
}

.nav-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s;
}

.nav-toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Hero Section */
.hero-section {
    height: 600px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-bg-carousel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-bg-carousel .carousel-inner,
.hero-bg-carousel .carousel-item {
    height: 100%;
}

.hero-bg-carousel .carousel-item {
    background-size: cover;
    background-position: center;
}

/* Hero Carousel Arrows */
.hero-carousel-arrow {
    width: 48px;
    height: 48px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.3s;
    position: absolute;
}
.hero-carousel-arrow:hover {
    background: rgba(255, 255, 255, 0.45);
}
.carousel-control-prev.hero-carousel-arrow { left: 20px; }
.carousel-control-next.hero-carousel-arrow { right: 20px; }
.hero-carousel-arrow .carousel-control-prev-icon,
.hero-carousel-arrow .carousel-control-next-icon {
    width: 20px;
    height: 20px;
}

/* Hero Carousel Nav Dots */
.hero-carousel-nav {
    bottom: 20px;
    z-index: 10;
    margin: 0;
    justify-content: center;
}
.hero-carousel-nav li {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    margin: 0 5px;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
}
.hero-carousel-nav li.active {
    background: #fff;
    transform: scale(1.3);
}

.hero-content {
    max-width: 1200px;
}
.hero-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    letter-spacing:5px;
    text-shadow: -1px -1px 0 #ccc,
              1px -1px 0 #ccc,
              -1px 1px 0 #ccc,
              1px 1px 0 #ccc;
}
.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 500;
    letter-spacing:5px;
    color: var(--primary-color);
    margin-bottom: 30px;
    line-height: 1.6;
    /*text-shadow: 1px 1px 0px rgba(255, 255, 255, 0.8);*/
    
    text-shadow: -1px -1px 0 #ccc,
              1px -1px 0 #ccc,
              -1px 1px 0 #ccc,
              1px 1px 0 #ccc;
              
}
.btn-oem {
    background: var(--primary-color);
    color: #fff !important;
    padding: 12px 35px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 18px;
    transition: all 0.4s cubic-bezier(0.2, 1, 0.3, 1);
    border: none;
    display: inline-block;
    text-decoration: none !important;
    position: relative;
    overflow: hidden;
    z-index: 1;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.btn-oem::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: all 0.6s;
    z-index: -1;
}

.btn-oem:hover {
    background: #003d66;
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 77, 128, 0.3);
}

.btn-oem:hover::before {
    left: 100%;
}

/* Service Cards */
.section-padding {
    padding: 60px 0;
}

.service-card {
    border: 2px solid #003366;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s;
    height: 100%;
    background: #fff;
}
.service-card:hover {
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-color: var(--secondary-color);
    transform: translateY(-10px);
}
.service-icon {
    font-size: 50px;
    color: var(--secondary-color);
    margin-bottom: 20px;
}
.service-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
}
.service-card p {
    color: var(--text-light);
    font-size: 1.2rem;
    line-height: 1.8;
    text-align: left;
    padding-left: 5px;
}
.learn-more {
    color: var(--primary-color);
    font-weight: 500;
    text-decoration: none !important;
    display: inline-block;
    margin-top: 15px;
}
.learn-more:after {
    content: ' →';
    transition: margin 0.3s;
}
.learn-more:hover:after {
    margin-left: 5px;
}

/* Image Lightbox */
.img-zoomable {
    cursor: zoom-in;
    transition: opacity 0.2s;
}
.img-zoomable:hover {
    opacity: 0.85;
}
button.close.img-modal-close:hover {
    background: rgb(120,120,120) !important;
    opacity: 1 !important;
}
button.close.img-modal-close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 32px;
    height: 32px;
    background: rgb(180,180,180) !important;
    border: 2px solid #fff;
    border-radius: 50%;
    color: #fff !important;
    font-size: 1.4rem;
    line-height: 28px;
    text-align: center;
    opacity: 1 !important;
    z-index: 10;
    padding: 0;
    box-shadow: 0 1px 6px rgba(0,0,0,0.4);
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
    float: none;
}

/* About Section */
.about-section {
    background: #fff;
}
.about-img-container {
    position: relative;
}
.about-img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.about-bg-text {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 8rem;
    font-weight: 900;
    color: rgba(0,0,0,0.03);
    z-index: 0;
    pointer-events: none;
}
.about-content {
    position: relative;
    z-index: 1;
}
.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 15px;
}
.section-title:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(to right, var(--secondary-color) 25%, #eee 25%);
}

/* Features */
.feature-item {
    text-align: center;
    padding: 20px;
}
.feature-icon-box {
    width: 80px;
    height: 80px;
    background: #006699;
    color: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    margin: 0 auto 20px;
    transition: transform 0.3s;
}
.feature-item:hover .feature-icon-box {
    transform: scale(1.1) rotate(5deg);
}
.feature-item h4 {
    font-size: 1.2rem;
    font-weight: 700;
}
.feature-item p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Services Section */
.services-bg-text {
    font-size: 10rem;
    font-weight: 900;
    color: rgba(0,0,0,0.03);
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}
.service-img-grid img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 20px;
    transition: transform 0.3s;
}
.service-img-grid img:hover {
    transform: scale(1.05);
}
.service-img-grid > div:nth-child(even) {
    margin-top: 30px;
}

/* Contact Banner */
.contact-banner {
    background: var(--primary-color);
    color: #fff;
    padding: 20px 0;
    font-size: 1.2rem;
    letter-spacing: 5px;
    overflow-x: hidden;
}
.contact-banner p {
    font-size: 1.3rem;
}
.contact-banner h2 {
    font-size: 1.8rem;
    font-weight: 700;
    white-space: nowrap;
}


.btn-contact-cta {
    background: var(--secondary-color);
    color: #fff !important;
    border: none;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: all 0.4s cubic-bezier(0.2, 1, 0.3, 1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    letter-spacing: 1px;
}

.btn-contact-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.4s cubic-bezier(0.2, 1, 0.3, 1);
    z-index: -1;
}

.btn-contact-cta:hover {
    color: #fff !important;
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(130, 188, 0, 0.4);
}

.btn-contact-cta:hover::before {
    left: 0;
}

/* Footer */
footer {
    background: #002b4d;
    background-image: url('../images/fanol_contact_bg.png');
    background-repeat: no-repeat;
    background-size: cover;
    color: #FFF;
    padding: 50px 0 20px 0;
    position: relative;
}
footer h5 {
    color: #fff;
    font-weight: 700;
    margin-bottom: 25px;
    font-size: 1.2rem;
    position: relative;
    padding-bottom: 12px;
}

.footer-link {
    color: #FFF;
    text-decoration: none !important;
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.footer-link::before {
    content: '';
    width: 13px;
    height: 13px;
    /*border: 3px solid rgba(255, 255, 255, 0.5);*/
    border: 3px solid var(--secondary-color);
    border-radius: 50%;
    margin-right: 10px;
    flex-shrink: 0;
    transition: all 0.3s;
}

.footer-link:hover {
    /*color: var(--secondary-color);*/
    color: rgba(255, 255, 255, 0.5);
}

.footer-link:hover::before {
    border-color: var(--secondary-color);
}

.footer-contact-item a {
    color: #FFF;
}

.footer-contact-item {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}
.footer-contact-item i {
    color: var(--secondary-color);
    margin-right: 12px;
    margin-top: 5px;
    font-size: 1.1rem;
}
.social-icons {
    display: flex;
    margin-top: 25px;
}
.social-icon {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    transition: all 0.3s;
    text-decoration: none !important;
}
.social-icon:hover {
    background: var(--secondary-color);
    color: #fff;
    transform: translateY(-5px);
}
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 20px;
    padding-top: 25px;
    font-size: 0.85rem;
}
.footer-bottom-links {
    display: flex;
}
.footer-bottom-links a {
    color: #FFF;
    text-decoration: none !important;
    margin-left: 20px;
    transition: color 0.3s;
}
.footer-bottom-links a:hover {
    /*color: var(--secondary-color);*/
    color: rgba(255, 255, 255, 0.5);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: #fff !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s, visibility 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    text-decoration: none !important;
}

.back-to-top.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: all 0.3s;
}

.back-to-top:hover {
    background: var(--secondary-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    
}

.font-letter-sp-1 {
    letter-spacing:1px;
}
.font-letter-sp-0 {
    letter-spacing:0;
}
.font-letter-sp-d1 {
    letter-spacing:-1px;
}


/* Responsive Custom Navbar */
@media (max-width: 991px) {
    .nav-toggle {
        display: flex;
    }
    .top-header .container {
        flex-direction: column;
        /*padding: 10px 15px;*/
        padding:0 15px;
    }
    .top-logo img {
        height: 50px;
        /*margin-bottom: 10px;*/
    }
    .top-info-right {
        /*flex-direction: column;
        width: 100%;
        align-items: center;*/
        display:none;
    }
    .top-header .info-item {
        margin-left: 0;
        margin-bottom: 5px;
        font-size: 1rem;
    }
    .nav-menu {
        position: fixed;
        top: var(--nav-height);
        left: -100%;
        width: 100%;
        height: calc(100vh - var(--nav-height));
        background: #003d66; /* Deep blue background for mobile menu */
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding-top: 50px;
        transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 15px 30px rgba(0,0,0,0.3);
        overflow-y: auto;
    }
    
    .custom-header.scrolled .nav-menu {
        top: 60px;
        height: calc(100vh - 60px);
    }

    .nav-menu.active {
        left: 0;
    }
    .nav-item {
        width: 100%;
        height: auto;
        text-align: center;
    }
    .nav-link {
        padding: 20px;
        justify-content: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05); /* Subtle dark border */
        color: rgba(255, 255, 255, 0.8) !important;
        font-size: 0.88rem;
    }
    .nav-link:hover, .nav-item.active .nav-link {
        background: rgba(255, 255, 255, 0.1);
        color: #fff !important;
    }
    .nav-link::after {
        display: none;
    }
    .nav-info-mobile {
        padding:20px 15px 15px 15px;
        width: 100%;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        background: rgba(0, 0, 0, 0.1);
    }
    .nav-info-mobile .info-item {
        color: #fff;
        margin-bottom: 10px;
        font-size: 0.88rem;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 400;
        padding-right: 30px;
    }
    .nav-info-mobile .info-item i {
        margin-right: 10px;
        display: flex;
        align-items: center;
    }
}

@media (max-width: 768px) {
    .hero-title { font-size: 2.2rem; }
    .hero-subtitle { font-size: 1.2rem; }
    .hero-section { height: 500px; }
    .about-bg-text { font-size: 4rem; }
    .service-img-grid > div:nth-child(even) {
        margin-top: 0;
    }

    .section-title {
        font-size: 1.6rem;
    }
    .contact-banner h2 {
        font-size: 1.6rem;
    }
}
@media (max-width: 520px) {
    .hero-title { font-size: 1.8rem; }

    .d-none-icon {
        display: none;
    }
    .footer-bottom-links a {
        text-align: left;
        margin-left: 0;
    }
    .back-to-top {
        right: 10px;
    }
    
}
