@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@400;500;600;700&display=swap');

/* ======================================================
   SIYA CHATBOT - PUBLIC THEME
====================================================== */

:root {
    --siya-navy: #0b3470;
    --siya-blue: #1654a3;
    --siya-blue-light: #3479ce;

    --siya-orange: #ef8b17;
    --siya-gold: #f5bb35;

    --siya-bg: #f5f8fc;
    --siya-soft: #eef4ff;
    --siya-white: #ffffff;

    --siya-text: #1f2937;
    --siya-muted: #667085;
    --siya-border: #dbe4ef;

    --siya-shadow: 0 10px 30px rgba(11, 52, 112, 0.10);
}

/* ======================================================
   BASE
====================================================== */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Sarabun', sans-serif;
    background: var(--siya-bg);
    color: var(--siya-text);
}

a {
    text-decoration: none;
}

/* ======================================================
   NAVBAR
====================================================== */

.navbar,
.bg-primary,
.siya-navbar {
    background: linear-gradient(
        135deg,
        var(--siya-navy),
        var(--siya-blue)
    ) !important;

    min-height: 76px;

    box-shadow:
        0 4px 18px rgba(11, 52, 112, 0.18);
}

.navbar-brand {
    color: var(--siya-white) !important;
    font-weight: 700;
}

.navbar .nav-link {
    color: rgba(255, 255, 255, 0.92) !important;
    font-weight: 500;

    padding: 8px 12px !important;

    border-radius: 9px;

    transition: all 0.2s ease;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
    color: var(--siya-white) !important;

    background:
        rgba(255, 255, 255, 0.12);
}

/* ======================================================
   LOGO
====================================================== */

/* โลโก้ใหม่ของโรงเรียน */
.brand-logo,
.siya-public-logo,
.siya-logo {
    width: 54px;
    height: 54px;

    object-fit: contain;

    background: var(--siya-white);

    padding: 3px;

    border-radius: 50%;

    border:
        2px solid var(--siya-gold);

    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.14);
}.brand-logo,
.siya-public-logo,
.siya-logo {
    width: 54px;
    height: 54px;
    object-fit: contain;
    background: var(--siya-white);
    padding: 3px;
    border-radius: 50%;
    border: 2px solid var(--siya-gold);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
}
/* ชื่อระบบ */
.siya-brand-title {
    color: var(--siya-white);

    font-size: 1.1rem;

    font-weight: 700;

    line-height: 1.1;
}

/* ชื่อโรงเรียน */
.siya-brand-school {
    display: block;

    margin-top: 3px;

    color: #ffd979;

    font-size: 0.72rem;

    font-weight: 400;

    line-height: 1.2;
}

/* ======================================================
   HERO SECTION
====================================================== */

.hero,
.hero-section {
    position: relative;
    overflow: hidden;
    padding: 7rem 0;
    color: var(--siya-white);

    background-image:
        linear-gradient(
            rgba(7, 45, 100, 0.45),
            rgba(7, 45, 100, 0.45)
        ),
        url("../images/school-bg.jpg");

    background-size: 110% auto;
    background-position: center 75%;
    background-repeat: no-repeat;
    background-color: #0b356d;
}

/* วงกลมตกแต่ง */
.hero::before,
.hero-section::before {
    content: "";

    position: absolute;

    width: 440px;
    height: 440px;

    top: -220px;
    right: -130px;

    border-radius: 50%;

    background:
        rgba(255, 255, 255, 0.06);
}

.hero::after,
.hero-section::after {
    content: "";

    position: absolute;

    width: 300px;
    height: 300px;

    left: -130px;
    bottom: -170px;

    border-radius: 50%;

    background:
        rgba(245, 187, 53, 0.10);
}

/* ให้เนื้อหาอยู่ด้านบน decoration */
.hero > *,
.hero-section > * {
    position: relative;

    z-index: 2;
}

