@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700&display=swap');

:root {
    --gov-blue: #00308F; /* Royal Blue */
    --gov-gold: #C5A059; /* Thai Gold */
    --gov-light: #F8F9FA;
    --gov-dark: #1A1A1A;
    --text-main: #333333;
    --text-muted: #666666;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --radius: 4px; /* More square/formal */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Sarabun', sans-serif;
}

body {
    min-height: 100vh;
    background: #f0f2f5;
    background-image: url('https://www.transparenttextures.com/patterns/cubes.png');
    color: var(--text-main);
    display: flex;
    flex-direction: column;
}

/* Official Header */
.gov-header {
    background: white;
    border-bottom: 4px solid var(--gov-gold);
    box-shadow: var(--shadow-md);
    padding: 1rem 0;
    width: 100%;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: 1.5rem;
}

.garuda-logo {
    width: 60px;
    height: auto;
}

.header-text h1 {
    font-size: 1.5rem;
    color: var(--gov-blue);
    font-weight: 700;
    line-height: 1.2;
}

.header-text p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Main Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    flex: 1;
}

/* Card Styles - Formal */
.card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

.card-header {
    border-bottom: 2px solid var(--gov-blue);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 1.25rem;
    color: var(--gov-blue);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--gov-blue);
    box-shadow: 0 0 0 3px rgba(0, 48, 143, 0.1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--gov-blue);
    color: white;
}

.btn-primary:hover {
    background: #002266;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-success {
    background: #198754;
    color: white;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-warning {
    background: #ffc107;
    color: #000;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
}

/* Table - Formal */
.table-container {
    overflow-x: auto;
    border: 1px solid #e0e0e0;
    border-radius: var(--radius);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th {
    background: #f8f9fa;
    color: var(--gov-blue);
    font-weight: 600;
    text-align: left;
    padding: 1rem;
    border-bottom: 2px solid #dee2e6;
}

td {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    color: #495057;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background-color: #f8f9fa;
}

/* Status Badges */
.badge {
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 700;
    border-radius: 0.25rem;
    text-transform: uppercase;
}

.badge-active {
    background-color: #d1e7dd;
    color: #0f5132;
}

.badge-inactive {
    background-color: #f8d7da;
    color: #842029;
}

/* Footer */
.gov-footer {
    background: var(--gov-blue);
    color: white;
    padding: 1.5rem 0;
    margin-top: auto;
    text-align: center;
    font-size: 0.9rem;
}

.gov-footer a {
    color: var(--gov-gold);
    text-decoration: none;
}

/* Utilities */
.text-center { text-align: center; }
.mt-3 { margin-top: 1rem; }
.mb-3 { margin-bottom: 1rem; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fefefe;
    padding: 0;
    border: 1px solid #888;
    width: 90%;
    max-width: 600px;
    border-radius: var(--radius);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    animation: slideDown 0.3s ease-out;
}

.modal-header {
    padding: 1rem 1.5rem;
    background: var(--gov-blue);
    color: white;
    border-top-left-radius: var(--radius);
    border-top-right-radius: var(--radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 1.5rem;
}

.close {
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
}

@keyframes slideDown {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Result Box */
.result-box {
    background: #e7f1ff;
    border: 1px solid #b6d4fe;
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 1.5rem;
    display: none;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #b6d4fe;
}

.result-item:last-child {
    border-bottom: none;
}

.result-label {
    font-weight: 600;
    color: var(--gov-blue);
}

.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}
.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}
.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}
