/* CSS Variables & Reset */
:root {
    /* Color Palette */
    --primary-color: #0a4d92;
    --primary-dark: #073a6e;
    --secondary-color: #333333;
    --accent-color: #008ba3;
    --accent-light: #00bcd4;

    /* Semantic UI Colors */
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --text-main: #2d3436;
    --text-muted: #636e72;
    --border-color: #dfe6e9;

    /* Menu Styles (from images/menu_style.png) */
    --header-bg: #DFEAF5;
    --header-text: #4A6DAB;
    --header-text-hover: #2B4A8E;

    /* Spacing Scale */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-xxl: 4rem;

    /* Global Settings */
    --header-height: 100px;
    --radius: 4px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft JhengHei", Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-main);
    background-color: var(--bg-white);
    overflow-x: hidden;
}

:focus-visible {
    outline: 3px solid var(--accent-light);
    outline-offset: 2px;
}

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

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* Header & Navigation */
header {
    background: var(--header-bg);
    min-height: var(--header-height);
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

header.scrolled {
    min-height: 80px;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: var(--space-sm) var(--space-lg);
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
}

.logo-container img {
    height: 50px;
    width: auto;
}

.logo-container span {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--header-text);
    margin-top: 2px;
}

nav ul {
    display: flex;
}

nav ul li {
    margin-left: var(--space-xl);
}

nav ul li a {
    font-weight: 700;
    color: var(--header-text);
    padding: var(--space-xs) 0;
    font-size: 1.1rem;
}

nav ul li a:hover,
nav ul li a.active {
    color: var(--header-text-hover);
}

.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--header-text);
}

/* Hero Section */
.hero {
    height: 60vh;
    background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.6)), url('../images/hero2.jpg') no-repeat center center/cover;
    display: flex;
    align-items: center;
    color: var(--bg-white);
    text-align: center;
    margin-top: var(--header-height);
}

.hero-content {
    width: 100%;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: var(--space-md);
}

.hero-content p {
    font-size: 1.25rem;
    max-width: 800px;
    margin: 0 auto;
}

.btn {
    display: inline-block;
    background: var(--primary-color);
    color: var(--bg-white);
    padding: var(--space-sm) var(--space-xl);
    border-radius: var(--radius);
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

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

/* Prominent Hero Button */
.btn-hero {
    font-size: 1.4rem;
    padding: var(--space-md) var(--space-xxl);
    background: var(--primary-color);
    color: var(--bg-white);
    display: inline-block;
    border-radius: 50px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    transition: var(--transition);
    font-weight: 700;
    margin-top: var(--space-lg);
}

.btn-hero:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.5);
}

/* Section General */
.section-padding {
    padding: var(--space-xxl) 0;
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-xxl);
}

.section-header h2 {
    font-size: 2.2rem;
    color: var(--primary-color);
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
}

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

.bg-light {
    background: var(--bg-light);
}

/* Cards & Components */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-xl);
}

.card {
    background: var(--bg-white);
    padding: var(--space-xl);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
}

/* Services Page Specific */
.service-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: var(--space-xxl);
    background: var(--bg-white);
    padding: var(--space-xl);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.service-icon {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    margin-right: var(--space-xl);
    object-fit: contain;
}

.service-content h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
}

/* Organization Chart */
.org-chart {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: var(--space-xl);
    overflow-x: auto;
    width: 100%;
    padding-bottom: var(--space-xl);
}

.org-level {
    display: flex;
    justify-content: center;
    gap: var(--space-xl);
    position: relative;
}

.org-level.top-level {
    padding-bottom: var(--space-xl);
}

.org-level.branches {
    padding-top: var(--space-xl);
}

.org-level.branches::before {
    content: '';
    position: absolute;
    top: 0;
    left: 79px;
    /* Half of 160px node minus half line width */
    right: 79px;
    height: 2px;
    background: var(--primary-color);
}

