﻿/* =============================================================================
   THEME VARIABLES
   ============================================================================= */
:root {
    /* Brand */
    --brand-red: #dc3545;
    --brand-red-dark: #b52a36;
    --brand-bg: #ffffff;
    --brand-Hero: #ffffff;
    --brand-Hero-bg: #000000;
    --brand-text: #000000;
    --accent: #f4c048;
    /* Org Chart (Unified) */
    --org-stroke: #D8292E; /* สีเส้นเชื่อมหลัก = แดงแบรนด์ */
    --org-width: 2.5;
    --org-ink: #0E1116;
    --org-muted: #667085;
    --org-bg: #ffffff;
    --org-bg-soft: #fafafa;
    --org-card-bg: #ffffff;
    --org-card-border: rgba(14,17,22,.08);
    --org-card-shadow: 0 10px 26px rgba(0,0,0,.07);
    --org-card-shadow-hover: 0 18px 36px rgba(0,0,0,.12);
    --org-radius: 18px;
    --ring: radial-gradient(120px 120px at 50% 10%, rgba(216,41,46,.18), transparent 60%);
    /* สำหรับ node ปลายเส้น */
    --org-line: #9bb7cf;
    --org-node: #ffffff;
    --org-node-stroke: #5a7a92;
}

/* =============================================================================
   GLOBAL
   ============================================================================= */
html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

body {
    background: var(--brand-bg);
    color: var(--brand-text);
}

a {
    color: var(--brand-red);
    text-decoration: none;
}

    a:hover {
        color: var(--brand-red-dark);
        text-decoration: underline;
    }

.footer-bottom {
    border-top: 1px solid #990000;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 .1rem #fff, 0 0 0 .25rem #258cfb;
}

/* Placeholder ใน form-floating */
.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

@media (max-width:1366px) {
    .job-item .btn {
        width: 100%;
    }
}

/* =============================================================================
   NAVBAR
   ============================================================================= */
.navbar {
    background: var(--brand-bg);
    border-bottom: 2px solid var(--brand-red);
    margin-bottom: 0 !important;
}

.navbar-brand {
    font-family: 'Kanit',sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: var(--brand-text) !important;
    text-transform: uppercase;
    margin-left: 100px;
}

.navbar-nav {
    gap: 12px;
}

    .navbar-nav .nav-link {
        font-family: 'Kanit',sans-serif;
        font-size: 14px;
        font-weight: 600;
        color: var(--brand-Hero) !important;
        transition: transform .2s ease-in-out;
    }

        .navbar-nav .nav-link:hover {
            transform: scale(1.1);
            color: #fff;
        }

        .navbar-nav .nav-link.active {
            color: var(--brand-red) !important;
        }

/* =============================================================================
   BUTTONS / COMMON
   ============================================================================= */
.btn-theme {
    background: var(--brand-red);
    color: #fff;
    border: none;
    border-radius: .6rem;
}

    .btn-theme:hover {
        background: var(--brand-red-dark);
        color: #fff;
    }

/* =============================================================================
   HERO / COMMON SECTIONS
   ============================================================================= */
