/* ==========================================================================
   ระบบสั่งจองพระ - Theme Stylesheet
   theme/css/style.css

   โทนสี : น้ำเงินราชนาวี + ทอง (ให้สอดคล้องกับโบรชัวร์ชุดท้าวหิรัญพนาสูร)
   ========================================================================== */

:root {
    --font-thai:    'Noto Sans Thai', 'Leelawadee UI', Tahoma, sans-serif;

    /* ----- น้ำเงิน (สีหลักของแบรนด์) ----- */
    --brand:        #0b3c91;
    --brand-dark:   #06255e;
    --brand-deep:   #03153c;
    --brand-light:  #1f6fe0;
    --brand-glow:   #2f86ff;

    /* ----- ทอง (สีรอง / ตัวเน้น) ----- */
    --gold:         #d4a12a;
    --gold-light:   #f6d574;
    --gold-dark:    #9d7215;

    /* ----- แดง (ราคาเหรียญ) ----- */
    --price:        #d32f2f;
    --price-dark:   #a31515;

    /* ----- พื้นหลังและตัวอักษร ----- */
    --paper:        #eef3fc;
    --ink:          #16233d;
    --muted:        #6b7690;
    --line:         #d7e2f3;

    --radius:       .65rem;
    --shadow-sm:    0 2px 8px rgba(6, 37, 94, .08);
    --shadow-md:    0 8px 24px rgba(6, 37, 94, .16);
}

/* --------------------------------------------------------------------------
   พื้นฐาน
   -------------------------------------------------------------------------- */
html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-thai);
    font-size: 1rem;
    color: var(--ink);
    background-color: #fff;
}

body.layout-main {
    background-color: var(--paper);
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-thai);
    font-weight: 600;
}

/* บังคับใช้ฟอนต์ Noto Sans Thai ทับค่าเดิมของ Bootstrap / AdminLTE / ปลั๊กอินต่าง ๆ */
button, input, select, textarea, optgroup,
.btn, .form-control, .custom-select, .custom-file-label, .input-group-text,
.navbar, .nav, .breadcrumb, .table, .card, .modal, .dropdown-menu,
.tooltip, .popover, .alert, .badge, .close,
.swal2-popup, .swal2-title, .swal2-content, .swal2-styled,
.select2-container, .select2-results__option, .select2-selection__rendered,
.toast-title, .toast-message,
.dataTables_wrapper, .dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter, .dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    font-family: var(--font-thai);
}

a {
    color: var(--brand);
}

a:hover {
    color: var(--gold-dark);
}

.text-gold        { color: var(--gold) !important; }
.text-brand       { color: var(--brand) !important; }
.bg-brand         { background-color: var(--brand) !important; }
.bg-paper         { background-color: var(--paper) !important; }
.text-muted-light { color: rgba(255, 255, 255, .68) !important; }

/* --------------------------------------------------------------------------
   ปุ่ม
   -------------------------------------------------------------------------- */
.btn-gold {
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    border: none;
    color: #3d2c05;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(212, 161, 42, .35);
}

.btn-gold:hover,
.btn-gold:focus {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #fff;
}

.btn-brand {
    background-color: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.btn-brand:hover,
.btn-brand:focus {
    background-color: var(--brand-dark);
    border-color: var(--brand-dark);
    color: #fff;
}

.btn-outline-gold {
    color: var(--gold-dark);
    border-color: var(--gold);
    background-color: transparent;
}

.btn-outline-gold:hover {
    background-color: var(--gold);
    color: #3d2c05;
}

/* --------------------------------------------------------------------------
   แถบเมนูหน้าเว็บหลัก
   -------------------------------------------------------------------------- */
.navbar-main {
    background:
        radial-gradient(circle at 15% 50%, rgba(47, 134, 255, .35), transparent 55%),
        linear-gradient(100deg, var(--brand-deep), var(--brand));
    padding: .5rem 0;
    box-shadow: var(--shadow-sm);
    border-bottom: 3px solid var(--gold);
}

.navbar-main .navbar-brand {
    display: flex;
    align-items: center;
    color: #fff;
}

/* ตราลูกเสือไทย (พื้นหลังโปร่งใส จึงวางบนพื้นน้ำเงินได้เลย) */
.navbar-main .brand-mark {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: .7rem;
    flex: 0 0 auto;
}

.navbar-main .brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 6px rgba(246, 213, 116, .45));
}

