/* assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Sarabun:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
    --primary-color: #1e66bd; /* สีน้ำเงินสว่างพรีเมียม */
    --primary-light: #1581c1; /* สีฟ้าสว่าง */
    --secondary-color: #00caf8; /* สีฟ้าน้ำทะเลไซอัน */
    --accent-color: #f0f7ff; /* สีฟ้านมพาสเทลอ่อน */
    --text-color: #1e293b; /* สีน้ำเงิน-เทาเข้ม */
    --light-grey: #e9ecef;
    --border-color: #ced4da;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 8px 30px rgba(0,0,0,0.08);
    --border-radius-lg: 16px;
    --border-radius-md: 8px;
}

body {
    font-family: 'Sarabun', sans-serif;
    color: var(--text-color);
    background: linear-gradient(135deg, #f0f7ff 0%, #e0f2fe 100%);
    background-attachment: fixed;
    min-height: 100vh;
    padding-bottom: 50px;
}

/* Glassmorphism Container */
.form-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    padding: 40px;
    margin-top: 30px;
    margin-bottom: 30px;
}

/* Header Section */
.coop-header {
    border-bottom: 2px double var(--primary-color);
    padding-bottom: 20px;
    margin-bottom: 35px;
}

.coop-logo {
    width: 90px;
    height: 90px;
    margin: 0 auto 15px;
    background: #fff;
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    color: var(--primary-color);
}

.coop-logo svg {
    width: 50px;
    height: 50px;
}

.coop-title {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 26px;
    letter-spacing: 0.5px;
}

/* Sub-card styling */
.info-section {
    background-color: var(--accent-color);
    border-left: 5px solid var(--primary-color);
    border-radius: var(--border-radius-md);
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
}

/* Form request items */
.request-item {
    padding: 18px;
    border: 1px solid var(--light-grey);
    border-radius: var(--border-radius-md);
    margin-bottom: 15px;
    background: #ffffff;
    transition: all 0.25s ease;
}

.request-item:hover {
    box-shadow: 0 4px 12px rgba(30, 102, 189, 0.08);
    border-color: rgba(30, 102, 189, 0.25);
    transform: translateY(-2px);
}

.request-item.active {
    border-left: 4px solid var(--primary-color);
    background-color: #f0f9ff;
}

.request-item.disabled {
    opacity: 0.65;
    background-color: #fafafa;
}

.request-item.disabled input:not(.item-checkbox),
.request-item.disabled select,
.request-item.disabled textarea {
    background-color: #f1f3f5;
    pointer-events: none;
    border-color: #dee2e6;
}

.item-checkbox {
    pointer-events: auto !important;
    cursor: pointer !important;
    position: relative;
    z-index: 2;
}

/* Label & Checkbox styling */
.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.item-number {
    display: inline-block;
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-size: 13px;
    font-weight: bold;
    margin-right: 8px;
}

/* Inputs styled elegantly */
.form-control-inline {
    display: inline-block;
    width: auto;
    border: none;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
    padding: 2px 8px;
    margin: 0 5px;
    background-color: transparent;
    transition: border-color 0.15s ease-in-out;
}

.form-control-inline:focus {
    outline: none;
    border-bottom: 2px solid var(--primary-color);
    box-shadow: none;
}

/* Table Style for Statement, etc. */
.dotted-text {
    border-bottom: 1px dotted #888;
    padding-bottom: 2px;
}

/* Admin Dashboard CSS */
.admin-card {
    border: none;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    transition: transform 0.2s ease;
}

.admin-card:hover {
    transform: translateY(-3px);
}

.bg-emerald {
    background-color: var(--primary-color) !important;
    color: #fff;
}

.text-emerald {
    color: var(--primary-color) !important;
}

.btn-emerald {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%) !important;
    border: none !important;
    color: white !important;
    transition: all 0.25s ease !important;
}

.btn-emerald:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 15px rgba(30, 102, 189, 0.3) !important;
    color: white !important;
}

/* Selective text-success override for visual cohesion */
.info-section .text-success,
.form-floating .text-success,
.navbar .text-success,
.dropdown-menu .text-success,
.table .text-success,
.alert .text-success {
    color: var(--primary-color) !important;
}

.badge-pending {
    background-color: #ffc107;
    color: #000;
}

.badge-approved {
    background-color: #198754;
    color: #fff;
}

.badge-rejected {
    background-color: #dc3545;
    color: #fff;
}

/* SIGNATURE AREA IN WEB VIEW */
.signature-box {
    margin-top: 40px;
    border: 1px dashed var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 25px;
    background-color: #fff;
}

/* ========================================================
   PRINT VIEW - FOR PRINTING PHYSICAL FORM ON A4 PAPER
   ======================================================== */
@media print {
    @page {
        size: A4;
        margin: 10mm 15mm 10mm 15mm;
    }
    
    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 14px !important;
        line-height: 1.4 !important;
        font-family: 'Sarabun', 'TH Sarabun PSK', Arial, sans-serif !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* ซ่อนแถบเมนูนำทาง ปุ่มกด และองค์ประกอบเว็บไซต์ที่ไม่เกี่ยวข้อง */
    .no-print,
    .btn,
    .navbar,
    .alert,
    nav,
    footer,
    .no-print-badge {
        display: none !important;
    }
    
    /* ขยายความกว้างเต็มที่และลบความหรูหราออก */
    .container,
    .form-container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
    }
    
    .coop-header {
        border-bottom: 2px solid #000 !important;
        padding-bottom: 8px !important;
        margin-bottom: 20px !important;
    }
    
    .coop-logo {
        border: 2px solid #000 !important;
        width: 70px !important;
        height: 70px !important;
    }
    
    .coop-logo svg {
        width: 40px !important;
        height: 40px !important;
        fill: #000 !important;
    }
    
    .coop-title {
        color: #000000 !important;
        font-size: 20px !important;
    }
    
    .info-section {
        background-color: transparent !important;
        border: none !important;
        border-bottom: 1px dashed #000 !important;
        border-radius: 0 !important;
        padding: 0 !important;
        margin-bottom: 20px !important;
        box-shadow: none !important;
    }
    
    .request-item {
        background: transparent !important;
        border: none !important;
        padding: 5px 0 !important;
        margin-bottom: 5px !important;
        border-radius: 0 !important;
        transition: none !important;
        opacity: 1 !important;
    }
    
    .request-item:hover {
        box-shadow: none !important;
        transform: none !important;
    }
    
    /* แปลงอินพุตให้กลายเป็นเส้นประพิมพ์ */
    .form-control-inline {
        border: none !important;
        border-bottom: 1px dotted #000000 !important;
        padding: 0 !important;
        margin: 0 3px !important;
        width: auto !important;
        font-weight: 500 !important;
        color: #000000 !important;
    }
    
    /* ซ่อน Checkbox ที่ไม่ได้เลือก และให้แสดง Checkbox แบบกระดาษที่จัดเรียงเรียบร้อย */
    .form-check-input {
        border: 1px solid #000 !important;
        background-color: transparent !important;
    }
    
    .form-check-input:checked {
        background-color: #000 !important;
        border-color: #000 !important;
    }
    
    /* ตัวเลขข้อแบบไม่มีพื้นหลังสี */
    .item-number {
        background: transparent !important;
        color: #000000 !important;
        border: 1px solid #000 !important;
        width: 20px !important;
        height: 20px !important;
        line-height: 18px !important;
        font-size: 11px !important;
    }
    
    /* ลายเซ็นแบบกระดาษจริง */
    .signature-box {
        border: none !important;
        background: transparent !important;
        padding: 0 !important;
        margin-top: 30px !important;
    }
}
