/* 
 * Freightlinks Express (Thailand) Co., Ltd.
 * Main Stylesheet
 * Based on original design from freightlinks.co.th
 */

/* ===================================
   1. Google Fonts Import
   =================================== */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&family=Poppins:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* ===================================
   2. CSS Variables - Color Palette
   =================================== */
:root {
    /* Primary Colors */
    --color-primary-dark: rgb(43, 51, 59);
    --color-primary-orange: rgb(249, 115, 22);
    --color-white: rgb(255, 255, 255);
    
    /* Text Colors */
    --color-light-gray-text: rgb(210, 210, 210);
    --color-muted-text: rgb(129, 140, 152);
    --color-dark-text: rgb(68, 68, 68);
    --color-body-text: rgb(43, 51, 59);
    
    /* Background Colors */
    --color-footer-bg: rgb(43, 51, 59);
    --color-repeating-group-bg: rgb(189, 189, 189);
    
    /* Font Families */
    --font-primary-heading: 'Montserrat', Helvetica, Arial, sans-serif;
    --font-secondary-heading: 'Poppins', Helvetica, Arial, sans-serif;
    --font-body: 'Inter', Helvetica, Arial, sans-serif;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--color-body-text);
    line-height: 1.6;
    background-color: var(--color-white);
    overflow-x: hidden;
}

/* ===================================
   4. Typography
   =================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

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

/* ===================================
   5. Navigation Bar
   =================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(to bottom, rgba(43, 51, 59, 0.5), rgba(255, 255, 255, 0));
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: var(--color-primary-dark);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar .container {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

.navbar-logo img {
    height: 59px;
    width: auto;
}

.navbar-menu {
    display: flex;
    justify-content: center;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.navbar-menu li a {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 500;
    color: var(--color-white);
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.navbar-menu li a:hover {
    color: var(--color-primary-orange);
}

.navbar-menu li a.active {
    font-family: var(--font-primary-heading);
    font-size: 18px;
    font-weight: 700;
}

.navbar-login {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 400;
    color: var(--color-white);
    padding: 0.5rem 1.5rem;
    border: 1px solid var(--color-white);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.navbar-login:hover {
    background-color: var(--color-primary-orange);
    border-color: var(--color-primary-orange);
}

/* Mobile Menu Toggle */
.navbar-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.navbar-toggle span {
    width: 25px;
    height: 3px;
    background: var(--color-white);
    margin: 3px 0;
    transition: 0.3s;
}

/* ===================================
   6. Hero Section
   =================================== */
.hero-section {
    position: relative;
    min-height: 630px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--color-white);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(43, 51, 59, 0.3), rgba(139, 90, 43, 0.4));
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(43, 51, 59, 0.5), rgba(255, 255, 255, 0));
}

.hero-content {
    position: relative;
    z-index: 10;
    padding: 2rem;
}

.hero-logo {
    margin-bottom: 2rem;
}

.hero-logo img {
    max-width: 192px;
    height: auto;
}