.navbar-main .brand-text strong {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--gold-light);
}

.navbar-main .brand-text small {
    display: block;
    font-size: .74rem;
    font-weight: 400;
    line-height: 1.3;
    color: rgba(255, 255, 255, .75);
}

.navbar-main .nav-link {
    color: rgba(255, 255, 255, .88);
    font-weight: 500;
    padding: .5rem .9rem;
    border-radius: var(--radius);
}

.navbar-main .nav-link:hover,
.navbar-main .nav-link.active {
    color: var(--gold-light);
    background-color: rgba(255, 255, 255, .12);
}

.navbar-main .navbar-toggler {
    color: #fff;
    border-color: rgba(255, 255, 255, .4);
}

/* --------------------------------------------------------------------------
   ส่วนหัวหน้าแรก
   -------------------------------------------------------------------------- */
.hero {
    position: relative;
    padding: 4rem 0 3.5rem;
    background:
        radial-gradient(circle at 50% 12%, rgba(47, 134, 255, .45), transparent 55%),
        radial-gradient(circle at 12% 85%, rgba(212, 161, 42, .22), transparent 45%),
        linear-gradient(160deg, var(--brand) 0%, var(--brand-dark) 55%, var(--brand-deep) 100%);
    color: #fff;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    right: -80px;
    bottom: -120px;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    border: 2px dashed rgba(246, 213, 116, .35);
}

.hero h1 {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--gold-light);
    text-shadow: 0 2px 14px rgba(0, 0, 0, .35);
}

.hero .lead {
    color: rgba(255, 255, 255, .88);
}

.hero-badge {
    display: inline-block;
    padding: .3rem .9rem;
    border-radius: 999px;
    background-color: rgba(246, 213, 116, .16);
    border: 1px solid rgba(246, 213, 116, .55);
    color: var(--gold-light);
    font-size: .85rem;
    margin-bottom: 1rem;
}

.hero-stat {
    background: rgba(255, 255, 255, .09);
    border: 1px solid rgba(246, 213, 116, .28);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    height: 100%;
}

.hero-stat .value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--gold-light);
    line-height: 1.2;
}

.hero-stat .label {
    font-size: .82rem;
    color: rgba(255, 255, 255, .78);
}

/* --------------------------------------------------------------------------
   หัวข้อของแต่ละส่วน
   -------------------------------------------------------------------------- */
.section {
    padding: 3rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 2rem;
}

.section-title h2 {
    font-size: 1.6rem;
    color: var(--brand);
    margin-bottom: .35rem;
}

.section-title p {
    color: var(--muted);
    margin-bottom: 0;
}

.section-title::after {
    content: '';
    display: block;
    width: 70px;
    height: 3px;
    margin: .9rem auto 0;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* --------------------------------------------------------------------------
   การ์ดเหรียญ
   -------------------------------------------------------------------------- */
.coin-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.coin-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--gold);
}

.coin-thumb {
    position: relative;
    padding-top: 75%;
    background: linear-gradient(160deg, #eaf1fc, #dbe6f7);
    overflow: hidden;
}

.coin-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: .75rem;
}

.coin-thumb .coin-flag {
    position: absolute;
    top: .6rem;
    left: .6rem;
    z-index: 2;
}

