/* css/style.css - Donation Theme Style */

/* 1. ตั้งค่าฟอนต์ */
@font-face {
    font-family: 'ThaiFont';
    src: url('../libs/fonts/Sarabun-Regular.ttf') format('truetype');
}

/* 2. ตัวแปรสีหลัก (แกะจากโค้ดบริจาค) */
:root {
    --primary-green: #00C16E;      /* สีเขียวสด (ปุ่ม/หัวข้อ) */
    --dark-green: #005c35;         /* สีเขียวเข้ม (ตัวหนังสือหัวข้อ) */
    --light-bg: rgb(185, 212, 189);           /* พื้นหลังหน้าเว็บ */
    --highlight-bg: #fffce0;       /* สีไฮไลท์เมื่อเลือก */
    --border-color: #d0eadf;       /* สีเส้นขอบ */
    --btn-shadow: #00a15e;         /* เงาปุ่มกดแบบ 3D */
    --error-color: #721c24;
    --error-bg: #f8d7da;
}

body {
    font-family: 'ThaiFont', sans-serif;
    background-color: var(--light-bg); /* พื้นหลังเขียวอ่อน */
    padding: 20px;
    color: #333;
    margin: 0;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

/* --- Header Style (แบบบริจาค) --- */
.dashboard-header {
    background: white;
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); /* เงาฟุ้งขึ้น */
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 6px solid var(--primary-green); /* ขอบบนสีเขียว */
}

.header-info h2 {
    margin: 0;
    color: var(--dark-green); /* ตัวหนังสือเขียวเข้ม */
    font-weight: 800; /* ตัวหนา */
}

.header-info p {
    margin: 5px 0 0;
    color: #666;
    font-size: 14px;
}

.btn-logout {
    background: #e74c3c;
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    transition: 0.3s;
    border: none;
    cursor: pointer;
    font-size: 14px;
    box-shadow: 0 4px #c0392b; /* ปุ่มแดงแบบมีมิติ */
}

.btn-logout:hover {
    background: #ff5e4d;
}
.btn-logout:active {
    transform: translateY(2px);
    box-shadow: 0 2px #c0392b;
}

/* --- Stats Cards --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    text-align: center;
    border: 2px solid var(--border-color); /* เพิ่มเส้นขอบ */
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary-green);
}

.stat-card h3 {
    margin: 0 0 10px;
    font-size: 32px;
    color: var(--primary-green);
    font-weight: 800;
}

.stat-card p {
    margin: 0;
    color: #666;
    font-weight: bold;
}

.stat-card.alert {
    border-color: #f5c6cb;
    background-color: #fff5f5;
}

.stat-card.alert h3 {
    color: #e74c3c;
}

/* --- Menu Grid --- */
.section-title {
    font-size: 20px;
    font-weight: bold;
    color: var(--dark-green);
    margin-bottom: 15px;
    border-left: 5px solid var(--primary-green);
    padding-left: 10px;
    margin-top: 30px;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.menu-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    text-decoration: none;
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 15px;
    transition: 0.3s;
    border: 2px solid var(--border-color); /* เส้นขอบเขียวอ่อน */
    position: relative;
}

.menu-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-green);
    background: #f0fff4;
}

.menu-icon {
    font-size: 40px;
}

.menu-info h4 {
    margin: 0 0 5px;
    font-size: 18px;
    color: var(--dark-green);
    font-weight: bold;
}

.menu-info span {
    font-size: 13px;
    color: #777;
}

.card-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #e74c3c;
    color: white;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: bold;
}

/* --- Form Elements (สำหรับ ops_form.php และอื่นๆ) --- */
.search-card, .section-card, .purpose-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    border: 1px solid #eee;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}
/* ทำให้เหมือน Card บริจาค */
.search-card {
    border-top: 6px solid var(--primary-green);
}