.hero {
    background: radial-gradient(1200px 500px at 20% 10%, #fdebed 0%, #ffffff 40%), linear-gradient(135deg,#ffffff 0%,#fff6f7 100%);
    border-radius: 18px;
    border: 2px solid var(--brand-red);
}

    .hero .bg-overlay {
        position: absolute;
        inset: 0;
        background: rgba(0,0,0,.4);
        border-radius: 1rem;
    }

/* Effects */
@keyframes floatY {
    0%,100% {
        transform: translateY(0)
    }

    50% {
        transform: translateY(-8px)
    }
}

.float-y {
    animation: floatY 6s ease-in-out infinite;
}

.kenburns {
    overflow: hidden;
}

    .kenburns img, img.kenburns {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
        animation: ken 18s ease-in-out infinite;
        transform-origin: center;
    }

@keyframes ken {
    0% {
        transform: scale(1) translate(0,0)
    }

    50% {
        transform: scale(1.08) translate(1%,-1%)
    }

    100% {
        transform: scale(1) translate(0,0)
    }
}

.hover-zoom {
    transition: transform .35s ease, box-shadow .35s ease;
}

    .hover-zoom:hover {
        transform: scale(1.03);
    }

.hover-tilt {
    transition: transform .25s ease;
}

    .hover-tilt:hover {
        transform: rotate(-1.5deg) translateY(-4px);
    }

.hover-lift {
    transition: transform .25s ease, box-shadow .25s ease;
}

    .hover-lift:hover {
        transform: translateY(-6px);
        box-shadow: 0 10px 24px rgba(0,0,0,.12);
    }

@media (prefers-reduced-motion:reduce) {
    .float-y, .kenburns img, img.kenburns {
        animation: none !important;
    }

    .hover-zoom, .hover-tilt, .hover-lift {
        transition: none !important;
    }
}

/* =============================================================================
   CAREERS (Chatta/Index)
   ============================================================================= */
.hero-badge {
    background: #fde1e4;
    border: 1px solid #f6ccd1;
    border-radius: 999px;
    padding: .35rem .8rem;
    font-size: .85rem;
    color: var(--brand-text);
}

.value-card {
    border: 0;
    border-radius: 16px;
    background: #fdebed;
    box-shadow: 0 10px 24px rgba(220,53,69,.08);
    color: var(--brand-text);
}

.value-icon {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    display: inline-grid;
    place-items: center;
    background: #fff;
    border: 1px solid #f6ccd1;
    color: var(--brand-red);
    font-size: 1.25rem;
}

.trust {
    border: 1px dashed #f1b6bc;
    border-radius: 14px;
    padding: .85rem 1rem;
    background: #fff;
    color: var(--brand-text);
}

.job-item {
    background: #fff;
    border: 1px solid #f1b6bc;
    border-radius: 8px;
    padding: 18px 22px;
    box-shadow: 0 2px 4px rgba(220,53,69,.08);
    color: var(--brand-text);
}

    .job-item .job-title {
        color: var(--brand-red);
        text-transform: uppercase;
    }

        .job-item .job-title:hover {
            text-decoration: underline;
        }

.job-meta span {
    color: var(--brand-text);
}

.job-item .btn {
    background: var(--brand-red);
    color: #fff;
    font-weight: 600;
    border-radius: 6px;
}

.arrow-red {
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 20px solid #D8292E;
}
/* ==== STATS: Spin-once when section .stats-minimal ได้คลาส .spin ==== */
.stats-minimal .circle > i {
    display: inline-block;
    transform-origin: 50% 50%;
    will-change: transform;
}

@keyframes spinOnce {
    from {
        transform: rotate(0)
    }

    to {
        transform: rotate(360deg)
    }
}
/* ===== STATS: หมุนเมื่อ section ถูกมองเห็น ===== */
.stats-minimal .circle > i {
    display: inline-block;
    transform-origin: 50% 50%;
    will-change: transform;
}

@keyframes spinOnce {
    to {
        transform: rotate(1turn)
    }
}

/* ให้ i.bi แปลงทรานส์ฟอร์มได้ลื่น */
.stats-minimal i.bi {
    display: inline-block;
    will-change: transform;
    transform-origin: center;
}

/* หมุนครั้งเดียว */
@keyframes spinOnce {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.spin-once {
    animation: spinOnce .9s ease-out 1 both; /* 1 รอบ, ค้างที่เฟรมสุดท้าย */
}

/* เคารพผู้ใช้ที่ปิดแอนิเมชัน */
@media (prefers-reduced-motion: reduce) {
    .spin-once {
        animation: none;
    }
}
/* =============================================================================
   SERVICES (Chatta/Service)
   ============================================================================= */
.service-card {
    border: 0;
    border-radius: 1rem;
    box-shadow: 0 8px 18px rgba(0,0,0,.08);
    overflow: hidden;
    background: #fff;
    color: var(--brand-text);
}

    .service-card .card-img-top {
        width: 100%;
        height: 200px;
        object-fit: cover;
        display: block;
        transition: transform .4s ease, box-shadow .4s ease;
    }

        .service-card .card-img-top:hover {
            transform: scale(1.05);
            box-shadow: 0 8px 20px rgba(0,0,0,.15);
        }

    .service-card .card-body {
        background: var(--brand-bg);
        color: var(--brand-text);
    }

    .service-card .service-title {
        border-bottom: none !important;
        text-decoration: none !important;
        font-family: 'Kanit', sans-serif;
        font-weight: 100;
    }

.service-section {
    background: url('/images/Services/wallpaper.png') no-repeat center center fixed;
    background-size: cover;
    position: relative;
    padding: 60px 0;
}

    .service-section::before {
        content: "";
        position: absolute;
        inset: 0;
        background: rgba(255,255,255,.6);
        z-index: 1;
    }

    .service-section .container {
        position: relative;
        z-index: 2;
    }

/* =============================================================================
   CONTACT (Chatta/Contact)
   ============================================================================= */
.contact-card {
    background: var(--brand-red);
    color: var(--brand-text);
    border-radius: 14px;
    box-shadow: 0 8px 16px rgba(220,53,69,.3);
}

    .contact-card .icon {
        background: rgba(255,255,255,.7);
        color: var(--brand-text);
    }

.panel {
    background: var(--brand-red);
    color: var(--brand-text);
    border-radius: 14px;
}

    .panel .btn-submit {
        background: #fff;
        color: var(--brand-red);
    }

/* =============================================================================
   ABOUT (Chatta/About)
   ============================================================================= */
.history-list {
    list-style: none;
    padding-left: 0;
}

    .history-list li {
        position: relative;
        margin-bottom: 1rem;
        padding-left: 1.2rem;
    }

        .history-list li::before {
            content: "-";
            position: absolute;
            left: 0;
            color: #333;
            font-weight: normal;
        }

    .history-list h5 {
        font-family: 'Kanit', sans-serif;
        font-weight: 100;
    }

.about-page-full {
    position: relative;
    min-height: 100vh;
    background: url('@Url.Content("~/images/About/bg.png")') no-repeat center center fixed;
    background-size: cover;
}

    .about-page-full::before {
        content: "";
        position: absolute;
        inset: 0;
        background: rgba(255,255,255,.6);
        z-index: 0;
    }

    .about-page-full > .container-fluid {
        position: relative;
        z-index: 1;
    }

.about-divider {
    width: 72px;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg,#d8292e,#ff7a7e);
}

.about-card {
    border-radius: 16px;
}

.timeline {
    position: relative;
    padding-left: 1.5rem;
}

    .timeline::before {
        content: "";
        position: absolute;
        left: 10px;
        top: 0;
        bottom: 0;
        width: 2px;
        background: rgba(0,0,0,.08);
    }

.timeline-item {
    position: relative;
    padding-left: 1rem;
}

.timeline-dot {
    position: absolute;
    left: -2px;
    top: .45rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #d8292e;
    box-shadow: 0 0 0 4px rgba(216,41,46,.15);
}

.timeline-content p.lead {
    line-height: 1.7;
}

@media (max-width:991.98px) {
    .timeline::before {
        left: 6px;
    }

    .timeline-dot {
        left: -6px;
    }
}

/* =============================================================================
   BOARD CARD (คณะกรรมการ)
   ============================================================================= */
.board-card {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 8px 16px rgba(0,0,0,.06);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
    max-width: 200px;
    margin: 0 auto;
}

    .board-card:hover, .board-card:focus-within {
        transform: translateY(-8px);
        box-shadow: 0 16px 32px rgba(0,0,0,.12);
        border-color: #c7d2fe;
    }

    .board-card .card-img-top {
        height: 250px;
        object-fit: cover;
        transition: filter .25s ease;
    }

    .board-card:hover .card-img-top {
        filter: brightness(1.03);
    }

@media (max-width:768px) {
    .board-card {
        max-width: 260px;
    }

        .board-card .card-img-top {
            height: 320px;
        }
}

/* =============================================================================
   ORG CHART (Premium Minimal + Mobile Fix merged)
   ============================================================================= */

/* พื้นหลัง Section */
.board-section {
    background: linear-gradient(180deg,#fff,var(--org-bg-soft));
}

    .board-section h2 {
        letter-spacing: .3px;
    }

/* พื้นที่ Org Chart */
.org-area {
    position: relative;
    padding: 16px 10px 28px;
    border-radius: 24px;
    background: radial-gradient(60% 100% at 50% 0%, #ffffff, var(--org-bg-soft) 70%), linear-gradient(transparent,transparent 31px,#0000000c 32px), linear-gradient(90deg,transparent,transparent 31px,#0000000c 32px);
    background-size: auto, 32px 32px, 32px 32px;
    box-shadow: 0 12px 28px rgba(0,0,0,.06);
    overflow: hidden;
}

/* SVG lines */
.org-svg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.org-line {
    stroke: var(--org-stroke);
    stroke-width: var(--org-width);
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    filter: drop-shadow(0 1px 0 rgba(216,41,46,.12));
    stroke-dasharray: 320;
    stroke-dashoffset: 320;
    animation: orgDraw .9s ease forwards;
}

@keyframes orgDraw {
    to {
        stroke-dashoffset: 0;
    }
}

/* จุดเชื่อม */
.org-node {
    fill: #fff;
    stroke: var(--org-stroke);
    stroke-width: 2.5;
    filter: drop-shadow(0 1px 0 rgba(216,41,46,.12));
    transform-origin: center;
    animation: orgPop .35s ease both;
}

@keyframes orgPop {
    from {
        transform: scale(.6);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ตาราง 5 คอลัมน์ */
table.org-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 10px;
    text-align: center;
}

    table.org-table td {
        vertical-align: top;
    }

/* การ์ดบุคลากร */
.org-card {
    position: relative;
    z-index: 2;
    /* layout จาก block mobile-fix เดิม + เติม min ความสวย */
    width: clamp(200px, 22vw, 220px);
    padding: 14px 14px 12px;
    margin: 12px auto;
    background: var(--org-card-bg);
    border: 1px solid var(--org-card-border);
    border-radius: var(--org-radius);
    text-align: center;
    box-shadow: var(--org-card-shadow);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease, background .25s ease;
    isolation: isolate;
    background-image: var(--ring);
    background-repeat: no-repeat;
    background-position: 50% -20%;
}

    .org-card::before {
        content: "";
        position: absolute;
        inset: 0 0 auto 0;
        height: 3px;
        background: var(--org-stroke);
        opacity: .12;
        border-top-left-radius: var(--org-radius);
        border-top-right-radius: var(--org-radius);
    }

    .org-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--org-card-shadow-hover);
        border-color: rgba(216,41,46,.25);
    }

    .org-card p {
        margin: 0 0 2px;
        font-weight: 600;
        color: var(--org-ink);
    }

    .org-card small {
        color: var(--org-muted);
    }

/* รูปโปรไฟล์ (วงกลม) */
.org-img {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 8px 18px rgba(0,0,0,.10);
    margin-bottom: 8px;
    background: #f1f3f5;
    image-rendering: -webkit-optimize-contrast;
}

/* Accent ต่อบทบาท */
#md .org-img {
    box-shadow: 0 8px 20px rgba(216,41,46,.18);
}
/* MD แดง */
#gm .org-img {
    box-shadow: 0 8px 20px rgba(0,111,235,.18);
}
/* GM น้ำเงิน */
#salesm .org-img {
    box-shadow: 0 8px 20px rgba(2,157,116,.18);
}
/* Sales Mgr เขียว */
#marketing .org-img {
    box-shadow: 0 8px 20px rgba(242,153,74,.18);
}
/* MKT ส้ม */