.coin-card-body {
    padding: 1rem;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.coin-card-body .coin-code {
    font-size: .72rem;
    line-height: 1.6;
    color: var(--muted);
    letter-spacing: .04em;
    margin-bottom: .15rem;
}

/* ----- ชื่อชุด / วาระการจัดสร้าง : ตัวเล็ก จาง (ซ้ำกันทุกเหรียญ) -----
   ภาษาไทยมีสระบน-ล่างและวรรณยุกต์ จึงต้องเผื่อ line-height ให้มากกว่าปกติ
   เพื่อไม่ให้ตัวอักษรของสองบรรทัดชนกัน                                  */
.coin-series {
    font-size: .74rem;
    font-weight: 400;
    line-height: 1.55;
    color: var(--muted);
    letter-spacing: .01em;
    margin-bottom: .3rem;
}

/* ----- ชื่อเนื้อเหรียญ : ตัวใหญ่ เด่น (ข้อมูลที่ต่างกันของแต่ละเหรียญ) ----- */
.coin-name {
    font-weight: 700;
    color: var(--brand);
    line-height: 1.5;
}

.coin-name-sm { font-size: 1rem;   line-height: 1.5; }
.coin-name-md { font-size: 1.3rem; line-height: 1.45; }
.coin-name-lg { font-size: 2rem;   line-height: 1.4; }

.coin-card-body .coin-series {
    margin-bottom: .3rem;
    /* ตัดเหลือ 2 บรรทัด กันชื่อชุดยาวดันการ์ดเสียรูป */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.coin-card-body .coin-name {
    margin: 0 0 .7rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* 1.3rem x line-height 1.5 x 2 บรรทัด = 3.9rem เผื่อสระบน-ล่างอีกเล็กน้อย */
    min-height: 4.05rem;
}

/* หน้ารายละเอียดเหรียญ : ชื่อชุดใหญ่ขึ้นเล็กน้อยให้สมดุลกับชื่อเนื้อเหรียญ */
.coin-detail-title .coin-series {
    font-size: .9rem;
    margin-bottom: .35rem;
}

/* ในตารางและรายการแบบแถว ให้ชื่อชุดเล็กลงอีกเล็กน้อย */
.table .coin-series,
.order-item .coin-series {
    font-size: .7rem;
    margin-bottom: .15rem;
}

.table .coin-name,
.order-item .coin-name {
    font-size: 1.05rem;
    line-height: 1.5;
    margin-bottom: .15rem;
}

/* ราคาเหรียญ - ใช้สีแดงให้สะดุดตา (การ์ดหน้าหลัก / หน้ารายละเอียด) */
.coin-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--price);
}

.coin-meta {
    font-size: .82rem;
    color: var(--muted);
}

.coin-progress {
    height: 6px;
    border-radius: 999px;
    background-color: #dbe5f5;
    overflow: hidden;
    margin: .55rem 0 .35rem;
}

.coin-progress > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--gold-light), var(--gold-dark));
}

/* --------------------------------------------------------------------------
   หน้ารายละเอียดเหรียญ
   -------------------------------------------------------------------------- */
.coin-gallery-main {
    background: linear-gradient(160deg, #f4f8ff, #e6eefb);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
}

.coin-gallery-main img {
    max-width: 100%;
    max-height: 460px;
    object-fit: contain;
}

.coin-gallery-thumbs {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    margin-top: .75rem;
}

.coin-gallery-thumbs button {
    width: 74px;
    height: 74px;
    padding: .2rem;
    background: #fff;
    border: 2px solid var(--line);
    border-radius: .4rem;
    cursor: pointer;
}

.coin-gallery-thumbs button.active,
.coin-gallery-thumbs button:hover {
    border-color: var(--gold);
}

.coin-gallery-thumbs img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* --------------------------------------------------------------------------
   กล่องเนื้อหาทั่วไป
   -------------------------------------------------------------------------- */
.panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.panel-head {
    padding: .9rem 1.15rem;
    border-bottom: 2px solid var(--gold);
    background: linear-gradient(100deg, var(--brand-dark), var(--brand));
    border-radius: var(--radius) var(--radius) 0 0;
}

.panel-head h5 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--gold-light);
}

.panel-body {
    padding: 1.15rem;
}

.step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-light), var(--gold-dark));
    color: #2a1d02;
    font-weight: 700;
    font-size: .9rem;
    margin-right: .5rem;
}

/* --------------------------------------------------------------------------
   ฟอร์ม
   -------------------------------------------------------------------------- */
.form-control:focus,
.custom-select:focus {
    border-color: var(--brand-light);
    box-shadow: 0 0 0 .2rem rgba(31, 111, 224, .18);
}

label.required::after {
    content: ' *';
    color: #dc3545;
}

.select2-container--bootstrap4 .select2-selection {
    border-color: #ced4da;
}

