/* CSS Variables for Premium Theme */
:root {
    --primary-color: #0A3D73;      /* Deep Trust Blue */
    --secondary-color: #F29F05;    /* Safety Orange/Yellow */
    --text-main: #333333;          /* Dark Gray for readable text */
    --text-muted: #666666;
    --bg-light: #F8F9FA;
    --bg-white: #FFFFFF;
    --border-color: #E0E0E0;
    
    --font-heading: 'Prompt', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --transition: all 0.3s ease;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.08);
    --shadow-lg: 0 16px 40px rgba(0,0,0,0.12);
    --border-radius: 8px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--text-main);
    line-height: 1.6;
    background-color: var(--bg-white);
    overflow-x: hidden; /* Prevent horizontal scrolling */
    width: 100%;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--primary-color);
    font-weight: 600;
    line-height: 1.3;
}

p {
    margin-bottom: 1rem;
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: cover; /* Prevent image distortion */
}

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

.text-center { text-align: center; }
.section-padding { padding: 80px 0; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 30px;
    font-family: var(--font-heading);
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background-color: var(--secondary-color);
    color: #fff;
    box-shadow: 0 4px 15px rgba(242, 159, 5, 0.3);
}

.btn-primary:hover {
    background-color: #d98e04;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(242, 159, 5, 0.4);
    color: #fff;
}

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

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

.btn-large {
    padding: 14px 32px;
    font-size: 1.1rem;
}

.btn-block {
    display: block;
    width: 100%;
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    background-color: rgba(255,255,255,0.2);
    color: #fff;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 1px;
    margin-bottom: 20px;
    backdrop-filter: blur(5px);
}

.badge-dark {
    background-color: rgba(10, 61, 115, 0.1);
    color: var(--primary-color);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: var(--transition);
    padding: 15px 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i { color: var(--secondary-color); font-size: 1.8rem; }
.logo span { color: var(--secondary-color); font-weight: 400; }
.logo .brand-icon { height: 44px; width: auto; object-fit: contain; }

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

.nav-links a {
    color: var(--text-main);
    font-weight: 500;
    font-family: var(--font-heading);
    position: relative;
}

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

.nav-links a:hover, .nav-links a.active { color: var(--primary-color); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
}

.mobile-menu {
    display: none;
    flex-direction: column;
    padding: 20px;
    background: #fff;
    border-top: 1px solid var(--border-color);
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    box-shadow: var(--shadow-md);
}

.mobile-menu a {
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    font-family: var(--font-heading);
    font-weight: 500;
}

.mobile-menu .btn {
    margin-top: 15px;
    border-bottom: none;
    text-align: center;
}

.mobile-menu.active {
    display: flex;
}

/* Hero Section */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    background-color: var(--primary-color);
    background-image: url('images/hero_bg.png'); /* Will copy images later */
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: #fff;
    padding-top: 80px; /* Offset for fixed nav */
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(10, 61, 115, 0.9) 0%, rgba(10, 61, 115, 0.4) 100%);
}

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

.hero-text-box {
    max-width: 650px;
}

.hero h1 {
    color: #fff;
    font-size: 3.5rem;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 40px;
    opacity: 0.9;
}

.hero-actions {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

/* Section Headings */
.section-heading {
    margin-bottom: 50px;
}

.section-heading h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

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

.section-heading p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Services */
.services {
    background-color: var(--bg-light);
}

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

.service-card {
    background: #fff;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.service-img {
    height: 200px;
    background-color: #ddd;
    background-size: cover;
    background-position: center;
}

#img-service-legal { background-image: url('images/service_legal.png'); }
#img-service-structure { background-image: url('images/service_structure.png'); }
#img-service-fire { background-image: url('images/service_fire.png'); }

.service-content {
    padding: 30px;
    position: relative;
}

.service-icon {
    position: absolute;
    top: -25px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--secondary-color);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 10px rgba(242, 159, 5, 0.4);
}

