/* Google Font */
@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700&family=Sarabun:wght@300;400;500;600&display=swap');

:root {
    --midnight-violet: #3d2645;
    --royal-plum: #832161;
    --magenta-bloom: #da4167;
    --ghost-white: #f8f9fa;
    --text-dark: #2c3e50;
    --text-light: #f8f9fa;
    /* เพิ่มสีขาวนวล */
    --gradient-primary: linear-gradient(135deg, var(--midnight-violet) 0%, var(--royal-plum) 100%);
    --gradient-accent: linear-gradient(135deg, var(--royal-plum) 0%, var(--magenta-bloom) 100%);
}

body {
    font-family: 'Kanit', sans-serif;
    background-color: var(--ghost-white);
    color: var(--text-dark);
    overflow-x: hidden;
}

/* =========================================
   PART 1: SIDEBAR & DASHBOARD (Backend)
   ========================================= */
.main-sidebar {
    background-color: var(--midnight-violet) !important;
}

.brand-link {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Sidebar Text Color Fix */
.main-sidebar .nav-link p,
.main-sidebar .nav-link i,
.main-sidebar .brand-text,
.main-sidebar .user-panel .info a {
    color: rgba(255, 255, 255, 0.9) !important;
    /* ปรับให้สว่างขึ้น */
    transition: color 0.3s;
}

.main-sidebar .nav-link:hover p,
.main-sidebar .nav-link:hover i {
    color: #fff !important;
}

/* Sidebar Active State */
.main-sidebar .nav-pills .nav-link.active,
.main-sidebar .nav-pills .show>.nav-link {
    background: var(--gradient-accent) !important;
    color: #fff !important;
    box-shadow: 0 4px 15px rgba(218, 65, 103, 0.4);
    border-radius: 10px;
}

/* Content Layout */
.content-wrapper {
    background-color: var(--ghost-white);
}

.content-header h1 {
    font-weight: 600;
    color: var(--midnight-violet);
}

/* --- Modern Cards (ปรับปรุง Header) --- */
.card {
    border-radius: 20px;
    border: none;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease;
    overflow: hidden;
    /* เพื่อให้ header โค้งตาม card */
}

/* แก้ไข Card Header ให้ชัดเจน */
.card-header {
    background: white;
    /* พื้นหลังขาวสะอาด */
    border-bottom: 2px solid #f0f0f0;
    /* เส้นขอบหนาขึ้น */
    padding: 1.2rem 1.5rem;
    font-weight: 600;
}

/* กรณี Header เป็นสีเข้ม (เช่นใน Modal หรือ Card พิเศษ) */
.card-purple .card-header,
.bg-gradient-custom .card-header {
    background: var(--gradient-primary);
    color: white !important;
}

/* ยกเลิกการบังคับสีขาวที่ .card-title ทั่วไป */
.card-purple .card-header .card-title,
.bg-gradient-custom .card-header .card-title {
    color: white !important;
}

.card-title {
    font-size: 1.2rem;
    color: var(--midnight-violet) !important;
    /* บังคับสีม่วงเข้ม ตัดกับพื้นขาว */
    font-weight: 700;
}

/* Chart Containers */
.chart-container,
.chart-container-pie {
    position: relative;
    margin: auto;
    width: 100%;
}

.chart-container {
    height: 300px;
}

.chart-container-pie {
    height: 250px;
}

/* Dashboard Gradients */
.bg-gradient-1 {
    background: linear-gradient(135deg, #3d2645 0%, #832161 100%);
    color: white;
}

.bg-gradient-2 {
    background: linear-gradient(135deg, #832161 0%, #da4167 100%);
    color: white;
}

.bg-gradient-3 {
    background: linear-gradient(135deg, #da4167 0%, #ff8c42 100%);
    color: white;
}

.bg-gradient-4 {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

/* =========================================
   PART 2: BUTTONS & UI ELEMENTS (ปรับปรุงปุ่ม)
   ========================================= */

/* ปุ่ม Custom (สีม่วงไล่เฉด) */
.btn-custom {
    background: var(--gradient-accent);
    border: none;
    color: white !important;
    /* บังคับตัวหนังสือขาว */
    box-shadow: 0 4px 10px rgba(218, 65, 103, 0.3);
    border-radius: 50px;
    padding: 8px 25px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(218, 65, 103, 0.5);
    background: linear-gradient(135deg, var(--royal-plum) 0%, var(--midnight-violet) 100%);
    /* เปลี่ยนสีตอน hover */
    color: white !important;
}

/* ปุ่ม Outline (ขอบสี) */
.btn-outline-custom {
    border: 2px solid var(--royal-plum);
    color: var(--royal-plum);
    background: transparent;
    border-radius: 50px;
    padding: 6px 20px;
    font-weight: 600;
}

.btn-outline-custom:hover {
    background: var(--royal-plum);
    color: white;
}

/* แก้ไขปุ่มในตาราง (เล็ก/กลม) */
.btn-xs {
    padding: 4px 10px;
    font-size: 0.85rem;
    border-radius: 20px;
    margin: 0 2px;
}

.btn-xs.btn-danger {
    background-color: #dc3545;
    border: none;
    color: white;
}

.btn-xs.btn-warning {
    background-color: #ffc107;
    border: none;
    color: #212529;
    /* สีดำให้อ่านง่ายบนพื้นเหลือง */
}

.btn-xs.btn-info {
    background-color: #17a2b8;
    border: none;
    color: white;
}

/* =========================================
   PART 3: LANDING PAGE (Frontend)
   ========================================= */
/* Navbar Glass */
.navbar-glass {
    background: rgba(255, 255, 255, 0.95);
    /* เพิ่มความทึบ */
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.navbar-brand span {
    color: var(--midnight-violet);
}

/* Hero Section */
.hero-section {
    position: relative;
    padding: 180px 0 120px 0;
    background: url('https://images.unsplash.com/photo-1519389950473-47ba0277781c?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80') no-repeat center center/cover;
    background-attachment: fixed;
    color: white;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(61, 38, 69, 0.95) 0%, rgba(131, 33, 97, 0.9) 100%);
    z-index: 1;
}

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

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    text-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
}

/* Feature Cards */
.feature-card {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    height: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    transition: all 0.4s ease;
    border-bottom: 4px solid transparent;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    border-bottom-color: var(--magenta-bloom);
}

.icon-box {
    width: 80px;
    height: 80px;
    background: var(--ghost-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    font-size: 32px;
    color: var(--royal-plum);
    transition: 0.4s;
}

.feature-card:hover .icon-box {
    background: var(--gradient-accent);
    color: white;
    transform: rotateY(180deg);
}

/* Carousel */
.modern-carousel .carousel-item img {
    height: 500px;
    object-fit: cover;
    border-radius: 25px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.carousel-caption-custom {
    background: rgba(255, 255, 255, 0.95);
    /* พื้นหลังขาวทึบขึ้น */
    color: var(--midnight-violet);
    /* ตัวหนังสือสีเข้ม */
    bottom: 40px;
    left: 10%;
    right: 10%;
    padding: 20px;
    border-radius: 15px;
    backdrop-filter: blur(5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.carousel-caption-custom h5 {
    font-weight: 700;
    color: var(--royal-plum);
}

/* Global Landing Page Buttons */
.btn-gradient {
    background: var(--gradient-accent);
    color: white !important;
    border: none;
    border-radius: 50px;
    padding: 12px 35px;
    font-weight: 500;
    box-shadow: 0 5px 15px rgba(218, 65, 103, 0.4);
    transition: 0.3s;
}

.btn-gradient:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(218, 65, 103, 0.6);
    background: linear-gradient(135deg, var(--royal-plum) 0%, var(--midnight-violet) 100%);
}

.btn-outline-light-custom {
    border: 2px solid white;
    color: white !important;
    border-radius: 50px;
    padding: 10px 30px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

.btn-outline-light-custom:hover {
    background: white;
    color: var(--royal-plum) !important;
}

/* Animation Utils */
.floating-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    z-index: 0;
    animation: float 8s infinite ease-in-out;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-30px);
    }
}

/* ... (Keep existing code above) ... */

/* =========================================
   PART 4: MODERN WORKFLOW (NEW)
   ========================================= */
.workflow-section {
    position: relative;
    padding: 80px 0;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
}

/* Connecting Line (เส้นเชื่อม) */
.workflow-connector {
    position: absolute;
    top: 35%;
    /* ปรับตำแหน่งเส้นให้อยู่ตรงกลางไอคอน */
    left: 10%;
    width: 80%;
    height: 3px;
    background: #e9ecef;
    z-index: 0;
    background: linear-gradient(90deg, #e9ecef 0%, var(--magenta-bloom) 50%, #e9ecef 100%);
    background-size: 200% 100%;
    animation: flowLine 3s linear infinite;
    display: none;
}

@media (min-width: 992px) {
    .workflow-connector {
        display: block;
    }
}

@keyframes flowLine {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: -100% 0;
    }
}

/* Modern Card */
.workflow-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    padding: 2.5rem 1.5rem;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1;
    overflow: hidden;
}

.workflow-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 20px 50px rgba(61, 38, 69, 0.15);
    border-color: rgba(218, 65, 103, 0.3);
}

/* Watermark Number */
.step-number {
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 6rem;
    font-weight: 900;
    color: rgba(0, 0, 0, 0.03);
    line-height: 1;
    transition: 0.4s;
    z-index: 0;
    font-family: 'Sarabun', sans-serif;
}

.workflow-card:hover .step-number {
    color: rgba(218, 65, 103, 0.1);
    transform: scale(1.2) rotate(-10deg);
}

/* Icon Styling */
.workflow-icon-box {
    width: 90px;
    height: 90px;
    margin: 0 auto 20px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--midnight-violet);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 1;
    transition: 0.4s;
}

.workflow-card:hover .workflow-icon-box {
    background: var(--gradient-accent);
    color: white;
    transform: rotateY(360deg);
}

/* Text */
.workflow-title {
    font-weight: 700;
    color: var(--midnight-violet);
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.workflow-desc {
    color: #6c757d;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

/* Animated Dot on line */
.dot-flow {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--magenta-bloom);
    border-radius: 50%;
    top: 35%;
    left: 0;
    transform: translateY(-50%);
    box-shadow: 0 0 10px var(--magenta-bloom);
    animation: moveDot 4s linear infinite;
    z-index: 0;
    display: none;
}

@media (min-width: 992px) {
    .dot-flow {
        display: block;
    }
}

@keyframes moveDot {
    0% {
        left: 10%;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        left: 90%;
        opacity: 0;
    }
}

/* ... (Keep all existing code above) ... */

/* =========================================
   PART 5: MODERN FOOTER (NEW)
   ========================================= */
footer.bg-dark {
    background: linear-gradient(180deg, #2c1e31 0%, #1a1020 100%) !important;
    position: relative;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    padding-top: 80px;
    padding-bottom: 30px;
}

/* Decorative Top Border */
footer.bg-dark::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-accent);
}

/* Footer Heading */
footer h6 {
    color: white;
    font-weight: 700;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
    letter-spacing: 0.5px;
}

footer h6::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 30px;
    height: 3px;
    background: var(--magenta-bloom);
    border-radius: 2px;
    transition: width 0.3s;
}

footer .col-lg-3:hover h6::after,
footer .col-lg-2:hover h6::after {
    width: 50px;
}

/* Footer Links */
footer ul li {
    margin-bottom: 10px;
}

footer a.text-muted {
    color: rgba(255, 255, 255, 0.6) !important;
    transition: all 0.3s ease;
    display: inline-block;
}

footer a.text-muted:hover {
    color: var(--magenta-bloom) !important;
    transform: translateX(5px);
    text-shadow: 0 0 10px rgba(218, 65, 103, 0.5);
}

/* Brand Section */
footer .h5 {
    background: linear-gradient(to right, #fff, #e0e0e0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

/* Social Icons / Contact Icons */
footer i {
    transition: 0.3s;
}

footer li:hover i {
    color: var(--magenta-bloom);
}

/* Bottom Copyright Bar */
footer hr.border-secondary {
    border-color: rgba(255, 255, 255, 0.1) !important;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
}

/* Developer Badge */
footer .rounded-circle.border {
    border-color: rgba(255, 255, 255, 0.2) !important;
    transition: 0.3s;
}

footer .d-flex:hover .rounded-circle.border {
    border-color: var(--magenta-bloom) !important;
    box-shadow: 0 0 15px rgba(218, 65, 103, 0.4);
}

/* Button in Footer */
footer .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
}

footer .btn-outline-light:hover {
    background: var(--gradient-accent);
    border-color: transparent;
    color: white;
    box-shadow: 0 5px 15px rgba(218, 65, 103, 0.4);
}