/* ตารางรายการที่เลือกจอง */
.order-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem 0;
    border-bottom: 1px dashed var(--line);
}

.order-item:last-child {
    border-bottom: none;
}

.order-item img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    background: linear-gradient(160deg, #eaf1fc, #dbe6f7);
    border-radius: .35rem;
    flex: 0 0 auto;
}

.order-summary {
    background: linear-gradient(135deg, rgba(11, 60, 145, .08), rgba(212, 161, 42, .14));
    border: 1px solid rgba(212, 161, 42, .35);
    border-radius: var(--radius);
    padding: 1rem;
}

/* --------------------------------------------------------------------------
   หลักฐานการโอนเงิน
   -------------------------------------------------------------------------- */
.slip-summary {
    background: linear-gradient(135deg, rgba(11, 60, 145, .06), rgba(212, 161, 42, .1));
    border-radius: var(--radius);
    padding: .75rem 0;
    margin-left: 0;
    margin-right: 0;
}

.slip-list {
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.slip-item {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .6rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfcff;
}

.slip-item img,
.slip-item .slip-thumb-missing {
    width: 64px;
    height: 64px;
    flex: 0 0 auto;
    object-fit: cover;
    border-radius: .35rem;
    background: linear-gradient(160deg, #eaf1fc, #dbe6f7);
}

.slip-item .slip-thumb-missing {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9db4d6;
    font-size: 1.4rem;
}

.slip-form {
    background: #f7faff;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    padding: 1rem;
}

/* --------------------------------------------------------------------------
   หน้าติดตามการจอง
   -------------------------------------------------------------------------- */
.track-box {
    max-width: 620px;
    margin: 0 auto;
}

.timeline-simple {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.timeline-simple li {
    position: relative;
    padding-left: 1.75rem;
    padding-bottom: 1rem;
}

.timeline-simple li::before {
    content: '';
    position: absolute;
    left: .3rem;
    top: .35rem;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--line);
}

.timeline-simple li.done::before {
    background: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 161, 42, .22);
}

.timeline-simple li:not(:last-child)::after {
    content: '';
    position: absolute;
    left: .77rem;
    top: 1.1rem;
    bottom: 0;
    width: 1px;
    background: var(--line);
}

/* --------------------------------------------------------------------------
   หน้าเข้าสู่ระบบ
   -------------------------------------------------------------------------- */
.login-page-custom {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background:
        radial-gradient(circle at 50% 15%, rgba(47, 134, 255, .45), transparent 55%),
        radial-gradient(circle at 15% 85%, rgba(212, 161, 42, .2), transparent 45%),
        linear-gradient(160deg, var(--brand), var(--brand-deep));
}

.login-card {
    width: 100%;
    max-width: 430px;
    background: #fff;
    border-radius: 1rem;
    border-top: 4px solid var(--gold);
    box-shadow: 0 18px 45px rgba(3, 21, 60, .45);
    overflow: hidden;
}

.login-card-head {
    text-align: center;
    padding: 2rem 1.5rem 1.25rem;
    background: linear-gradient(160deg, rgba(11, 60, 145, .08), transparent);
}

/* ตราลูกเสือไทย (PNG พื้นหลังโปร่งใส) */
.login-card-head .logo {
    width: 92px;
    height: 92px;
    margin: 0 auto .8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card-head .logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 3px 8px rgba(11, 60, 145, .22));
}

.login-card-head h4 {
    color: var(--brand);
    font-weight: 700;
}

.login-card-head .login-subtitle {
    font-size: .84rem;
    line-height: 1.4;
    color: var(--muted);
}

.login-card-body {
    padding: .5rem 2rem 2rem;
}

.input-group-text.icon-box {
    background-color: var(--paper);
    border-right: 0;
    color: var(--brand);
    width: 44px;
    justify-content: center;
}

/* --------------------------------------------------------------------------
   ส่วนท้ายหน้าเว็บหลัก
   -------------------------------------------------------------------------- */
.footer-main {
    background:
        radial-gradient(circle at 85% 0%, rgba(47, 134, 255, .25), transparent 55%),
        linear-gradient(100deg, var(--brand-deep), var(--brand-dark));
    color: #fff;
    padding: 2.75rem 0 1.5rem;
    margin-top: 3rem;
    border-top: 3px solid var(--gold);
}

