/* --- Global Variables & Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700;800&display=swap');

:root {
    --bs-primary: #3b82f6;
    --bs-primary-rgb: 59, 130, 246;
    --secondary-bg: #f8fafc;
    --error-red: #dc3545;
    --text-dark: #1e293b;
    --text-muted: #64748b;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Prompt', sans-serif;
    color: var(--text-dark);
    overflow-x: hidden;
    background-color: #ffffff;
    font-size: 16px;
}

/* --- Helper Classes --- */
.gap-2 > * { margin-right: 0.5rem; }
.gap-2 > *:last-child { margin-right: 0; }
.d-flex.gap-2 { gap: 0.5rem; }

.rounded-3 { border-radius: 0.5rem !important; }
.rounded-4 { border-radius: 1rem !important; }
.rounded-5 { border-radius: 1.5rem !important; }
.rounded-pill { border-radius: 50rem !important; }

.fw-bold { font-weight: 700 !important; }
.text-primary { color: var(--bs-primary) !important; }
.bg-primary { background-color: var(--bs-primary) !important; }
.shadow-lg { box-shadow: 0 1rem 3rem rgba(0,0,0,.175)!important; }
.shadow-hover:hover { transform: translateY(-5px); box-shadow: 0 1rem 3rem rgba(0,0,0,.15)!important; transition: all 0.3s ease; }

/* Custom Opacity Classes */
.bg-primary.bg-opacity-10 { background-color: rgba(59, 130, 246, 0.1) !important; }
.bg-success.bg-opacity-10 { background-color: rgba(25, 135, 84, 0.1) !important; }
.bg-warning.bg-opacity-10 { background-color: rgba(255, 193, 7, 0.1) !important; }
.bg-danger.bg-opacity-10 { background-color: rgba(220, 53, 69, 0.1) !important; }

.badge.bg-opacity-10 { color: var(--bs-primary) !important; background-color: #e0f2fe !important; }

/* --- Buttons --- */
.btn-primary {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.39);
    transition: all 0.3s ease;
}
.btn-primary:hover {
    transform: translateY(-2px);
    background-color: #2563eb;
    border-color: #2563eb;
    box-shadow: 0 6px 20px 0 rgba(59, 130, 246, 0.5);
}