/* Hero heading */
.hero h1,
.hero h2,
.hero h3,
.hero p,
.hero-section h1,
.hero-section h2,
.hero-section h3,
.hero-section p {
color: #ffffff !important;}

/* ======================================================
   HERO CARD
====================================================== */

.hero-card {
    background:
        rgba(255, 255, 255, 0.12);

    border:
        1px solid rgba(255, 255, 255, 0.25);

    border-radius: 20px;

    backdrop-filter: blur(10px);

    box-shadow:
        0 15px 35px rgba(0, 24, 60, 0.16);
}

/* ======================================================
   BADGE
====================================================== */

.hero .badge,
.hero-section .badge,
.badge-siya {
    background: var(--siya-white) !important;

    color: var(--siya-blue) !important;

    border-radius: 999px;

    padding: 7px 12px;

    font-weight: 600;
}

/* ======================================================
   BUTTONS
====================================================== */

.btn-primary {
    background: linear-gradient(
        135deg,
        var(--siya-orange),
        var(--siya-gold)
    );

    border: none;

    color: var(--siya-white);

    font-weight: 600;

    border-radius: 11px;

    padding: 10px 18px;

    box-shadow:
        0 5px 15px rgba(239, 139, 23, 0.24);

    transition: all 0.2s ease;
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(
        135deg,
        #d8780d,
        #e6a51d
    );

    color: var(--siya-white);

    transform: translateY(-1px);
}

.btn-outline-primary {
    border-color: var(--siya-blue);

    color: var(--siya-blue);

    border-radius: 11px;
}

.btn-outline-primary:hover {
    background: var(--siya-blue);

    border-color: var(--siya-blue);

    color: var(--siya-white);
}

.btn-warning,
.btn-siya {
    background: var(--siya-orange);

    border-color: var(--siya-orange);

    color: var(--siya-white);
}

.btn-warning:hover,
.btn-siya:hover {
    background: #d8780d;

    border-color: #d8780d;

    color: var(--siya-white);
}

/* ปุ่มใน Hero */
.hero .btn-light,
.hero-section .btn-light {
    color: var(--siya-navy);

    border-radius: 12px;

    border: none;

    font-weight: 600;

    box-shadow:
        0 6px 18px rgba(0, 0, 0, 0.12);
}

.hero .btn-outline-light,
.hero-section .btn-outline-light {
    border-radius: 12px;

    border-width: 1.5px;

    font-weight: 600;
}

/* ======================================================
   SECTION TITLE
====================================================== */

.section-title {
    color: var(--siya-navy);

    font-weight: 700;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--siya-navy);
}

/* ======================================================
   CARDS
====================================================== */

.card {
    background: var(--siya-white);

    border:
        1px solid var(--siya-border);

    border-radius: 18px;

    box-shadow: var(--siya-shadow);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-3px);

    box-shadow:
        0 16px 38px rgba(11, 52, 112, 0.13);
}

/* ======================================================
   ICON BOX
====================================================== */

.icon-box {
    width: 52px;
    height: 52px;

    display: grid;

    place-items: center;

    border-radius: 14px;

    background: var(--siya-soft);

    color: var(--siya-blue);

    font-size: 1.4rem;
}

/* ======================================================
   FORMS
====================================================== */

.form-control,
.form-select {
    border:
        1px solid var(--siya-border);

    border-radius: 11px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--siya-blue);

    box-shadow:
        0 0 0 0.2rem rgba(22, 84, 163, 0.12);
}

/* ======================================================
   FOOTER
====================================================== */

footer {
    background: linear-gradient(
        135deg,
        var(--siya-navy),
        #102f5f
    );

    color: var(--siya-white);
}

/* ======================================================
   ACCESSIBILITY
====================================================== */

:focus-visible {
    outline:
        3px solid rgba(245, 187, 53, 0.65);

    outline-offset: 2px;
}

/* ======================================================
   RESPONSIVE
====================================================== */

@media (max-width: 576px) {

    .hero,
    .hero-section {
        padding: 3rem 0;
    }

    .display-4 {
        font-size: 2.15rem;
    }

    .brand-logo,
    .siya-public-logo,
    .siya-logo {
        width: 44px;
        height: 44px;
    }

    .siya-brand-title {
        font-size: 0.95rem;
    }

    .siya-brand-school {
        font-size: 0.65rem;
    }
}
.category-card {
    background: #ffffff;
    border: 1px solid #e6edf7;
    border-radius: 20px;
    padding: 28px 20px;
    transition: all 0.25s ease;
    box-shadow: 0 8px 25px rgba(20, 58, 112, 0.06);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 35px rgba(20, 58, 112, 0.14);
    border-color: #b9d0ee;
}

.category-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef4ff;
    color: #163a70;
    font-size: 28px;
}

