/* Design System Variables */
:root {
    --bg-color: #F9F7F2;
    --primary-color: #8B1E1E;
    --primary-hover: #6d1717;
    --text-color: #333333;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --font-main: 'Kanit', sans-serif;
}

/* Global Reset & Typography */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

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

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

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 12px 24px;
    border-radius: 4px;
    font-weight: 400;
    cursor: pointer;
    border: none;
    transition: background-color 0.3s ease;
    text-align: center;
}

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

.text-center {
    text-align: center;
}

.section-padding {
    padding: 60px 0;
}

/* Navbar */
.navbar {
    background-color: var(--bg-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

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

.nav-links a:hover {
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    padding: 120px 0;
    text-align: center;
    position: relative;
    color: var(--white);
    overflow: hidden;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    z-index: 0;
    object-fit: cover;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    /* Dark overlay */
    z-index: 1;
}

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

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--white);
    /* Ensure H1 is white */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: #f0f0f0;
    /* Light grey for subtext */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

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

.about-content {
    display: flex;
    align-items: center;
    gap: 40px;
}

.about-text {
    flex: 1;
}

.about-image {
    flex: 1;
}

.factory-img {
    width: 100%;
    border-radius: 8px;
    box-shadow: var(--shadow);
    object-fit: cover;
    height: 350px;
}

.trust-bar {
    margin-top: 30px;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.client-logos {
    display: flex;
    justify-content: flex-start;
    /* Align left to match text */
    align-items: center;
    gap: 30px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.client-logo-img {
    height: 45px;
    /* Reduced for better balance */
    max-width: 150px;
    /* Prevent wide logos from dominating */
    width: auto;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: all 0.3s ease;
    object-fit: contain;
}

.client-logo-img:hover {
    filter: grayscale(0%);
    opacity: 1;
}

.more-clients {
    font-size: 1rem;
    color: #777;
    font-weight: 500;
    margin-left: 10px;
}

/* Responsive adjustments for About section */
@media (max-width: 768px) {
    .about-content {
        flex-direction: column;
        text-align: center;
    }

    .client-logos {
        justify-content: center;
    }
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.service-card {
    background-color: var(--white);
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s ease;
}

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

.service-icon {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

/* Footer */
footer {
    background-color: #222;
    color: #ccc;
    padding: 30px 0;
    text-align: center;
    font-size: 0.9rem;
}

/* Demo Page - Portfolio Specifics */

.subtitle {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 40px;
}

/* Filter Buttons */
.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    background-color: var(--white);
    color: var(--text-color);
    border: 2px solid var(--primary-color);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Kanit', sans-serif;
    font-weight: 400;
}

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

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

/* Portfolio Grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

/* Cover Grid (for "All" tab) */
.cover-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 40px;
}

.cover-card {
    background-color: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.cover-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.cover-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cover-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.cover-card:hover .cover-image img {
    transform: scale(1.05);
}

.cover-title {
    padding: 20px;
    text-align: center;
}

.cover-title h3 {
    font-size: 1.2rem;
    color: var(--text-color);
    margin: 0;
    font-weight: 600;
}

/* Portfolio Card */
.portfolio-card {
    background-color: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.portfolio-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.portfolio-image {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.portfolio-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.portfolio-card:hover .portfolio-image img {
    transform: scale(1.05);
}

.case-id {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: rgba(139, 30, 30, 0.9);
    color: var(--white);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.portfolio-info {
    padding: 20px;
}

.portfolio-info h3 {
    font-size: 1.2rem;
    color: var(--text-color);
    margin-bottom: 8px;
    font-weight: 600;
}

.client-type {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 15px;
    font-style: italic;
}

.spec-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.spec-tag {
    background-color: #f0f0f0;
    color: #555;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    border: 1px solid #ddd;
}

.cta-btn {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Kanit', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.cta-btn:hover {
    background-color: #6d1717;
}

/* Fabric Recommender Tool */
.recommender-section {
    background-color: var(--white);
}

.recommender-tool {
    max-width: 600px;
    margin: 0 auto;
    background-color: #f9f9f9;
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.recommender-tool .form-group {
    margin-bottom: 20px;
}

.recommender-tool label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

.recommender-tool select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: 'Kanit', sans-serif;
    font-size: 1rem;
}

.result-box {
    margin-top: 20px;
    padding: 20px;
    background-color: #e8f5e9;
    border-left: 4px solid var(--primary-color);
    border-radius: 6px;
    display: none;
}

.result-box p {
    margin: 0;
    color: var(--text-color);
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
    }

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

    .filter-buttons {
        justify-content: center;
        gap: 8px;
    }

    .filter-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .portfolio-image {
        height: 220px;
    }

    .cover-image {
        height: 200px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .nav-links {
        display: none;
        /* Simple hide for now, could be hamburger */
    }

    /* Mobile Nav Placeholder - In a real app, use JS for toggle */
    .navbar .container {
        flex-direction: column;
        gap: 10px;
    }

    .nav-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
}

/* Contact Form Styles */
.contact-section {
    background-color: #fff;
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
    background: #f9f9f9;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.contact-form .form-group {
    margin-bottom: 20px;
}

.contact-form .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.contact-form .form-group input,
.contact-form .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: 'Kanit', sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.contact-form .form-group input:focus,
.contact-form .form-group textarea:focus {
    outline: none;
    border-color: #007bff;
}

.btn-submit {
    width: 100%;
    padding: 14px;
    font-size: 1.1rem;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-submit:hover {
    background-color: #0056b3;
}

.form-message {
    margin-top: 20px;
    text-align: center;
    font-weight: 600;
    padding: 10px;
    border-radius: 6px;
    display: none;
}

.form-message.success {
    background-color: #d4edda;
    color: #155724;
    display: block;
}

.form-message.error {
    background-color: #f8d7da;
    color: #721c24;
    display: block;
}

/* Lightbox Modal */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    transition: color 0.3s ease;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: #bbb;
}

.lightbox-caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 20px;
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.1rem;
}

/* Lightbox Animation */
@keyframes zoom {
    from {
        transform: translate(-50%, -50%) scale(0);
    }

    to {
        transform: translate(-50%, -50%) scale(1);
    }
}

.lightbox-content {
    animation-name: zoom;
    animation-duration: 0.3s;
}

@media (max-width: 768px) {
    .lightbox-content {
        max-width: 95%;
        max-height: 80%;
    }

    .lightbox-close {
        top: 10px;
        right: 20px;
        font-size: 30px;
    }

    .lightbox-caption {
        font-size: 0.9rem;
        padding: 10px;
    }
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(139, 30, 30, 0.3);
    transition: all 0.3s ease;
    z-index: 999;
    opacity: 0;
}

.back-to-top.show {
    display: flex;
    opacity: 1;
}

.back-to-top:hover {
    background-color: var(--primary-hover);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(139, 30, 30, 0.4);
}

.back-to-top:active {
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
}