/* Global Styles */
:root {
    --primary-color: #9D2235;
    --secondary-color: #1A3A5F;
    --text-color: #333;
    --light-gray: #f7f7f7;
    --dark-gray: #444;
    --transition: all 0.3s ease;
}

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

/* Tighter line spacing for mobile breaks */
.d-md-none br {
    content: "";
    display: block;
    margin-bottom: 0;
    line-height: 0.8;
    height: 4px; /* Reduced space between lines */
}

/* Mobile address specific styling */
.address-mobile {
    display: block;
    text-align: center;
    line-height: 1.3;
}

.address-mobile i {
    margin-right: 5px;
    vertical-align: top;
}

.address-mobile br {
    display: block;
    content: "";
    margin: 0;
    height: 2px;
}

body {
    font-family: 'Noto Sans TC', 'Arial', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
}

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

ul {
    list-style: none;
}

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

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h6 {
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.section-header h2 {
    color: var(--secondary-color);
    font-size: 36px;
    font-weight: 700;
    position: relative;
    padding-bottom: 15px;
}

.section-header h2:after {
    content: '';
    position: absolute;
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.primary-btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition);
}

.primary-btn:hover {
    background-color: var(--secondary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Top Bar */
.top-bar {
    background-color: var(--secondary-color);
    color: white;
    padding: 10px 0;
    font-size: 14px;
}

.top-bar span {
    margin-right: 20px;
    display: inline-block;
    vertical-align: middle;
}

.top-bar i {
    margin-right: 5px;
    vertical-align: middle;
}

.top-bar .text-end {
    text-align: right !important;
}

/* Header */
.main-header {
    padding: 20px 0;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    margin: 0;
    padding: 0;
}

.logo h1 {
    margin: 0;
    font-size: 24px;
    color: var(--primary-color);
    font-weight: 700;
}

.logo span {
    display: block;
    font-size: 14px;
    color: var(--secondary-color);
}

.main-menu {
    display: flex;
    justify-content: flex-end;
    margin-top: 0; /* Remove top margin */
}

/* Updated to properly handle Bootstrap's display utilities */
.main-menu.d-none.d-md-block {
    display: flex !important;
}

.main-menu ul {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0;
}

.main-menu ul li {
    position: relative;
    margin: 0 15px;
}

.main-menu ul li a {
    display: block;
    padding: 10px 0;
    font-weight: 600;
    color: var(--secondary-color);
}

.main-menu ul li a:hover {
    color: var(--primary-color);
}

.main-menu .submenu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 220px;
    background-color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 1;
    padding: 10px 0;
}

.main-menu ul li:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.main-menu .submenu li {
    margin: 0;
    width: 100%;
}

.main-menu .submenu li a {
    padding: 8px 20px;
    font-weight: 500;
    font-size: 14px;
}

.header-phone {
    display: flex;
    align-items: center;
    margin-left: 20px;
    margin-bottom: 0;
    position: relative; /* Change from absolute to relative */
    background-color: rgba(0,0,0,0.03);
    padding: 8px 15px;
    border-radius: 4px;
    z-index: 1002; /* Ensure phone is above other elements */
}

.header-phone i {
    margin-right: 5px;
    color: var(--primary-color);
}

.header-phone span {
    font-weight: 600;
    color: var(--secondary-color);
}

.header-phone span a {
    color: inherit;
    text-decoration: none;
}

.header-phone span a:hover {
    color: var(--primary-color);
}

.contact-btn {
    display: inline-block;
    padding: 8px 15px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
}

.contact-btn:hover {
    background-color: var(--secondary-color);
    color: white;
}

/* Hero Section */
.hero-section {
    background-image: url('https://images.unsplash.com/photo-1505664194779-8beaceb93744');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 150px 0;
    position: relative;
}

.hero-section:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-content h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 18px;
    margin-bottom: 30px;
    max-width: 600px;
}

/* About Section */
.about-section {
    padding: 100px 0;
    background-color: var(--light-gray);
}

.about-image img {
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    max-width: 90%;
    display: block;
    margin: 0 auto;
}

.about-content {
    padding: 0 20px;
}

.about-content p {
    margin-bottom: 30px;
    font-size: 16px;
}

.about-box {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--primary-color);
}

.about-box h4 {
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.phone-box {
    display: flex;
    align-items: center;
    margin-top: 15px;
}

.phone-box i {
    color: var(--primary-color);
    font-size: 20px;
    margin-right: 10px;
}

.phone-box span {
    font-size: 20px;
    font-weight: 700;
    color: var(--secondary-color);
}

.phone-box span a {
    color: inherit;
    text-decoration: none;
}

.phone-box span a:hover {
    color: var(--primary-color);
}

/* Stats Section */
.stats-section {
    padding: 80px 0;
    background-color: white;
}

.stat-box {
    text-align: center;
    padding: 30px;
    transition: var(--transition);
    border-radius: 8px;
}

.stat-box:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transform: translateY(-5px);
}

