/**
 * assets/style.css
 * CSS เพิ่มเติมสำหรับระบบประกาศจัดซื้อจัดจ้าง
 */

/* ===== Truncate หลายบรรทัด ===== */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== ตาราง hover เรียบ ===== */
tbody tr {
    transition: background-color 0.15s ease;
}

/* ===== Drop Zone animation ===== */
#dropZone {
    transition: border-color 0.2s, background-color 0.2s;
}

/* ===== Progress bar ===== */
#progressBar {
    transition: width 0.3s ease;
}

/* ===== Modal fade ===== */
#deleteModal {
    animation: fadeIn 0.15s ease;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ===== Print styles ===== */
@media print {
    header, footer, form, .no-print { display: none !important; }
    main { padding: 0 !important; }
    table { font-size: 11px; }
}

/* ===== ปรับ Scrollbar ===== */
::-webkit-scrollbar        { width: 6px; height: 6px; }
::-webkit-scrollbar-track  { background: #f1f5f9; }
::-webkit-scrollbar-thumb  { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ===== Responsive Table (Mobile) ===== */
@media (max-width: 639px) {
    /* ตาราง admin — แสดงเป็น block บนมือถือ */
    table, thead, tbody, th, td, tr {
        display: block;
    }
    /* ซ่อน thead */
    thead.hidden { display: none !important; }

    /* แต่ละแถวเป็น card */
    tr[id^="row-"], tr[id^="urow-"] {
        background: #fff;
        border-radius: 0.5rem;
        margin-bottom: 0.5rem;
        padding: 0.75rem !important;
        box-shadow: 0 1px 3px rgba(0,0,0,.06);
        border: 1px solid #e5e7eb !important;
    }

    /* Reset ความกว้าง td */
    td { width: 100% !important; }
}

/* ===== ปรับ font size บนมือถือ ===== */
@media (max-width: 480px) {
    body { font-size: 14px; }
    h1   { font-size: 1rem !important; }
}