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

:root {
    --primary-color: #1a4d7a;
    --secondary-color: #d4af37;
    --dark-color: #1a1a1a;
    --light-color: #f5f5f5;
    --text-color: #333;
    --white: #ffffff;
    --gray: #666;
    --light-gray: #e0e0e0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo h2 {
    font-size: 1.8rem;
    color: var(--primary-color);
}

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

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

@media (min-width: 992px) {
    /* เผื่อพื้นที่ด้านขวาไว้สำหรับปุ่มเลือกภาษาในแถบเมนู */
    .nav-menu {
        margin-right: 190px;
    }
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
}

.nav-menu a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--secondary-color);
}

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    gap: 5px;
    padding: 10px;
    margin: -10px 0;
    z-index: 1001;
    position: relative;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--primary-color);
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

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

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

/* Mobile bottom navigation (tabs) */
.bottom-nav {
    display: none;
}

@media (max-width: 768px) {
    body {
        padding-bottom: 64px;
    }

    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 56px;
        background: var(--white);
        box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
        z-index: 999;
        align-items: center;
        justify-content: space-around;
        padding: 0 8px;
        border-top: 1px solid rgba(0,0,0,0.06);
    }

    .bottom-nav-item {
        flex: 1;
        text-align: center;
        text-decoration: none;
        color: var(--gray);
        font-size: 0.7rem;
        font-weight: 500;
        padding: 8px 4px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        transition: color 0.2s ease;
    }

    .bottom-nav-item:hover,
    .bottom-nav-item.active {
        color: var(--primary-color);
    }

    .bottom-nav-item.active {
        font-weight: 600;
    }

    .hamburger-label {
        display: inline;
        font-size: 0.8rem;
        font-weight: 500;
        color: var(--primary-color);
        margin-left: 4px;
    }

    .hamburger-wrapper {
        display: flex;
        align-items: center;
        z-index: 1001;
        position: relative;
    }

    .hamburger-wrapper .hamburger {
        margin: 0;
    }
}

@media (min-width: 769px) {
    .hamburger-label {
        display: none !important;
    }
}

/* Hero Section */
.hero {
    position: relative;
    height: 100vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 70px;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(26, 77, 122, 0.85) 0%, rgba(42, 93, 138, 0.75) 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: var(--white);
    padding: 2rem;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

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

.btn-primary:hover {
    background: #b8941f;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.4);
}

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

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

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

.btn-white:hover {
    background: var(--light-color);
    transform: translateY(-2px);
}

/* Features Section */
.features {
    padding: 5rem 0;
    background: var(--white);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    text-align: center;
    padding: 2rem;
    border-radius: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.feature-card p {
    color: var(--gray);
    line-height: 1.8;
}

/* Services Preview */
.services-preview {
    padding: 5rem 0;
    background: var(--light-color);
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-tag {
    color: var(--secondary-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.section-header h2 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-top: 0.5rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.service-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.service-card p {
    color: var(--gray);
    margin-bottom: 1rem;
    line-height: 1.8;
}

.service-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.service-link:hover {
    color: var(--primary-color);
}

/* CTA Section */
.cta-section {
    padding: 5rem 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, #2a5d8a 100%);
    text-align: center;
    color: var(--white);
}

.cta-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cta-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2a5d8a 100%);
    color: var(--white);
    padding: 8rem 0 4rem;
    text-align: center;
    margin-top: 70px;
}

.page-header h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.page-header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* About Section */
.about-section {
    padding: 5rem 0;
    background: var(--white);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.about-text h2 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin: 1rem 0;
}

.about-text p {
    color: var(--gray);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.about-image {
    height: 400px;
}

.about-image-wrapper {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}

.about-image-wrapper:hover {
    transform: scale(1.05);
}

.image-placeholder {
    width: 100%;
    height: 100%;
    background: var(--light-gray);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray);
    font-size: 1.2rem;
}

/* Values Section */
.values-section {
    padding: 5rem 0;
    background: var(--light-color);
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.value-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.value-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.value-card p {
    color: var(--gray);
    line-height: 1.8;
}

/* Legal services detail card (homepage) */
.legal-details {
    padding: 60px 0 70px;
    background: #f5f7fb;
}

.legal-details .section-header {
    text-align: center;
    margin-bottom: 32px;
}

.legal-details .section-tag {
    display: inline-block;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #2563eb;
    margin-bottom: 8px;
}

.legal-details h2 {
    font-size: clamp(1.35rem, 3vw, 1.8rem);
    color: #0f172a;
}

.legal-details-body {
    max-width: 980px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 16px;
    padding: 28px 28px 30px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    border: 1px solid #e2e8f0;
}

.legal-details-intro p {
    margin-bottom: 1rem;
    line-height: 1.9;
    font-size: 1rem;
    color: #1e293b;
}

.legal-scope-title {
    margin-top: 1.75rem;
    margin-bottom: 1rem;
    font-size: 1.15rem;
    color: #0f172a;
    font-weight: 700;
}

.legal-scope-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem 1.5rem;
}

.legal-scope-grid li {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    line-height: 1.75;
    font-size: 1rem;
    color: #334155;
    word-break: break-word;
}

.legal-scope-grid li::before {
    content: '';
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    margin-top: 0.55rem;
    border-radius: 50%;
    background: #2563eb;
}

@media (min-width: 768px) {
    .legal-scope-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .legal-details-intro p {
        font-size: 1.05rem;
    }
}

@media (max-width: 640px) {
    .legal-details {
        padding: 40px 0 50px;
    }

    .legal-details-body {
        padding: 20px 18px 22px;
    }
}

/* Team Section */
.team-section {
    padding: 5rem 0;
    background: var(--white);
}

.team-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: start;
}

.team-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: auto;
    min-height: 0;
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0,0,0,0.06);
}

