/* assets/css/style.css */


:root {
    /* Theme Colors */
    --primary-color: #7B1FA2;
    --primary-grad: linear-gradient(135deg, #7B1FA2 0%, #9C27B0 100%);
    --accent-grad: linear-gradient(135deg, #FF4081 0%, #F50057 100%);
    --bg-color: #F0F2F5;
    --text-main: #2D3748;
    --text-muted: #718096;
    
    /* UI Dimensions */
    --sidebar-width: 260px;
    --radius-lg: 20px;
    --radius-md: 12px;
    
    /* Shadows */
    --shadow-soft: 0 5px 15px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 8px 20px rgba(123, 31, 162, 0.3);
}

body {
    /* ใช้ Font ที่มีใน Windows/Mac อยู่แล้ว ไม่ต้องโหลด */
    font-family: 'Segoe UI', 'Tahoma', 'Sarabun', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
}
/* --- LAYOUT WRAPPER --- */
.d-flex { display: flex !important; }

#wrapper {
    width: 100%;
    position: relative;
}

/* --- 1. SIDEBAR (Floating Style) --- */
#sidebar-wrapper {
    width: var(--sidebar-width);
    position: fixed;
    top: 20px;
    left: 20px;
    bottom: 20px;
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    /* ซ่อน Scrollbar */
    -ms-overflow-style: none; 
    scrollbar-width: none; 
}

#sidebar-wrapper::-webkit-scrollbar { display: none; }

/* Brand / Logo */
.sidebar-brand {
    padding: 30px 25px;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.5px;
}

/* Menu Items (ปุ่มเมนู) */
.list-group {
    padding: 0 15px;
}

.menu-category {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin: 20px 10px 10px;
    letter-spacing: 1px;
}

.list-group-item {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 500;
    padding: 12px 20px;
    margin-bottom: 5px;
    border-radius: var(--radius-md);
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.list-group-item i {
    width: 24px;
    margin-right: 12px;
    font-size: 1.1rem;
    text-align: center;
    transition: all 0.2s;
}

/* Hover State */
.list-group-item:hover {
    background-color: #F8F9FA;
    color: var(--primary-color);
    transform: translateX(5px);
}

/* Active State (ปุ่มเรืองแสง) */
.list-group-item.active {
    background: var(--primary-grad);
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.list-group-item.active i {
    color: #fff;
}

/* --- 2. MAIN CONTENT & HEADER --- */
#page-content-wrapper {
    width: 100%;
    margin-left: calc(var(--sidebar-width) + 40px); /* เว้นที่ให้ Sidebar */
    padding: 20px 20px 20px 0;
    transition: all 0.3s ease;
    min-height: 100vh;
}

/* Header (Floating Navbar) */
.navbar-custom {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 15px 25px;
    box-shadow: var(--shadow-soft);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-main);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 5px 15px;
    background: #F7F7F9;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s;
}
.user-profile:hover { background: #EBEBED; }

.user-avatar {
    width: 38px;
    height: 38px;
    background: var(--primary-grad);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* --- 3. RESPONSIVE (MOBILE) --- */
@media (max-width: 991px) {
    #sidebar-wrapper {
        left: -300px; /* ซ่อนซ้าย */
        top: 0; bottom: 0;
        border-radius: 0 20px 20px 0;
        margin: 0;
    }
    
    #page-content-wrapper {
        margin-left: 0;
        padding: 15px;
    }

    body.toggled #sidebar-wrapper {
        left: 0;
        box-shadow: 0 0 50px rgba(0,0,0,0.2);
    }

    .navbar-custom {
        padding: 10px 15px;
    }

    /* Mobile Overlay */
    .overlay {
        display: none;
        position: fixed; top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.3); z-index: 900;
        backdrop-filter: blur(3px);
    }
    body.toggled .overlay { display: block; }
}

/* --- 4. BUTTONS & CARDS --- */
.btn-primary-custom {
    background: var(--primary-grad);
    border: none;
    color: white;
    padding: 10px 25px;
    border-radius: 30px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(123, 31, 162, 0.4);
    transition: all 0.3s;
}
.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(123, 31, 162, 0.6);
    color: white;
}

.card-custom {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    border: none;
    padding: 25px;
}

/* --- BEAUTIFUL FORM STYLES --- */

/* กล่อง Input ที่มีขอบสีรุ้ง (Gradient Border) */
.gradient-input-group {
    position: relative;
    background: #fff;
    border-radius: 15px;
    padding: 3px; /* ความหนาของขอบสี */
    background: linear-gradient(135deg, #e0e0e0 0%, #f3f3f3 100%); /* สีขอบตอนปกติ */
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 25px; /* เพิ่มระยะห่างระหว่างช่อง */
}

/* ตอน Focus ให้เปลี่ยนเป็นสีม่วง-ชมพู */
.gradient-input-group:focus-within {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    box-shadow: 0 8px 15px rgba(123, 31, 162, 0.2);
    transform: translateY(-2px);
}

.gradient-input-group .input-group {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
}

.form-control-custom {
    border: none;
    height: 50px;
    font-size: 1.1rem;
    padding-left: 15px;
    background: transparent;
}

.form-control-custom:focus {
    box-shadow: none;
    background: #fff;
}

/* ปุ่มกล้องใน Input */
.btn-scan-inline {
    background: white;
    border: none;
    color: var(--primary-color);
    padding: 0 20px;
    transition: all 0.2s;
}
.btn-scan-inline:active {
    background: #f3e5f5;
    transform: scale(0.95);
}

/* ป้ายกำกับด้านบน */
.input-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* --- AUTHENTICATION PAGES (Login & Register) --- */

/* พื้นหลังหน้า Login แบบเต็มจอ */
.auth-bg {
    min-height: 100vh;
    width: 100%;
    background: linear-gradient(135deg, #fdfbfd 0%, #f3e5f5 100%); /* ม่วงอ่อนจางๆ */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* การ์ด Login ลอยตัว */
.auth-card {
    background: #ffffff;
    width: 100%;
    max-width: 450px;
    border-radius: 25px;
    box-shadow: 0 10px 40px rgba(106, 27, 154, 0.15); /* เงาสีม่วง */
    padding: 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* แถบสีด้านบนการ์ด */
.auth-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

/* โลโก้ */
.auth-logo {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #7B1FA2 0%, #9C27B0 100%);
    color: white;
    font-size: 30px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 5px 15px rgba(123, 31, 162, 0.3);
}

/* Input สวยๆ */
.auth-input-group {
    position: relative;
    margin-bottom: 20px;
    text-align: left;
}

.auth-input-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 5px;
    display: block;
}

.auth-input-wrapper {
    position: relative;
}

.auth-input-wrapper i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    transition: color 0.3s;
}

.auth-input {
    width: 100%;
    padding: 12px 15px 12px 45px; /* เว้นที่ให้ไอคอน */
    border: 2px solid #eee;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s;
    background: #f9f9f9;
}

.auth-input:focus {
    border-color: var(--primary-color);
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 4px rgba(123, 31, 162, 0.1);
}

.auth-input:focus + i {
    color: var(--primary-color);
}

/* ปุ่มกด */
.btn-auth {
    width: 100%;
    padding: 12px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: bold;
    background: linear-gradient(135deg, #7B1FA2 0%, #FF4081 100%);
    border: none;
    color: white;
    margin-top: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 64, 129, 0.4);
    color: white;
}