.hero-company-name {
    font-family: var(--font-primary-heading);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.hero-company-name-thai {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 400;
    margin-bottom: 2rem;
}

/* ===================================
   7. Tabs Section (Schedule/Tracking)
   =================================== */
.tabs-section {
    background: var(--color-primary-dark);
    padding: 2rem 0;
}

.tabs-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.tabs-header {
    display: flex;
    gap: 2rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 2rem;
}

.tab-button {
    font-family: var(--font-primary-heading);
    font-size: 16px;
    font-weight: 500;
    color: var(--color-light-gray-text);
    background: transparent;
    border: none;
    padding: 1rem 2rem;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.tab-button.active {
    font-weight: 700;
    color: var(--color-white);
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-primary-orange);
}

.tab-button:hover {
    color: var(--color-white);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-title {
    font-family: var(--font-primary-heading);
    font-size: 20px;
    font-weight: 600;
    color: var(--color-white);
    margin-bottom: 0.5rem;
}

.tab-subtitle {
    font-family: var(--font-primary-heading);
    font-size: 24px;
    font-weight: 600;
    color: var(--color-white);
    margin-bottom: 1.5rem;
}

.port-dropdown,
.search-input {
    width: 100%;
    max-width: 400px;
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    font-size: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-white);
    margin-bottom: 1.5rem;
}

.port-dropdown option {
    background: var(--color-primary-dark);
    color: var(--color-white);
}

.search-button {
    padding: 0.75rem 2rem;
    background: var(--color-primary-orange);
    color: var(--color-white);
    border: none;
    border-radius: 5px;
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-button:hover {
    background: #d97706;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(249, 115, 22, 0.3);
}

/* Scrollable table */
.schedule-table-wrapper {
    overflow-x: auto;
    margin-top: 1.5rem;
}

.schedule-table {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;
}

.schedule-table th,
.schedule-table td {
    padding: 1rem;
    text-align: left;
    color: var(--color-white);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.schedule-table th {
    background: rgba(0, 0, 0, 0.2);
    font-family: var(--font-primary-heading);
    font-weight: 600;
}

/* ===================================
   8. Content Sections
   =================================== */
.content-section {
    padding: 4rem 2rem;
}

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

.section-heading {
    font-family: var(--font-secondary-heading);
    font-size: 24px;
    font-weight: 600;
    color: var(--color-body-text);
    margin-bottom: 1.5rem;
}

.section-text {
    font-family: var(--font-secondary-heading);
    font-size: 16px;
    font-weight: 400;
    color: var(--color-body-text);
    line-height: 1.8;
}

/* Image-Text Alternating Layout */
.image-text-section {
    display: flex;
    gap: 3rem;
    align-items: center;
    margin-bottom: 3rem;
}

.image-text-section.reverse {
    flex-direction: row-reverse;
}

.image-text-section .image-col {
    flex: 1;
}

.image-text-section .text-col {
    flex: 1;
}

.image-text-section img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* ===================================
   9. Services Section
   =================================== */
.services-header {
    position: relative;
    min-height: 440px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--color-white);
    margin-bottom: 3rem;
}

.services-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(43, 51, 59, 0.5);
}

.services-header-content {
    position: relative;
    z-index: 10;
    max-width: 800px;
    padding: 2rem;
}

.services-title {
    font-family: var(--font-primary-heading);
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 1rem;
}

.services-subtitle {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.8;
}

.service-item-title {
    font-family: var(--font-primary-heading);
    font-size: 24px;
    font-weight: 700;
    color: var(--color-primary-orange);
    margin-bottom: 1rem;
}

/* ===================================
   10. Contact Form
   =================================== */
.contact-page {
    position: relative;
    min-height: 100vh;
    background-size: cover;
    background-position: center;
    padding: 6rem 2rem 4rem;
}

.contact-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(43, 51, 59, 0.5);
}

.contact-content {
    position: relative;
    z-index: 10;
    max-width: 1200px;
    margin: 0 auto;
    color: var(--color-white);
}

.contact-title {
    font-family: var(--font-primary-heading);
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 3rem;
    text-align: center;
}

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

.contact-info-section {
    margin-bottom: 2rem;
}

.contact-map-link {
    text-decoration: underline !important;
    text-underline-offset: 2px;
    font-weight: 600;
    margin-left: 0.5rem;
}

.contact-map-link:visited,
.contact-map-link:hover,
.contact-map-link:focus {
    text-decoration: underline !important;
}

.contact-map-embed {
    max-width: 100%;
    overflow: hidden;
    border-radius: 8px;
}

.contact-map-embed iframe {
    display: block;
    width: 100%;
    max-width: 100%;
    border: 0;
}

.contact-section-heading {
    font-family: var(--font-primary-heading);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.contact-form-group {
    margin-bottom: 1.5rem;
}

.contact-form-group label {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 400;
    display: block;
    margin-bottom: 0.5rem;
}

.contact-form-group input,
.contact-form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    font-size: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-white);
}

.contact-form-group input::placeholder,
.contact-form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.contact-form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.submit-button {
    width: 100%;
    padding: 1rem 2rem;
    background: var(--color-primary-orange);
    color: var(--color-white);
    border: none;
    border-radius: 5px;
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-button:hover {
    background: #d97706;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.4);
}

/* ===================================
   11. Resources Section
   =================================== */
.resources-header {
    position: relative;
    min-height: 423px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--color-white);
    margin-bottom: 3rem;
}

.resources-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(43, 51, 59, 0.5);
}

.resources-header-content {
    position: relative;
    z-index: 10;
}

.resources-title {
    font-family: var(--font-primary-heading);
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 1rem;
}

.resources-subtitle {
    font-family: var(--font-body);
    font-size: 24px;
    font-weight: 400;
}

