/**
 * LTS Truck Tracking - Clean Orange & White Custom Stylesheet
 * Path: assets/css/style.css
 * ธีมสีส้ม-ขาว คลีนๆ สว่าง มินิมอล และเป็นมิตรต่อสายตาทั้งในที่ร่มและกลางแจ้ง
 */

/* ------------------------------------------------------------
 * 1. ตัวแปรสีระบบส่วนกลาง (CSS Root Variables)
 * ------------------------------------------------------------ */
:root {
    --primary-orange: #f97316;       /* สีส้มหลัก (Orange-500) */
    --primary-orange-hover: #ea580c; /* สีส้มเข้มตอน Hover (Orange-600) */
    --primary-orange-light: #ffedd5; /* สีส้มอ่อนโปร่งแสง (Orange-100) */
    --bg-main: #f8fafc;              /* พื้นหลังสว่างหลัก (Slate-50) */
    --bg-card: #ffffff;              /* พื้นหลังการ์ดขาวบริสุทธิ์ */
    --text-main: #0f172a;            /* ตัวอักษรหลัก สีเทาเข้มเกือบดำ (Slate-900) */
    --text-muted: #64748b;           /* ตัวอักษรสีรอง สีเทากลาง (Slate-500) */
    --border-color: #e2e8f0;         /* สีเส้นขอบหลัก (Slate-200) */
    --success-green: #10b981;        /* สีเขียวส่งงานเรียบร้อย */
}

/* ------------------------------------------------------------
 * 2. การตั้งค่าสไตล์พื้นฐาน (Global Overrides)
 * ------------------------------------------------------------ */
body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Sarabun', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ปรับแต่ง Scrollbar ให้ดูสะอาด เรียบง่าย */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ------------------------------------------------------------
 * 3. ปุ่มและองค์ประกอบโต้ตอบ (Interactive Buttons & Glows)
 * ------------------------------------------------------------ */
/* ปุ่มสีส้มเรืองแสงแบบคลีนๆ */
.btn-orange-glow {
    background-color: var(--primary-orange);
    color: #ffffff;
    box-shadow: 0 4px 12px 0 rgba(249, 115, 22, 0.2);
    transition: all 0.20s ease-in-out;
}

.btn-orange-glow:hover {
    background-color: var(--primary-orange-hover);
    box-shadow: 0 6px 18px 0 rgba(249, 115, 22, 0.35);
    transform: translateY(-1px);
}

.btn-orange-glow:active {
    transform: translateY(1px);
    box-shadow: 0 2px 6px 0 rgba(249, 115, 22, 0.15);
}

/* การ์ดสไตล์คลีน เงาบางเบา (Clean Card Style) */
.card-clean {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -2px rgba(0, 0, 0, 0.02), 0 10px 15px -3px rgba(15, 23, 42, 0.04);
    transition: box-shadow 0.25s ease;
}

.card-clean:hover {
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.06), 0 8px 10px -6px rgba(15, 23, 42, 0.06);
}

/* ------------------------------------------------------------
 * 4. ระบบแจ้งเตือนอัจฉริยะ (Toast Notifications)
 * ------------------------------------------------------------ */
.toast-clean {
    background-color: var(--bg-card);
    border-left: 4px solid var(--primary-orange);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
    color: var(--text-main);
    border-radius: 1rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-clean.toast-success {
    border-left-color: var(--success-green);
}

.toast-clean.toast-error {
    border-left-color: #ef4444;
}

/* ------------------------------------------------------------
 * 5. แถบสแกนเนอร์บาร์โค้ดสากล (Barcode Scanner Overlay)
 * ------------------------------------------------------------ */
.scanner-container {
    position: relative;
    overflow: hidden;
    border: 2px solid var(--border-color);
    border-radius: 1.5rem;
    background-color: var(--bg-card);
}

/* เส้นเลเซอร์สีส้มจำลองความคล่องตัวสำหรับการสแกนด้วยกล้องมือถือ */
.scanner-laser {
    position: absolute;
    height: 4px;
    width: 100%;
    background: linear-gradient(to right, transparent, var(--primary-orange), transparent);
    animation: scanAnimation 2.2s infinite ease-in-out;
    box-shadow: 0 0 12px var(--primary-orange);
    z-index: 10;
}

@keyframes scanAnimation {
    0% { top: 3%; }
    50% { top: 97%; }
    100% { top: 3%; }
}

/* ------------------------------------------------------------
 * 6. เส้นไทม์ไลน์ติดตามสถานะ 1-6 (Tracking Timeline Logs)
 * ------------------------------------------------------------ */
.timeline-container {
    position: relative;
    padding-left: 2rem;
}

.timeline-line {
    position: absolute;
    left: 8px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background-color: #e2e8f0; /* เส้นสีสว่าง */
}

/* จุดสถานะที่ผ่านมาแล้ว/กำลังดำเนินการ */
.timeline-dot-active {
    position: absolute;
    left: 0;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background-color: var(--primary-orange);
    border: 4px solid var(--primary-orange-light);
    box-shadow: 0 0 0 2px var(--primary-orange);
    z-index: 5;
}

/* จุดสถานะที่ยังมาไม่ถึง */
.timeline-dot-inactive {
    position: absolute;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background-color: #cbd5e1;
    border: 3px solid #ffffff;
    z-index: 5;
}

/* ------------------------------------------------------------
 * 7. ปรับปรุงฟิลด์กรอกข้อมูลและกล่องเลือก (Inputs & Focus states)
 * ------------------------------------------------------------ */
.input-clean {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 0.75rem;
    transition: all 0.2s ease-in-out;
}

.input-clean:focus {
    outline: none;
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}

/* ระบบจัดกลุ่มไอคอนนำทางในตาราง */
.action-icon {
    transition: transform 0.2s ease, color 0.2s ease;
}
.action-icon:hover {
    transform: scale(1.1);
    color: var(--primary-orange);
}