/* เล็กลงบนจอแคบ */
@media (max-width: 992px) {
    table.org-table {
        border-spacing: 8px;
    }
}

@media (max-width: 576px) {
    .org-card {
        padding: 12px;
    }

    .org-img {
        width: 84px;
        height: 84px;
    }

    table.org-table {
        border-spacing: 6px;
    }
}

/* A11y & Motion */
@media (prefers-reduced-motion: reduce) {
    .org-line {
        animation: none;
        stroke-dasharray: none;
        stroke-dashoffset: 0;
    }

    .org-node {
        animation: none;
    }

    .org-card {
        transition: none;
    }
}

/* Print */
@media print {
    .board-section, .org-area {
        box-shadow: none;
        background: #fff;
    }

    .org-card {
        box-shadow: none;
    }
}

/* --- มือถือ: สแต็ก 1 คอลัมน์ + ซ่อนเส้น (มาจากบล็อก <style> ที่ให้ไว้) --- */
@media (max-width: 768px) {
    .org-table colgroup {
        display: none;
    }
    /* ปลดล็อก 20% ของ <col> */
    .org-table {
        display: block;
    }

        .org-table tr {
            display: block;
        }

        .org-table td {
            display: block;
            width: 100%;
            padding: 4px 0;
        }

    .org-card {
        width: min(320px, 90vw);
    }

    .org-svg {
        display: none;
    }
    /* ซ่อนเส้นเมื่อสแต็กเพื่อกันเพี้ยน */
}