.org-node {
    background: var(--bg-white);
    border: 2px solid var(--primary-color);
    padding: var(--space-md);
    border-radius: var(--radius);
    text-align: center;
    position: relative;
    width: 160px;
    box-shadow: var(--shadow);
    z-index: 2;
}

.org-node::before {
    content: '';
    position: absolute;
    top: -30%;
    left: calc(50% - 1px);
    width: 2px;
    height: 30%;
    background: var(--primary-color);
}

.top-level .org-node::before {
    display: none;
}

.top-level .org-node::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: calc(50% - 1px);
    width: 2px;
    height: 30%;
    background: var(--primary-color);
}

.org-node h4 {
    font-size: 1rem;
    margin-bottom: 2px;
    color: var(--primary-color);
}

.org-node p {
    font-size: 0.85rem;
    margin: 0;
}

/* History Timeline Original */
.timeline-original {
    position: relative;
    max-width: 800px;
    margin: 40px auto 0;
}

.timeline-original::after {
    content: '';
    position: absolute;
    width: 2px;
    background: var(--primary-color);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1px;
}

.timeline-item-original {
    padding: 10px 40px;
    position: relative;
    background: inherit;
    width: 50%;
}

.timeline-item-original::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    right: -10px;
    background-color: var(--bg-white);
    border: 4px solid var(--primary-color);
    top: 15px;
    border-radius: 50%;
    z-index: 1;
}

.timeline-item-original:nth-child(even) {
    left: 50%;
}

.timeline-item-original:nth-child(odd) {
    left: 0;
    text-align: right;
}

.timeline-item-original:nth-child(even)::after {
    left: -10px;
}

.timeline-date {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: 5px;
}

.timeline-content-original {
    color: var(--text-main);
    font-size: 1.1rem;
}

/* Contact Grid */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xxl);
    align-items: start;
}

.contact-info h3 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: var(--space-md);
}

.info-items {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.info-item {
    display: flex;
    align-items: center;
}

.info-item i {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-right: var(--space-md);
    width: 30px;
    text-align: center;
}

.contact-form {
    background: var(--bg-light);
    padding: var(--space-xl);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: var(--space-md);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

/* Footer */
footer {
    background: var(--header-bg);
    color: var(--header-text);
    padding: var(--space-xl) 0;
    text-align: center;
}

.footer-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: var(--space-md);
}

.footer-logo img {
    height: 40px;
    margin-bottom: 5px;
}

.footer-logo span {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--header-text);
}

.footer-contact {
    margin-bottom: var(--space-md);
}

.footer-contact p {
    font-size: 1rem;
    margin-bottom: var(--space-xs);
    color: var(--header-text);
}

.copyright {
    font-size: 0.85rem;
    border-top: 1px solid rgba(74, 109, 171, 0.2);
    padding-top: var(--space-md);
    margin-top: var(--space-md);
    color: var(--header-text);
}

/* Responsive */
@media (max-width: 992px) {
    .org-level.branches::before {
        left: 79px;
        right: 79px;
    }
}

@media (max-width: 768px) {
    nav ul {
        display: none;
    }

    .mobile-toggle {
        display: block;
    }

    .service-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .service-icon {
        margin-right: 0;
        margin-bottom: var(--space-md);
    }

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

    .timeline-original::after {
        left: 20px;
    }

    .timeline-item-original {
        width: 100%;
        padding-left: var(--space-xxl);
        text-align: left !important;
    }

    .timeline-item-original::after {
        left: 12px;
    }

    .timeline-item-original:nth-child(even) {
        left: 0;
    }

    .org-level {
        flex-direction: column;
        align-items: center;
        gap: var(--space-md);
    }

    .org-level.top-level {
        padding-bottom: var(--space-md);
    }

    .org-level.branches {
        padding-top: 0;
    }

    .org-level.branches::before {
        display: none;
    }

    .org-node::before {
        height: var(--space-md);
        top: -var(--space-md);
    }

    .top-level .org-node::after {
        display: block;
        height: var(--space-md);
        bottom: -var(--space-md);
    }
}