.service-card h3 {
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.service-card p {
    color: var(--text-muted);
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.service-link {
    font-weight: 600;
    font-family: var(--font-heading);
    display: flex;
    align-items: center;
    gap: 5px;
}

.service-link:hover {
    gap: 10px;
}

/* Trust Section */
.trust {
    background-color: var(--bg-white);
}

.trust-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.trust-content h2 {
    font-size: 2.2rem;
    margin-bottom: 20px;
}

.trust-list {
    list-style: none;
    margin-top: 30px;
}

.trust-list li {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.trust-list i {
    color: var(--secondary-color);
    font-size: 1.5rem;
    margin-top: 5px;
}

.trust-list h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: var(--text-main);
}

.trust-list p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

.trust-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.stat-box {
    background: var(--bg-light);
    padding: 30px 20px;
    text-align: center;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    font-family: var(--font-heading);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* Gallery Section */
.gallery {
    background-color: var(--primary-color);
    color: #fff;
}

.gallery .section-heading h2 {
    color: #fff;
}

.gallery .section-heading p {
    color: rgba(255,255,255,0.8);
}

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

.gallery-item {
    height: 250px;
    background-color: #0d4d8c;
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    background-size: cover;
    background-position: center;
}

#gallery-1 { background-image: url('images/gallery_1.png'); }
#gallery-2 { background-image: url('images/gallery_2.png'); }
#gallery-3 { background-image: url('images/service_structure.png'); } /* Reusing image */
#gallery-4 { background-image: url('images/service_fire.png'); } /* Reusing image */

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
    opacity: 0;
    transition: var(--transition);
    display: flex;
    align-items: flex-end;
    padding: 20px;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-info {
    transform: translateY(20px);
    transition: var(--transition);
}

.gallery-item:hover .gallery-info {
    transform: translateY(0);
}

.gallery-info h4 {
    color: #fff;
    margin-bottom: 5px;
}

.gallery-info p {
    color: var(--secondary-color);
    font-size: 0.85rem;
    margin: 0;
}

/* Contact CTA */
.contact-cta {
    background-color: var(--bg-light);
    padding: 100px 0;
}

.contact-cta h2 {
    font-size: 2.2rem;
    margin-bottom: 15px;
}

.contact-cta > .container > p {
    color: var(--text-muted);
    margin-bottom: 50px;
    font-size: 1.1rem;
}

.contact-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 50px;
}

.contact-card {
    background: #fff;
    padding: 30px 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: block;
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.contact-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.contact-card h4 {
    color: var(--text-main);
    margin-bottom: 5px;
}

.contact-card p {
    color: var(--text-muted);
    margin: 0;
}

.quotation-form-container {
    max-width: 900px;
    margin: 0 auto;
    background: #fff;
    padding: 0;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    text-align: left;
    overflow: hidden;
}

/* Step Indicator */
.form-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: #fdfbf7; /* Light warm background */
    border-bottom: 3px solid #d4af37; /* Gold accent line */
}

.step {
    display: flex;
    align-items: center;
    gap: 10px;
}

.step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #e0e0e0;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.step.active .step-number {
    background-color: #d4af37; /* Active gold */
}

.step-label {
    font-weight: 500;
    color: var(--text-muted);
}

.step.active .step-label {
    color: var(--text-main);
    font-weight: 600;
}

.step-connector {
    flex-grow: 1;
    height: 1px;
    background-color: #e0e0e0;
    margin: 0 15px;
}

/* Form Sections */
.quote-form {
    padding: 40px;
}

.form-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.icon-wrapper {
    width: 40px;
    height: 40px;
    background-color: #f0f4f8;
    color: var(--primary-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.section-header h3 {
    color: var(--primary-color);
    margin: 0;
    font-size: 1.3rem;
}

/* Grid & Inputs */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

.input-group.full-width {
    grid-column: 1 / -1;
}

.input-group label {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-main);
}

.required {
    color: #e74c3c;
}

input, select, textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    background-color: #fff;
    transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(10, 61, 115, 0.1);
}

textarea {
    resize: vertical;
}

/* Items Table */
.items-table-container {
    width: 100%;
    overflow-x: auto;
}

.items-table-header {
    display: flex;
    background-color: #f4f6f9;
    padding: 15px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
    margin-bottom: 10px;
}

.item-row {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    gap: 10px;
}

.col-name { flex: 3; min-width: 200px; }
.col-qty { flex: 1; min-width: 80px; }
.col-unit { flex: 1.5; min-width: 100px; }
.col-budget { flex: 1.5; min-width: 120px; }
.col-action { flex: 0.5; min-width: 40px; text-align: center; }

.btn-remove-item {
    background: none;
    border: none;
    color: #e74c3c;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    padding: 5px;
}

.btn-remove-item:hover {
    color: #c0392b;
    transform: scale(1.1);
}

.btn-add-item {
    background-color: #fdfbf7;
    border: 1px dashed #d4af37;
    color: #b08d28;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 15px;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 15px;
}

.btn-add-item:hover {
    background-color: #f7f1e3;
}

/* Footer */
footer {
    background-color: #072a50; /* Darker Blue */
    color: #fff;
    padding-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo {
    color: #fff;
    margin-bottom: 20px;
}

.footer-brand p {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    color: #fff;
}

.social-links a:hover {
    background: var(--secondary-color);
    transform: translateY(-3px);
}

.footer-links h4 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

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

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: rgba(255,255,255,0.7);
}

.footer-links a:hover {
    color: var(--secondary-color);
    padding-left: 5px;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 20px 0;
    background-color: #051d38;
}

.footer-bottom p {
    margin: 0;
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 992px) {
    .trust-layout {
        grid-template-columns: 1fr;
    }
    
    .hero {
        background-attachment: scroll; /* แก้ปัญหาภาพซูมเกินใน iOS (iPhone, iPad) */
        background-position: 80% center; /* เลื่อนโฟกัสภาพไปทางขวาเพื่อให้เห็นวิศวกร */
    }
    
    .hero h1 {
        font-size: 2.8rem;
    }
}

@media (max-width: 768px) {
    .nav-links, .nav-cta {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .section-padding {
        padding: 50px 0;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.8rem;
    }
    .hero p {
        font-size: 1rem;
    }
    .section-heading h2 {
        font-size: 1.8rem;
    }
    .trust-stats {
        grid-template-columns: 1fr; /* Stack stats on very small screens */
    }
    .btn-large {
        padding: 12px 24px;
        font-size: 1rem;
        width: 100%; /* Full width buttons on mobile */
        margin-bottom: 10px;
    }
    .hero-actions {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
}

/* Article Modal */
.article-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    overflow-y: auto;
    padding: 40px 20px;
}
.article-modal-content {
    background-color: #fff;
    margin: 40px auto;
    padding: 0;
    border-radius: var(--border-radius);
    max-width: 800px;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: modalFadeIn 0.3s;
    overflow: hidden;
}
@keyframes modalFadeIn {
    from {opacity: 0; transform: translateY(-30px);}
    to {opacity: 1; transform: translateY(0);}
}
.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #fff;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    transition: var(--transition);
}
.close-modal:hover {
    color: var(--secondary-color);
}
.modal-img {
    width: 100%;
    height: 350px;
    background-size: cover;
    background-position: center;
    position: relative;
}
.modal-img::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 80px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 100%);
}
.modal-body {
    padding: 40px;
}
.modal-category {
    display: inline-block;
    padding: 6px 15px;
    background: rgba(242, 159, 5, 0.1);
    color: var(--secondary-color);
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 20px;
}
.modal-title {
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    line-height: 1.3;
}
.modal-meta {
    color: #888;
    font-size: 0.95rem;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}
.modal-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-main);
    white-space: pre-wrap;
}

@media (max-width: 768px) {
    .modal-title { font-size: 1.6rem; }
    .modal-body { padding: 25px; }
    .modal-img { height: 250px; }
}