.footer-main .footer-title {
    color: var(--gold-light);
    font-size: 1rem;
    margin-bottom: .9rem;
}

.footer-links {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.footer-links li {
    margin-bottom: .45rem;
    color: rgba(255, 255, 255, .72);
    font-size: .92rem;
}

.footer-links a {
    color: rgba(255, 255, 255, .72);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--gold-light);
}

.footer-divider {
    border-color: rgba(255, 255, 255, .15);
    margin: 1.5rem 0 1rem;
}

/* --------------------------------------------------------------------------
   หลังบ้าน (AdminLTE override)
   -------------------------------------------------------------------------- */
.layout-admin .navbar-admin {
    background: linear-gradient(100deg, var(--brand-deep), var(--brand));
    border-bottom: 2px solid var(--gold);
}

.layout-admin .navbar-admin .nav-link {
    color: rgba(255, 255, 255, .88) !important;
}

.layout-admin .main-sidebar {
    background-color: #071c47;
}

.layout-admin .brand-link {
    background-color: var(--brand-deep);
    border-bottom: 1px solid rgba(246, 213, 116, .35);
    color: var(--gold-light) !important;
    line-height: 1.2;
}

.layout-admin .brand-link .brand-text strong {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--gold-light);
    line-height: 1.35;
}

.layout-admin .brand-link .brand-text small {
    display: block;
    font-size: .68rem;
    line-height: 1.3;
    color: rgba(255, 255, 255, .62);
    white-space: normal;
}

.layout-admin .brand-image-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
    margin-left: .8rem;
    margin-right: .5rem;
    float: left;
    filter: drop-shadow(0 0 5px rgba(246, 213, 116, .4));
}

.layout-admin .nav-sidebar .nav-link.active {
    background: linear-gradient(90deg, var(--gold-dark), rgba(212, 161, 42, .3)) !important;
    color: #fff !important;
}

.layout-admin .nav-header {
    color: var(--gold-light) !important;
    background-color: transparent;
    font-size: .78rem;
    letter-spacing: .05em;
}

.layout-admin .content-header h1 {
    color: var(--brand);
    font-weight: 600;
}

.layout-admin .card-primary:not(.card-outline) > .card-header {
    background-color: var(--brand);
}

.layout-admin .card-outline.card-gold {
    border-top: 3px solid var(--gold);
}

.info-box .info-box-icon.bg-gold {
    background: linear-gradient(135deg, var(--gold-light), var(--gold-dark)) !important;
    color: #2a1d02;
}

.info-box .info-box-icon.bg-brand {
    background: linear-gradient(135deg, var(--brand-light), var(--brand-dark)) !important;
    color: #fff;
}

.table thead th {
    background-color: #f2f6fd;
    border-bottom-width: 1px;
    color: var(--brand);
    font-weight: 600;
    white-space: nowrap;
}

.table-preview-img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    background: linear-gradient(160deg, #eaf1fc, #dbe6f7);
    border-radius: .3rem;
}

.image-preview-box {
    border: 2px dashed var(--line);
    border-radius: var(--radius);
    padding: .5rem;
    text-align: center;
    background: #f8fbff;
}

.image-preview-box img {
    max-width: 100%;
    max-height: 160px;
    object-fit: contain;
}

/* --------------------------------------------------------------------------
   สำหรับการพิมพ์
   -------------------------------------------------------------------------- */
@media print {
    .no-print,
    .main-sidebar,
    .main-header,
    .main-footer,
    .navbar-main,
    .footer-main {
        display: none !important;
    }

    .content-wrapper {
        margin-left: 0 !important;
    }

    body {
        background: #fff !important;
    }
}

/* --------------------------------------------------------------------------
   จอเล็ก
   -------------------------------------------------------------------------- */
@media (max-width: 767.98px) {
    .hero {
        padding: 2.5rem 0;
        text-align: center;
    }

    .hero h1 {
        font-size: 1.6rem;
    }

    .section {
        padding: 2rem 0;
    }
}