label {
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
    color: var(--dark-green); /* หัวข้อ Input สีเขียวเข้ม */
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="time"],
textarea,
select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color); /* ขอบเขียวอ่อน */
    border-radius: 8px;
    box-sizing: border-box;
    margin-bottom: 15px;
    transition: 0.3s;
    font-family: 'ThaiFont', sans-serif;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--primary-green);
    outline: none;
    background-color: #fff;
}

/* --- Buttons Style ใหม่ (แบบ 3D ตามต้นฉบับ) --- */
.btn-custom {
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.1s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 16px;
}

/* ปุ่มหลัก สีเขียว */
.btn-main {
    background-color: var(--primary-green);
    color: white;
    box-shadow: 0 4px var(--btn-shadow); /* เงาเขียวเข้ม */
}

.btn-main:hover {
    background-color: #00d67a;
    color: white;
}

.btn-main:active {
    transform: translateY(2px); /* กดยุบลง */
    box-shadow: 0 2px var(--btn-shadow);
}

/* ปุ่มกลับ/ยกเลิก */
.btn-back {
    background-color: #eee;
    color: #555;
    box-shadow: 0 4px #ccc;
}
.btn-back:hover { background-color: #ddd; color: #333; }
.btn-back:active { transform: translateY(2px); box-shadow: 0 2px #ccc; }

/* ปุ่มค้นหา */
.btn-search {
    background-color: var(--dark-green);
    color: white;
    box-shadow: 0 4px #003d23;
    width: 100%;
}
.btn-search:active { transform: translateY(2px); box-shadow: 0 2px #003d23; }

/* --- Table (ใช้ใน Dashboard) --- */
.table-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    border: 2px solid var(--border-color);
}
.table thead th {
    background-color: #f9fcfb;
    color: var(--dark-green);
    font-weight: bold;
    border-bottom: 2px solid var(--border-color);
    padding: 15px;
}
.table tbody td {
    padding: 15px;
    vertical-align: middle;
    border-bottom: 1px solid #eee;
}
.date-badge {
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    padding: 5px 10px;
    border-radius: 8px;
    color: var(--dark-green);
}

/* เพิ่มหรือแก้ไขใน soc3/css/style.css */

.form-group-row {
    display: flex; /* ใช้นظام Flexbox */
    gap: 20px;     /* ระยะห่างระหว่างช่อง */
}

/* ทำให้ช่องด้านใน (วันที่, เวลา) ขยายได้เท่าๆ กัน */
.form-group-row > div {
    flex: 1; 
    min-width: 150px; /* กำหนดความกว้างขั้นต่ำเผื่อไว้ */
}

/* จัดการ Input ให้เต็มความกว้าง */
.form-group-row input[type="date"],
.form-group-row input[type="time"] {
    width: 100%;
}

/* เพิ่มใน soc3/css/style.css */

.foreign-bg {
    background-color: #007bff; /* สีน้ำเงิน */
    color: #ffffff;
    /* หรือใช้สีตามธีมที่คุณต้องการ */
    border: 1px solid #0056b3;
}

.foreign-bg:hover {
    background-color: #0056b3;
}

/* เพิ่มใน css/style.css */

.module-group-container {
    /* ... โค้ดตามที่ให้ไว้ด้านบน ... */
}

/* สีสำหรับแต่ละกลุ่ม */
.group-ops .module-group-title { color: #2980b9 !important; } 
.group-ops { border-top: 3px solid #2980b9 !important; }

.group-civil .module-group-title { color: #2ecc71 !important; } 
.group-civil { border-top: 3px solid #2ecc71 !important; }

.group-ict .module-group-title { color: #3498db !important; } 
.group-ict { border-top: 3px solid #3498db !important; }

.group-expert .module-group-title { color: #9b59b6 !important; }
.group-expert { border-top: 3px solid #9b59b6 !important; }

.group-logistics .module-group-title { color: #e74c3c !important; }
.group-logistics { border-top: 3px solid #e74c3c !important; }