/* --- Navbar --- */
.navbar-custom {
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
    padding: 15px 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1030;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.navbar-custom .nav-link {
    font-weight: 500;
    color: var(--text-muted) !important;
    margin: 0 15px;
    padding: 10px 0 !important;
    position: relative;
    transition: color 0.3s;
}

.navbar-custom .nav-link:hover, 
.navbar-custom .nav-link.active {
    color: var(--bs-primary) !important;
}

/* --- Landing Page Specifics --- */
.text-gradient-primary {
    background: linear-gradient(90deg, #2563eb 0%, #3b82f6 50%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

.hero-section {
    padding-top: 140px;
    padding-bottom: 80px;
    position: relative;
    overflow: hidden;
    background: 
        radial-gradient(circle at 0% 0%, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 100% 0%, rgba(147, 197, 253, 0.15) 0%, transparent 40%),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.hero-card-container {
    position: relative;
    width: 100%;
    height: 550px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-main-card {
    background: white;
    padding: 50px 40px;
    border-radius: 40px;
    box-shadow: 0 30px 60px -12px rgba(59, 130, 246, 0.2);
    text-align: center;
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 500px;
    transform: rotate(-3deg);
    border: 3px solid #3b82f6;
    transition: transform 0.5s ease;
}

.hero-main-card:hover {
    transform: rotate(0deg) scale(1.02);
}

/* Floating Icons */
.floating-icon {
    position: absolute;
    width: 70px;
    height: 70px;
    border-radius: 20px;
    background: white;
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    z-index: 11;
}

.icon-fb { color: #1877F2; animation: float 5s ease-in-out infinite; }
.icon-ig { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); color: white; animation: float-reverse 6s ease-in-out infinite; }
.icon-tk { color: #000000; animation: float 4s ease-in-out infinite; }
.icon-yt { color: #FF0000; animation: float-reverse 5.5s ease-in-out infinite; }

@keyframes float { 0% { transform: translateY(0px); } 50% { transform: translateY(-15px); } 100% { transform: translateY(0px); } }
@keyframes float-reverse { 0% { transform: translateY(0px); } 50% { transform: translateY(15px); } 100% { transform: translateY(0px); } }

/* --- Content Styles --- */
.service-card-big {
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    border: 1px solid #f1f5f9;
}

.check-list-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
}
.check-icon {
    color: #10b981; /* Success Green */
    margin-right: 10px;
    margin-top: 4px;
    flex-shrink: 0;
}

/* --- Marquee Animation (Seamless & Slower) --- */
.marquee-section {
    background: white;
    padding: 40px 0;
    overflow: hidden;
    position: relative;
}
.marquee-wrapper {
    display: flex;
    width: 100%;
    overflow: hidden;
}
.marquee-content {
    display: flex;
    flex-shrink: 0;
    animation: marquee 60s linear infinite; /* Slower speed */
}
/* New Marquee Pill Style */
.marquee-pill {
    display: inline-flex;
    align-items: center;
    margin-right: 30px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 50px;
    padding: 10px 25px;
    color: #495057;
    font-weight: 600;
    font-size: 1rem;
    white-space: nowrap;
    transition: all 0.3s;
}
.marquee-pill:hover {
    background-color: #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border-color: var(--bs-primary);
    color: var(--bs-primary);
}
.marquee-pill i {
    margin-right: 10px;
    font-size: 1.2rem;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* --- New Service Layout Styles --- */
.service-hero-card {
    background: #fff;
    border-radius: 25px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    box-shadow: 0 15px 40px rgba(0,0,0,0.04);
    border: 1px solid #f1f5f9;
    transition: transform 0.3s ease;
}
.service-hero-card:hover {
    transform: translateY(-5px);
}
.service-hero-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.service-list-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
}
.service-list-icon {
    color: #10b981; /* Success Green */
    margin-right: 10px;
    margin-top: 4px;
    flex-shrink: 0;
}

.service-card-mini {
    background: white;
    border-radius: 20px;
    padding: 30px 20px;
    text-align: center;
    border: 1px solid #f1f5f9;
    transition: all 0.3s;
    height: 100%;
    box-shadow: 0 5px 15px rgba(0,0,0,0.02);
}
.service-card-mini:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.08);
    border-color: transparent;
}
.service-mini-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    margin: 0 auto 20px;
    font-size: 28px;
}

/* --- Payment Section --- */
.payment-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
}
.payment-logo-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s;
}
.payment-logo-box:hover {
    transform: scale(1.05);
}
.payment-logo-img {
    height: 60px; /* Bigger logos */
    width: auto;
    object-fit: contain;
}

/* --- Footer --- */
.footer-modern {
    background-color: #0f172a;
    color: #94a3b8;
    padding-top: 80px;
    padding-bottom: 30px;
    font-size: 0.95rem;
}
.footer-title {
    color: white;
    font-weight: 700;
    margin-bottom: 25px;
    font-size: 1.1rem;
}
.footer-links {
    padding: 0;
    list-style: none;
}
.footer-links li {
    margin-bottom: 12px;
}
.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s;
}
.footer-links a:hover {
    color: var(--bs-primary);
    padding-left: 5px;
}
.social-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s;
    margin-right: 10px;
    text-decoration: none;
}
.social-btn:hover {
    background: var(--bs-primary);
    color: white;
    transform: translateY(-3px);
}

/* --- Signup / Split Screen --- */
.split-screen {
    min-height: 100vh;
    display: flex;
    width: 100%;
    background-color: #fff;
    align-items: stretch;
}

.left-pane {
    width: 50%;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    position: relative;
    display: none;
    min-height: 100vh;
}

.right-pane {
    width: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    min-height: 100vh;
}

.auth-container {
    width: 100%;
    max-width: 450px;
}

/* Auth Tabs Pill Design */
.auth-tabs-pill {
    background-color: #f1f5f9;
    border-radius: 50px;
    padding: 6px;
    display: flex;
    margin-bottom: 30px;
    border: 1px solid #e2e8f0;
    position: relative;
}
.auth-tab-item {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    color: #64748b;
    transition: all 0.3s ease;
    font-size: 1.05rem;
    z-index: 2;
    position: relative;
}
.auth-tab-item.active {
    background-color: var(--bs-primary);
    color: #fff;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

/* Error State */
.is-invalid {
    border-color: var(--error-red) !important;
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.1) !important;
    background-image: none !important;
}
.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: var(--error-red);
}
.alert-danger {
    color: #842029;
    background-color: #f8d7da;
    border-color: #f5c2c7;
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 20px;
}