.category-card h5 {
    color: #163a70;
}
.hero-image-credit {
    position: absolute;
    right: 20px;
    bottom: 12px;
    z-index: 10;

    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);

    background: rgba(0, 0, 0, 0.35);
    padding: 4px 8px;
    border-radius: 6px;

}@media (max-width: 768px) {
    .hero-image-credit {
        right: 10px;
        bottom: 8px;
        font-size: 10px;
        padding: 4px 7px;
    }
}
.category-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.category-link:hover {
    text-decoration: none;
    color: inherit;
}

.category-card {
    background: #ffffff;
    border: 1px solid #e3ebf6;
    border-radius: 20px;
    padding: 28px 20px;
    transition: all 0.25s ease;
}

.category-card:hover {
    transform: translateY(-6px);
    border-color: #8eb6e8;
    box-shadow: 0 14px 32px rgba(22, 58, 112, 0.14);
}

.category-card:hover .category-icon {
    transform: scale(1.08);
}

.category-icon {
    transition: transform 0.25s ease;
}
/* ==========================================
   HOUSE / คณะสี
========================================== */

.house-card {
    background: #ffffff;
    border: 1px solid #e3ebf6;
    border-radius: 22px;
    padding: 28px;
    box-shadow: 0 10px 30px rgba(22, 58, 112, 0.07);
    transition: 0.25s ease;
}

.house-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 38px rgba(22, 58, 112, 0.12);
}