.team-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.12);
}

.team-image {
    flex: 0 0 auto;
    width: 100%;
    aspect-ratio: 3 / 4;
    min-height: 0;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
}

.team-card-body {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    gap: 0.25rem;
    padding: 12px 16px 16px;
}

.team-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.2) 100%);
    transition: opacity 0.3s ease;
}

.team-card:hover .team-image::before {
    opacity: 0;
}

.team-image .image-placeholder {
    height: 100%;
    border-radius: 0;
}

.team-card h3 {
    color: var(--primary-color);
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.4;
}

.team-role {
    color: var(--secondary-color);
    font-weight: 600;
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

.team-bio {
    color: var(--gray);
    line-height: 1.75;
    font-size: 0.95rem;
    margin: 0;
}

@media (min-width: 576px) {
    .team-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 992px) {
    .team-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1.75rem;
    }
}

@media (min-width: 1200px) {
    .team-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Chinese typography tweaks */
html[data-lang="zh"] .legal-details-intro p,
html[data-lang="zh"] .legal-scope-grid li,
html[data-lang="zh"] .team-bio {
    line-height: 1.85;
    letter-spacing: 0.02em;
}

/* Services Section */
.services-section {
    padding: 5rem 0;
    background: var(--white);
}

.services-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.service-item {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 2rem;
    padding: 2rem;
    background: var(--light-color);
    border-radius: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-item:hover {
    transform: translateX(10px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.service-icon {
    font-size: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-icon-wrapper {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--light-color);
    border-radius: 15px;
    padding: 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-item:hover .service-icon-wrapper {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.service-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.service-details h3 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.service-details p {
    color: var(--gray);
    margin-bottom: 1rem;
    line-height: 1.8;
}

.service-details ul {
    list-style: none;
    padding-left: 0;
}

.service-details li {
    color: var(--gray);
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.service-details li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--secondary-color);
    font-weight: bold;
}

/* Contact Section */
.contact-section {
    padding: 5rem 0;
    background: var(--white);
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 3rem;
}

.contact-info h2 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 2rem;
}

.info-item {
    margin-bottom: 2rem;
}

.info-item h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.info-item p {
    color: var(--gray);
    line-height: 1.8;
}

.contact-form-wrapper h2 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 2rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.form-group label {
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input,
.form-group textarea {
    padding: 1rem;
    border: 2px solid var(--light-gray);
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* QR Section */
.qr-section {
    padding: 5rem 0;
    background: var(--light-color);
}

.qr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.qr-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.qr-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

.qr-image {
    width: 100%;
    max-width: 200px;
    height: auto;
    border-radius: 10px;
    margin-bottom: 1rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.qr-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.qr-card p {
    color: var(--gray);
    font-size: 0.9rem;
}

/* Map Section */
.map-section {
    padding: 0;
}

.map-container {
    width: 100%;
    height: 400px;
    position: relative;
}

.map-container iframe {
    display: block;
}

.map-link-wrap {
    text-align: center;
    padding: 12px;
    background: var(--light-color);
}

.map-open-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
}

.map-open-link:hover {
    text-decoration: underline;
}

.map-placeholder {
    width: 100%;
    height: 100%;
    background: var(--light-gray);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--gray);
    font-size: 1.5rem;
}

/* Footer */
.footer {
    background: var(--dark-color);
    color: var(--white);
    padding: 3rem 0 1rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-col h3,
.footer-col h4 {
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.footer-col p {
    color: #ccc;
    line-height: 1.8;
}

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

.footer-col ul li {
    margin-bottom: 0.5rem;
}

.footer-col ul li a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-col ul li a:hover {
    color: var(--secondary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #333;
    color: #ccc;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-wrapper {
        flex-wrap: wrap;
    }

    .navbar .lang-switcher {
        position: static !important;
        transform: none !important;
        margin-left: auto;
        flex-shrink: 0;
    }

    .lang-switcher button {
        min-height: 36px;
        min-width: 36px;
        padding: 6px 10px;
        font-size: 0.7rem;
    }

    .team-section {
        padding-bottom: 5.5rem;
    }

    .team-card-body {
        padding-bottom: 16px;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: var(--white);
        width: 100%;
        max-width: 100vw;
        text-align: center;
        transition: left 0.3s ease;
        box-shadow: 0 10px 27px rgba(0,0,0,0.15);
        padding: 2rem 0;
        z-index: 1000;
        gap: 0;
        margin: 0;
        list-style: none;
    }

    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid rgba(0,0,0,0.06);
    }

    .nav-menu a {
        display: block;
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
    }

    .nav-menu.active {
        left: 0;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .about-content {
        grid-template-columns: 1fr;
    }

    .contact-wrapper {
        grid-template-columns: 1fr;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .section-header h2 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.5rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 300px;
    }
}