/* Back Button */
.btn-back-float {
    position: absolute;
    top: 30px;
    left: 30px;
    z-index: 100;
    background: white;
    border-radius: 50px;
    padding: 10px 25px;
    color: #334155;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.btn-back-float:hover {
    background: var(--bs-primary);
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
}

/* Form Controls */
.form-control-lg {
    border-radius: 15px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 15px 25px;
    font-size: 1rem;
    height: auto;
}
.form-control-lg:focus {
    background-color: #fff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}
.btn-lg-block {
    width: 100%;
    border-radius: 50px;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: bold;
}

/* Mobile Specific Styles */
.mobile-header-image {
    display: none;
    width: 100%;
    height: 250px;
    background-size: cover;
    background-position: center;
    position: relative;
}
.mobile-auth-card {
    background: white;
    border-radius: 30px 30px 0 0;
    margin-top: -30px;
    padding: 40px 25px;
    position: relative;
    z-index: 5;
    width: 100%;
    min-height: calc(100vh - 220px);
}
.mobile-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    padding: 15px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 9999;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}
.mobile-bottom-bar .btn {
    flex: 1;
    border-radius: 50px;
    font-weight: bold;
}

/* Responsive Logic */
@media (min-width: 992px) {
    .left-pane { display: block; }
    .mobile-bottom-bar { display: none; }
    .mobile-header-image { display: none; }
}

@media (max-width: 991px) {
    .split-screen {
        flex-direction: column;
        background-color: #eef2f6;
    }
    .right-pane {
        width: 100%;
        padding: 0;
        background: transparent;
        display: block;
        min-height: auto;
    }
    .auth-container {
        max-width: 100%;
    }
    .mobile-header-image { display: block; }
    .mobile-auth-card {
        border-radius: 25px 25px 0 0;
        box-shadow: 0 -5px 20px rgba(0,0,0,0.05);
    }
    .btn-back-float {
        top: 20px;
        left: 20px;
    }
    
    /* Mobile Hero Fixes */
    .hero-section {
        padding-top: 100px;
        padding-bottom: 60px;
    }
    .hero-card-container {
        height: auto;
        margin-top: 40px;
    }
    .hero-main-card {
        transform: rotate(0deg); /* No tilt on mobile for better readability */
    }
}




/* =========================================
   1. DASHBOARD LAYOUT (แก้เรื่องกองกันฝั่งซ้าย)
   ========================================= */

/* จัดการ Body ให้เต็มจอ ไม่เลื่อนมั่ว */
body, html {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden; /* ซ่อน Scrollbar หลักของ Browser */
    background-color: #f8f9fa;
    font-family: 'Prompt', sans-serif;
}

/* กล่องใหญ่สุด ครอบทั้ง Sidebar และ Content */
.dashboard-container {
    display: flex;
    width: 100%;
    height: 100vh; /* สูงเต็มจอ */
    position: relative;
}

/* --- Sidebar (เมนูซ้าย) --- */
.sidebar {
    width: 260px; /* ความกว้างเมนู */
    height: 100%;
    background-color: #ffffff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    position: fixed; /* ยึดติดไว้ */
    left: 0;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.sidebar-header {
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid #f1f5f9;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto; /* ให้เลื่อนเมนูได้ถ้าเยอะ */
    padding: 15px 0;
}

/* ลิงก์ใน Sidebar */
.nav-item-dashboard {
    margin-bottom: 4px;
}

.nav-link-dashboard {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    color: #64748b;
    text-decoration: none !important;
    font-weight: 500;
    transition: all 0.2s;
    border-right: 3px solid transparent;
}

.nav-link-dashboard:hover, 
.nav-link-dashboard.active {
    background-color: #f8fafc;
    color: #3b82f6; /* สีฟ้า Primary */
    border-right-color: #3b82f6;
}

.nav-link-dashboard i {
    width: 24px;
    text-align: center;
    margin-right: 12px;
    font-size: 18px;
}

/* --- Main Content (เนื้อหาขวา) --- */
.main-content {
    flex: 1;
    margin-left: 260px; /* ดันเนื้อหาหนี Sidebar */
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: #f8f9fa;
    position: relative;
    width: calc(100% - 260px);
}

/* --- Top Navbar (แถบบน) --- */
.top-navbar {
    height: 70px;
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    flex-shrink: 0; /* ห้ามหด */
}

/* --- Page Content (พื้นที่แสดง Orders, Services) --- */
.page-content {
    flex: 1;
    overflow-y: auto; /* ให้เลื่อนเฉพาะเนื้อหา */
    padding: 30px;
}

/* ปุ่ม Toggle Sidebar (สำหรับมือถือ) */
.toggle-sidebar {
    background: none;
    border: none;
    font-size: 20px;
    color: #64748b;
    cursor: pointer;
    display: none; /* ซ่อนในจอคอม */
}

/* Overlay ดำๆ เวลามือถือเปิดเมนู */
.sidebar-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    display: none;
}