.house-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.house-color-icon {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.house-class-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.class-item {
    background: #f8fafc;
    border: 1px solid #e9eef5;
    border-radius: 12px;
    padding: 10px 12px;
    font-weight: 500;
}


/* สีแดง */

.house-red {
    border-top: 5px solid #dc3545;
}

.house-red .house-color-icon {
    background: #fff0f1;
    color: #dc3545;
}


/* สีเขียว */

.house-green {
    border-top: 5px solid #198754;
}

.house-green .house-color-icon {
    background: #edf9f2;
    color: #198754;
}


/* สีฟ้า */

.house-blue {
    border-top: 5px solid #0d6efd;
}

.house-blue .house-color-icon {
    background: #eef5ff;
    color: #0d6efd;
}


/* สีเหลือง */

.house-yellow {
    border-top: 5px solid #f0ad00;
}

.house-yellow .house-color-icon {
    background: #fff9e8;
    color: #d89b00;
}


/* สีชมพู */

.house-pink {
    border-top: 5px solid #e83e8c;
}

.house-pink .house-color-icon {
    background: #fff0f7;
    color: #e83e8c;
}


/* สีอื่น */

.house-default {
    border-top: 5px solid #6c757d;
}

.house-default .house-color-icon {
    background: #f2f4f6;
    color: #6c757d;
}


@media (max-width: 576px) {

    .house-class-list {
        grid-template-columns: 1fr;
    }

}
/* =========================================
   HISTORY PAGE
========================================= */

.history-main-image {
    max-height: 560px;
    object-fit: cover;
    object-position: center;
}

.history-details summary {
    display: inline-block;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.history-details summary::-webkit-details-marker {
    display: none;
}

.history-details[open] summary {
    background: #163a70;
    border-color: #163a70;
    color: #ffffff;
}

.history-more-box {
    padding: 24px;
    background: #f8fafc;
    border: 1px solid #e3ebf6;
    border-radius: 16px;
}

.management-card {
    height: 100%;
    padding: 18px;
    background: #ffffff;
    border: 1px solid #e5ebf3;
    border-radius: 14px;
}
/* ==========================================
   PROGRAMS PAGE
========================================== */

.program-icon {
    width: 64px;
    height: 64px;
    flex: 0 0 64px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 18px;

    background: #eef4ff;
    color: #163a70;

    font-size: 28px;
}

.program-details summary {
    display: inline-block;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.program-details summary::-webkit-details-marker {
    display: none;
}

.program-details[open] summary {
    background: #163a70;
    border-color: #163a70;
    color: #ffffff;
}

.program-more-box {
    padding: 24px;

    background: #f8fafc;

    border: 1px solid #e3ebf6;
    border-radius: 18px;
}

.program-card {
    height: 100%;

    padding: 20px;

    background: #ffffff;

    border: 1px solid #e3ebf6;
    border-radius: 16px;

    transition: 0.2s ease;
}

.program-card:hover {
    transform: translateY(-3px);

    border-color: #9bbce5;

    box-shadow: 0 10px 24px rgba(22, 58, 112, 0.08);
}

.program-number,
.program-class {
    display: inline-block;

    padding: 5px 10px;

    background: #eef4ff;

    color: #163a70;

    border-radius: 8px;

    font-size: 14px;
    font-weight: 600;
}
/* =========================================
   STAFF PAGE - แยกกลุ่มให้ชัดเจน
========================================= */

.department-section {
    position: relative;
    overflow: hidden;

    padding: 30px;

    background: #ffffff;

    border: 1px solid #dce7f5;
    border-radius: 24px;

    box-shadow: 0 10px 30px rgba(22, 58, 112, 0.07);
}

.department-section + .department-section {
    margin-top: 28px;
}

.department-accent {
    position: absolute;

    top: 0;
    left: 0;

    width: 100%;
    height: 6px;

    background: linear-gradient(
        90deg,
        #163a70,
        #285aa6
    );
}

.department-title {
    padding-bottom: 18px;

    border-bottom: 2px solid #edf2f8;
}

.department-icon {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #eef4ff;
    color: #163a70;

    border-radius: 16px;

    font-size: 24px;
}

.department-name {
    margin: 0;

    color: #163a70;

    font-size: 24px;
    font-weight: 700;
    line-height: 1.35;
}

.department-count {
    display: inline-block;

    margin-top: 4px;

    padding: 4px 10px;

    background: #eef4ff;
    color: #285aa6;

    border-radius: 999px;

    font-size: 13px;
    font-weight: 600;
}


/* การ์ดครู */

.staff-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;

    height: 100%;

    padding: 22px;

    background: #f9fbfe;

    border: 1px solid #e2eaf4;
    border-radius: 18px;

    box-shadow: none;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}

.staff-card:hover {
    transform: translateY(-4px);

    background: #ffffff;

    border-color: #9abce8;

    box-shadow: 0 12px 28px rgba(22, 58, 112, 0.10);
}

.staff-avatar {
    width: 50px;
    height: 50px;
    flex: 0 0 50px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 15px;

    background: #eaf2ff;
    color: #163a70;

    font-size: 22px;
}


/* ฝ่ายผู้บริหารให้ต่างจากครู */

.administrator-card {
    background: linear-gradient(
        135deg,
        #f8fbff,
        #eef4ff
    );

    border: 1px solid #bcd2ef;
    border-left: 5px solid #163a70;
}

.administrator-card .staff-avatar {
    background: #163a70;
    color: #ffffff;
}


/* มือถือ */

@media (max-width: 768px) {

    .department-section {
        padding: 22px;
    }

    .department-name {
        font-size: 20px;
    }

    .department-icon {
        width: 50px;
        height: 50px;
        flex-basis: 50px;

        font-size: 21px;
    }

}
/* ================================
   SUPPORT STAFF
================================ */

.support-section {
    position: relative;
    overflow: hidden;

    padding: 30px;

    background: #f8fafc;

    border: 1px solid #dce7f5;
    border-radius: 24px;

    box-shadow: 0 10px 30px rgba(22, 58, 112, 0.07);
}

.support-accent {
    position: absolute;
    top: 0;
    left: 0;

    width: 100%;
    height: 6px;

    background: #6c757d;
}

.support-icon {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 16px;

    background: #eef1f4;
    color: #495057;

    font-size: 24px;
}

.support-card {
    background: #ffffff;
}

.support-avatar {
    background: #eef1f4;
    color: #495057;
}
/* ทำเมนู Navbar ให้อยู่แนวเดียวกัน */
.navbar-nav {
    align-items: center;
}

.navbar-nav .nav-item {
    display: flex;
    align-items: center;
}

.navbar-nav .nav-link {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 44px;
    padding: 8px 16px;

    white-space: nowrap;
    line-height: 1.2;
}
@media (min-width: 992px) {
    .navbar-nav .nav-link {
        min-width: 105px;
    }

    .navbar-nav .nav-item:nth-last-child(2) .nav-link {
        min-width: 170px;
    }
}
@media (min-width: 992px) {
    #mainNavbar .navbar-nav {
        width: 100%;
    }

    #mainNavbar .nav-item.ms-lg-auto {
        margin-left: auto !important;
    }
}
/* =========================================
   COOKIE CONSENT
========================================= */