.resources-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.resource-item {
    background: var(--color-repeating-group-bg);
    padding: 1.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

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

.resource-item-title {
    font-family: var(--font-primary-heading);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.resource-item-description {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--color-dark-text);
    margin-bottom: 1rem;
}

.download-button {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: var(--color-primary-orange);
    color: var(--color-white);
    border-radius: 5px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.download-button:hover {
    background: #d97706;
}

/* ===================================
   12. Footer
   =================================== */
.footer {
    background: var(--color-footer-bg);
    color: var(--color-white);
    padding: 1.9rem 0.4rem 0.75rem;
}

.footer-content {
    max-width: none;
    width: 100%;
    margin: 0 auto;
    padding: 0 clamp(0.25rem, 1.4vw, 1.6rem);
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(320px, 1fr) minmax(320px, 1fr);
    grid-template-areas: "logo location contact";
    gap: clamp(1rem, 3vw, 5rem);
    margin-bottom: 1rem;
    align-items: start;
}

.footer-column h4 {
    font-family: var(--font-primary-heading);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 0.65rem;
}

.footer-logo img {
    max-width: 116px;
    height: auto;
    margin-bottom: 0.65rem;
}

.footer-company-name {
    font-family: var(--font-primary-heading);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 0;
}

.footer-text {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.8;
}

.footer .footer-text {
    line-height: 1.22;
}

.footer .footer-text p {
    margin: 0;
}

.footer .footer-text-snug p {
    margin: 0;
    line-height: 1.35;
}

.footer-column-logo {
    grid-area: logo;
    justify-self: start;
}

.footer-column-location {
    grid-area: location;
    justify-self: center;
}

.footer-column-contact {
    grid-area: contact;
    justify-self: start;
}

.footer-column-contact h4 {
    text-align: left;
}

.footer-column-contact .footer-text {
    text-align: left;
}

.footer-column-contact .footer-text a {
    color: var(--color-white);
}

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

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

.footer-links a {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--color-white);
    transition: color 0.3s ease;
}

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

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 0.75rem;
    text-align: center;
}

.footer-copyright {
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 400;
    color: var(--color-muted-text);
}

/* ===================================
   13. Utility Classes
   =================================== */
.text-center {
    text-align: center;
}

.text-orange {
    color: var(--color-primary-orange);
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

/* ===================================
   14. Responsive Design
   =================================== */
@media (max-width: 1024px) {
    .navbar-menu {
        gap: 1rem;
    }
    
    .footer-content {
        grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) minmax(220px, 1fr);
        grid-template-areas: "logo location contact";
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    /* Navigation */
    .navbar .container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 1rem;
    }
    
    .navbar-toggle {
        display: flex;
    }
    
    .navbar-menu {
        position: fixed;
        top: 80px;
        left: -100%;
        flex-direction: column;
        background: var(--color-primary-dark);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        padding: 2rem 0;
    }
    
    .navbar-menu.active {
        left: 0;
    }
    
    /* Typography */
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    
    /* Hero */
    .hero-section {
        min-height: 400px;
    }
    
    .hero-company-name {
        font-size: 20px;
    }
    
    /* Tabs */
    .tabs-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    /* Image-Text Sections */
    .image-text-section,
    .image-text-section.reverse {
        flex-direction: column;
    }
    
    /* Contact Grid */
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-template-areas: "logo location contact";
        gap: 0.75rem;
    }

    .footer-logo img {
        max-width: 104px;
    }

    .footer-company-name,
    .footer-text {
        font-size: 12px;
    }

    .footer-column-contact {
        justify-self: start;
        max-width: none;
    }

    .footer-column-contact h4 {
        text-align: left;
    }

    .footer-column-contact .footer-text {
        text-align: left;
    }
    
    /* Services */
    .services-title {
        font-size: 28px;
    }
    
    .services-subtitle {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .hero-logo img {
        max-width: 120px;
    }
    
    .resources-list {
        grid-template-columns: 1fr;
    }

    .footer-column h4 {
        font-size: 14px;
    }

    .footer-company-name,
    .footer-text {
        font-size: 11px;
    }
}

/* ===================================
   15. Animations
   =================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* ===================================
   16. Print Styles
   =================================== */
@media print {
    .navbar,
    .footer,
    .tabs-section {
        display: none;
    }
}

/* ===================================
   Tab Content Visibility Fix
   =================================== */
.tab-content > .tab-pane {
    display: none;
}

.tab-content > .tab-pane.active {
    display: block;
}

.tab-content > .tab-pane.show {
    opacity: 1;
}