/* =========================================
   2. MOBILE RESPONSIVE (จอเล็ก)
   ========================================= */
@media (max-width: 992px) {
    .sidebar {
        left: -260px; /* ซ่อนเมนูไปทางซ้าย */
    }
    
    .main-content {
        margin-left: 0; /* เนื้อหาขยายเต็มจอ */
        width: 100%;
    }
    
    .toggle-sidebar {
        display: block; /* โชว์ปุ่มเมนู */
    }

    /* คลาสสำหรับเปิดเมนู (JS จะเติมคลาสนี้) */
    .dashboard-container.sidebar-open .sidebar {
        left: 0;
    }
    
    .dashboard-container.sidebar-open .sidebar-overlay {
        display: block;
    }
}

/* =========================================
   1. DASHBOARD LAYOUT (ฉบับแก้ไข: เลื่อนหน้าจอได้ปกติ)
   ========================================= */

/* 1.1 ปลดล็อก Body ให้เลื่อนได้ */
body, html {
    height: auto !important; /* ยกเลิกการฟิกความสูง */
    min-height: 100%;
    margin: 0;
    padding: 0;
    overflow-y: auto !important; /* บังคับให้มี Scrollbar */
    overflow-x: hidden; /* ซ่อนแค่แนวนอน */
    background-color: #f8f9fa;
    font-family: 'Prompt', sans-serif;
}

/* 1.2 ปรับ Container ให้ยืดตามเนื้อหา */
.dashboard-container {
    display: flex;
    width: 100%;
    min-height: 100vh; /* อย่างน้อยเต็มจอ แต่ยืดได้ */
    position: relative;
    height: auto; /* ปล่อยอิสระ */
}

/* 1.3 Sidebar ยังคง Fixed (ติดขอบซ้ายตลอด) */
.sidebar {
    width: 260px;
    height: 100vh; /* สูงเต็มจอเสมอ */
    background-color: #ffffff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    position: fixed; /* ยึดติด */
    left: 0;
    top: 0;
    z-index: 1000;
    overflow-y: auto; /* ถ้าเมนูเยอะก็เลื่อนเฉพาะเมนูได้ */
}

/* 1.4 Content ขยับหนี Sidebar และยืดตามเนื้อหา */
.main-content {
    flex: 1;
    margin-left: 260px; /* เว้นที่ให้ Sidebar */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #f8f9fa;
    position: relative;
    width: calc(100% - 260px);
    height: auto; /* ปล่อยยืด */
}

/* 1.5 พื้นที่เนื้อหา (ไม่ต้องมี Scrollbar ซ้อน) */
.page-content {
    flex: 1;
    padding: 30px;
    overflow: visible; /* ปล่อยให้เลื่อนตาม Body หลัก */
    height: auto;
}

/* --- Top Navbar (ยึดติดด้านบน หรือปล่อยลอยก็ได้) --- */
/* ถ้าอยากให้ Navbar เลื่อนตามเนื้อหาใช้ position: relative */
/* ถ้าอยากให้ Navbar ค้างอยู่ข้างบนเสมอใช้ position: sticky */
.top-navbar {
    height: 70px;
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky; /* ติดหนึบด้านบน */
    top: 0;
    z-index: 900;
}

/* --- Responsive Mobile --- */
@media (max-width: 992px) {
    .sidebar {
        left: -260px;
        height: 100%;
        position: fixed;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
}