/* =============================================================================
   STATS (Minimal)
   ============================================================================= */
.stats-circle .circle-card {
    position: relative;
    width: 150px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stats-circle .circle-border {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #D8292E 0%, transparent 20%, transparent 80%, #D8292E 100%);
    animation: spinBorder 2s linear infinite;
}

@keyframes spinBorder {
    to {
        transform: rotate(360deg);
    }
}

.stats-minimal .metric {
    display: grid;
    gap: .6rem;
    place-items: center;
}

.stats-minimal .circle {
    width: 80px;
    height: 80px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #ffffff;
}

    .stats-minimal .circle i {
        font-size: 32px;
        color: #d8292e;
    }

.stats-minimal .metric-number {
    font-weight: 600;
    font-size: 1.2rem;
    color: #000;
}

/* =============================================================================
   LOGO STRIP (Partners)
   ============================================================================= */
.logo-strip {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 14px 0;
    -webkit-mask-image: linear-gradient(to right,transparent,black 10%,black 90%,transparent);
    mask-image: linear-gradient(to right,transparent,black 10%,black 90%,transparent);
}

.logo-track {
    display: flex;
    align-items: center;
    gap: 48px;
    width: max-content;
    animation: scroll-logos 25s linear infinite;
}

.logo-strip:hover .logo-track {
    animation-play-state: paused;
}

.logo-track img {
    height: 44px;
    width: auto;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: .85;
    transition: filter .2s, opacity .2s, transform .2s;
}

    .logo-track img:hover {
        filter: grayscale(0%);
        opacity: 1;
        transform: translateY(-2px);
    }

@keyframes scroll-logos {
    from {
        transform: translateX(-50%)
    }

    to {
        transform: translateX(0)
    }
}

/* =============================================================================
   FOOTER
   ============================================================================= */
.site-footer {
    background: var(--brand-red);
    color: var(--brand-text);
}

    .site-footer .footer-bottom {
        background: var(--brand-red-dark);
        color: var(--brand-text);
    }

.footer-box {
    border: 1px solid #D8292E;
    border-radius: 8px;
    padding: 15px;
    background-color: #D8292E;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    display: inline-block;
    line-height: 1.6;
}

.footer-heading {
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--brand-text);
}

.site-footer .social {
    background: rgba(255,255,255,.7);
    color: var(--brand-text);
}

    .site-footer .social:hover {
        background: rgba(255,255,255,.9);
    }

.footer-services .row {
    display: flex;
    justify-content: space-between;
}

.footer-services .col-6 {
    flex: 0 0 48%;
    padding: 0 10px;
}

/* =============================================================================
   MISC
   ============================================================================= */
hr {
    opacity: .12;
}

.round-subtle {
    width: 24px;
    height: 24px;
    background: radial-gradient(circle at 30% 30%, #ff4d4d, #d8292e 70%);
    clip-path: path("M12 0 C18 0, 24 6, 12 24 C0 6, 6 0, 12 0 Z");
}

.card-elev {
    box-shadow: 0 4px 18px rgba(220,53,69,.15);
}

.badge-subtle {
    background: #f1b6bc;
    color: var(--brand-text);
    border: 1px solid var(--brand-red-dark);
}

.list-subtle .list-group-item {
    border-color: #f3c0c5 !important;
}

/* =============================================================================
   RESPONSIVE (extra)
   ============================================================================= */
@media (max-width:1366px) {
    /* เพิ่มเติมได้ตามต้องการ */
}