.cookie-consent {
    position: fixed;
    left: 24px;
    right: 24px;
    bottom: 24px;
    z-index: 9999;

    max-width: 1180px;
    margin: 0 auto;

    background: rgba(255, 255, 255, 0.97);
    border: 1px solid #dce7f5;
    border-radius: 20px;

    box-shadow:
        0 16px 50px rgba(22, 58, 112, 0.18);

    backdrop-filter: blur(12px);

    animation: cookieSlideUp 0.3s ease;
}

.cookie-consent-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;

    padding: 22px 26px;
}

.cookie-consent-text h3 {
    margin: 0 0 6px;

    color: #163a70;
    font-size: 18px;
    font-weight: 700;
}

.cookie-consent-text p {
    margin: 0 0 6px;

    color: #5f6b7a;
    font-size: 14px;
    line-height: 1.65;
}

.cookie-consent-text a {
    color: #285aa6;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.cookie-consent-text a:hover {
    text-decoration: underline;
}

.cookie-consent-action {
    flex-shrink: 0;
}

.cookie-consent-action .btn {
    min-width: 110px;
    border-radius: 12px;
    padding: 10px 20px;
}

.cookie-hide {
    opacity: 0;
    transform: translateY(20px);

    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
}

@keyframes cookieSlideUp {

    from {
        opacity: 0;
        transform: translateY(25px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

 (max-width: 768px) {

    .cookie-consent {
        left: 12px;
        right: 12px;
        bottom: 12px;
    }

    .cookie-consent-content {
        flex-direction: column;
        align-items: stretch;

        padding: 18px;
    }

    .cookie-consent-action .btn {
        width: 100%;
    }

}
/* ประกาศการใช้งานเพื่อการศึกษา */
.education-notice {
    max-width: 850px;
    margin-left: auto;
    margin-right: auto;
    padding: 14px 20px;

    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
}

.education-notice strong {
    display: block;
    font-size: 16px;
    font-weight: 700;
}

.education-notice p {
    font-size: 13px;
    line-height: 1.7;
    opacity: 0.9;
}

.footer-divider {
    border-color: rgba(255, 255, 255, 0.15);
    max-width: 900px;
    margin: 18px auto;
}
/* =========================================================
   TABLET / IPAD RESPONSIVE
   รองรับจอประมาณ 768px - 1180px
========================================================= */

@media (min-width: 768px) and (max-width: 1180px) {

    /* พื้นที่หลัก */
    .container,
    .container-fluid {
        width: 100%;
        max-width: 100%;
        padding-left: 24px;
        padding-right: 24px;
    }

    /* Header */
    .navbar,
    .site-header {
        padding-left: 20px;
        padding-right: 20px;
    }

    .navbar-brand,
    .brand {
        flex-shrink: 0;
    }

    /* เมนู */
    .navbar-nav {
        gap: 8px;
    }

    .navbar-nav .nav-link {
        font-size: 0.95rem;
        padding-left: 10px;
        padding-right: 10px;
        white-space: nowrap;
    }

    /* Hero */
    .hero,
    .hero-section {
        padding-top: 3.5rem;
        padding-bottom: 3.5rem;
    }

    .hero h1,
    .hero-section h1 {
        font-size: clamp(2rem, 4vw, 3rem);
    }

    /* Card */
    .card {
        border-radius: 18px;
    }

    /* Grid การ์ด */
    .row > [class*="col-"] {
        min-width: 0;
    }

    /* หน้า Chat */
    .chat-container,
    .chat-wrapper,
    .chat-card {
        width: 100%;
        max-width: 900px;
        margin-left: auto;
        margin-right: auto;
    }

    .chat-messages {
        min-height: 500px;
        max-height: 65vh;
    }

    .chat-message,
    .message-bubble {
        max-width: 78%;
    }

    /* ตาราง */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* รูปภาพ */
    img {
        max-width: 100%;
        height: auto;
    }

    /* ฟอร์ม */
    input,
    select,
    textarea,
    button,
    .btn {
        min-height: 44px;
    }
}
.navbar-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 18px;
}
.navbar .container-fluid {
    width: 100%;
}

.navbar-collapse {
    flex-grow: 1;
}

.navbar-nav {
    margin-left: auto !important;
}
.navbar .container-fluid {
    width: 100%;
    max-width: 100%;
}

#mainNavbar {
    flex-grow: 1;
}

#mainNavbar .navbar-nav {
    margin-left: auto !important;
    margin-right: 0 !important;
}

@media (min-width: 992px) {
    #mainNavbar .navbar-nav {
        width: auto;
        justify-content: flex-end;
    }
}