.stat-box h3 {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-weight: 700;
}

.stat-box h5 {
    color: var(--secondary-color);
    font-size: 16px;
    font-weight: 600;
}

/* Services Section */
.services-section {
    padding: 100px 0;
    background-color: var(--light-gray);
}

.hidden-service {
    display: none;
}

.service-box {
    background-color: white;
    padding: 30px;
    border-radius: 6px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    text-align: center;
    margin-bottom: 30px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.service-box:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.service-box i {
    font-size: 40px;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.service-box h4 {
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-weight: 700;
}

.service-box p {
    margin-bottom: 20px;
    font-size: 15px;
    height: 48px; /* Fixed height for text to ensure alignment */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.read-more {
    color: var(--primary-color);
    font-weight: 600;
    display: inline-block;
    position: relative;
    margin-top: auto;
}

.read-more:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    bottom: -2px;
    left: 0;
    transition: var(--transition);
}

.read-more:hover:after {
    width: 100%;
}

/* Testimonials Section */
.testimonials-section {
    padding: 100px 0;
    background-color: white;
}

.testimonial-box {
    background-color: var(--light-gray);
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    position: relative;
}

.testimonial-box:after {
    content: '\f10e';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    color: rgba(0, 0, 0, 0.1);
}

.testimonial-box p {
    margin-bottom: 20px;
    font-style: italic;
}

.client-info h4 {
    font-size: 18px;
    color: var(--secondary-color);
    margin-bottom: 5px;
}

.client-info span {
    font-size: 14px;
    color: var(--primary-color);
}

/* Team Section */
.team-section {
    padding: 100px 0;
    background-color: var(--light-gray);
}

.team-box {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
    text-align: center;
}

.team-image {
    position: relative;
    overflow: hidden;
}

.team-image img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    transition: var(--transition);
}

.team-box:hover .team-image img {
    transform: scale(1.1);
}

.team-box h4 {
    font-size: 20px;
    color: var(--secondary-color);
    margin: 20px 0 5px;
}

.team-box span {
    display: block;
    color: var(--primary-color);
    font-size: 14px;
    margin-bottom: 20px;
}

/* CTA Section */
.cta-section {
    padding: 80px 0;
    background-color: var(--secondary-color);
    color: white;
    position: relative;
    overflow: hidden;
}

/* Animated background for CTA section */
.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(157, 34, 53, 0.3) 0%, rgba(26, 58, 95, 0.3) 100%);
    z-index: 1;
    animation: gradientMove 10s ease infinite alternate;
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.cta-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.7;
    animation: backgroundMove 20s linear infinite;
    z-index: 0;
}

@keyframes backgroundMove {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 100px 100px;
    }
}

.cta-section .container {
    position: relative;
    z-index: 2;
}

.cta-section h2 {
    font-size: 36px;
    margin-bottom: 10px;
    animation: fadeInUp 1s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
    animation-play-state: paused;
}

.cta-section p {
    font-size: 18px;
    animation: fadeInUp 1s ease-out 0.3s forwards;
    opacity: 0;
    transform: translateY(20px);
    animation-play-state: paused;
}

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

.cta-section .primary-btn {
    background-color: white;
    color: var(--secondary-color);
    position: relative;
    overflow: hidden;
    transition: all 0.5s ease;
    animation: fadeInUp 1s ease-out 0.6s forwards;
    opacity: 0;
    transform: translateY(20px);
    animation-play-state: paused;
}

.cta-section .primary-btn:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.cta-section .primary-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.cta-section .primary-btn:hover::before {
    width: 300px;
    height: 300px;
}

/* Contact Section */
.contact-section {
    padding: 100px 0;
    background-color: var(--light-gray);
}

.contact-info {
    margin-bottom: 30px;
}

.info-box {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    text-align: center;
    margin-bottom: 30px;
    height: 240px; /* Increased height from 200px to 240px */
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: var(--transition);
}

.info-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.info-box i {
    font-size: 30px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.info-box h4 {
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.info-box p {
    margin-bottom: 5px;
}

.info-box p a {
    color: var(--secondary-color);
    font-weight: 600;
}

.info-box p a:hover {
    color: var(--primary-color);
}

.info-box p.english-address {
    font-size: 0.9em;
    color: var(--dark-gray);
    opacity: 0.7;
}

/* Branch Office & Staff Styling */
.branch-header {
    margin-top: 60px;
}

.staff-info {
    display: flex;
    flex-direction: column;
}

.staff-info p {
    margin-bottom: 8px;
    line-height: 1.5;
}

@media (max-width: 767px) {
    .staff-info p {
        font-size: 14px;
    }
}

.contact-form {
    background-color: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.contact-form input,
.contact-form select,
.contact-form textarea {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.contact-form textarea {
    height: 150px;
    resize: none;
}

.map {
    border-radius: 8px;
    overflow: hidden;
    height: 100%;
}

/* Footer */
.main-footer {
    padding-top: 80px;
    background-color: var(--secondary-color);
    color: white;
}

.footer-about,
.footer-address,
.footer-contact,
.footer-links {
    margin-bottom: 40px;
}

.footer-about h3,
.footer-address h3,
.footer-contact h3,
.footer-links h3 {
    margin-bottom: 20px;
    font-size: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-about h3:after,
.footer-address h3:after,
.footer-contact h3:after,
.footer-links h3:after {
    content: '';
    position: absolute;
    width: 40px;
    height: 2px;
    background-color: var(--primary-color);
    bottom: 0;
    left: 0;
}

.footer-phone {
    margin-top: 20px;
}

.footer-phone a {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: white;
}

.footer-phone span {
    font-size: 14px;
    color: #ccc;
}

.footer-links {
    text-align: left;
}

.footer-links ul {
    text-align: left;
    padding-left: 0;
}

.footer-links ul li {
    margin-bottom: 10px;
    text-align: left;
}

.footer-links ul li a {
    text-align: left;
    display: inline-block;
}

.footer-links ul li a:hover {
    color: var(--primary-color);
}

.footer-contact a {
    color: white;
}

.footer-contact a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 0;
    margin-top: 30px;
}

.footer-bottom .row {
    justify-content: center;
}

/* Ensure copyright text breaks in two lines */
.footer-bottom p {
    white-space: normal;
    text-align: center;
    word-break: break-word;
    width: 100%;
    max-width: 100%;
    padding: 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Footer */
.footer-contact p {
    margin-bottom: 5px;
}

.footer-contact.mt-3 {
    margin-top: 15px !important;
}

.footer-address.mt-4 {
    margin-top: 20px !important;
}

.footer-address p {
    margin-bottom: 5px;
}

/* Responsive Styles */
@media (max-width: 991px) {
    .main-header {
        padding: 15px 0;
    }
    
    .main-menu {
        margin-top: 0;
    }
    
    .main-menu.d-none.d-md-block {
        display: none !important; /* Properly hide on mobile */
    }
    
    .main-menu.mobile-active {
        display: block !important; /* Show when mobile menu is active */
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        z-index: 1005;
    }
    
    .main-menu ul {
        flex-direction: column;
        display: none;
    }
    
    .hero-content h1 {
        font-size: 36px;
    }
    
    .section-header h2 {
        font-size: 30px;
    }

    .mobile-menu-btn {
        top: 50% !important;
        transform: translateY(-50%) !important;
    }
}

@media (max-width: 767px) {
    /* Mobile styles */
    
    .service-box {
        height: auto; /* Auto height for mobile */
    }
    
    .info-box {
        height: auto; /* Auto height for mobile */
    }
    
    .footer-bottom p .d-md-none br {
        display: block;
        margin: 0;
        line-height: 1.2;
    }
    
    .top-bar {
        text-align: center;
        padding: 5px 0;
    }
    
    .top-bar .row > div {
        margin: 5px 0;
    }
    
    .top-bar span {
        display: block;
        margin: 5px 0;
    }
    
    .top-bar span:last-child {
        margin-right: 0;
    }
    
    .address-mobile {
        display: inline-block;
        text-align: center;
        padding: 5px 0;
    }
    
    .hero-section {
        padding: 50px 0;
    }
    
    .hero-content p {
        font-size: 14px;
    }
    
    .contact-form {
        margin-bottom: 30px;
    }
    
    .section-header {
        margin-bottom: 30px;
    }
    
    .team-image img {
        max-width: 200px;
    }
    
    .logo {
        text-align: center;
        margin-bottom: 10px;
    }
    
    .main-header .container {
        position: relative;
    }
    
    .main-menu.mobile-active {
        opacity: 1;
        visibility: visible;
    }
    
    /* Branch office mobile styles */
    .staff-info p {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .branch-header {
        margin-top: 30px;
    }
    
    .contact-info .info-box {
        padding: 20px 15px;
    }
    
    .info-box p.english-address {
        font-size: 0.85em;
    }
    
    .info-box p.english-address .d-md-none br {
        line-height: 1.2;
        height: 2px;
    }
    
    .about-image {
        margin-bottom: 30px;
    }
    
    .about-content {
        padding: 0 15px;
    }
}

.header-phone span a,
.phone-box span a,
.info-box p a {
    color: inherit;
    text-decoration: none;
}

.header-phone span a:hover,
.phone-box span a:hover,
.info-box p a:hover {
    color: var(--primary-color);
} 