/**
 * ไฟล์ style.css
 * ตกแต่งหน้าเว็บไซต์ทั้งหมด
 */

/* ========== Reset และ Base Styles ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ตั้งค่า Body */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
}

html {
    scroll-behavior: smooth;
}

/* Container สำหรับจัดวาง content */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== Navbar ========== */
.navbar {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-header h1 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-header h1 i {
    color: #3498db;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    font-size: smaller;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: #3498db;
    background-color: rgba(52, 152, 219, 0.2);
}

/* ========== Banner ========== */
.banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 2rem;
    text-align: center;
}

.banner-content h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.banner-content p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
}

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-success:hover {
    background-color: #229954;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

/* ========== Main Content ========== */
.main-content {
    min-height: calc(100vh - 200px);
}

/* ========== Info Section ========== */
.info-section,
.requirements-section,
.contact-section {
    padding: 3rem 2rem;
    background-color: white;
    margin: 2rem 0;
    border-radius: 8px;
}

.info-section h3,
.requirements-section h3,
.contact-section h3 {
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    color: #2c3e50;
}

/* ========== Info Cards ========== */
.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.info-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.info-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.info-card i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.info-card h4 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.info-card p {
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ========== Requirements List ========== */
.requirements-list {
    list-style: none;
    padding: 0;
}

.requirements-list li {
    padding: 0.8rem;
    padding-left: 2rem;
    position: relative;
    margin-bottom: 0.5rem;
    background-color: #ecf0f1;
    border-radius: 4px;
}

.requirements-list li:before {
    content: "✓";
    position: absolute;
    left: 10px;
    color: #27ae60;
    font-weight: bold;
    font-size: 1.2rem;
}

/* ========== Contact Section ========== */
.contact-section {
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.contact-section p {
    margin: 0.5rem 0;
    font-size: 1.1rem;
}

.contact-section a {
    color: #ffeb3b;
    text-decoration: none;
}

.contact-section a:hover {
    text-decoration: underline;
}

/* ========== Form Styles ========== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-container {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    max-width: 600px;
    margin: 2rem auto;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.form-container h2 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
    text-align: center;
}

/* ========== Table Styles ========== */
.table-container {
    overflow-x: auto;
    margin: 2rem 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

table thead {
    background-color: #2c3e50;
    color: white;
}

table th {
    padding: 1rem;
    text-align: left;
    font-weight: bold;
}

table td {
    padding: 1rem;
    border-bottom: 1px solid #ecf0f1;
}

table tbody tr:hover {
    background-color: #f8f9fa;
}

/* ========== Alert Messages ========== */
.alert {
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
    border-left: 4px solid;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-color: #27ae60;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #e74c3c;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-color: #f39c12;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-color: #3498db;
}

/* ========== Status Badge ========== */
.badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
}

.badge-pending {
    background-color: #fff3cd;
    color: #856404;
}

.badge-approved {
    background-color: #d4edda;
    color: #155724;
}

.badge-rejected {
    background-color: #f8d7da;
    color: #721c24;
}

.badge-processing {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* ========== Footer ========== */
.footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 2rem;
}

.footer p {
    margin: 0;
}

/* ========== Responsive Design ========== */
@media (max-width: 768px) {
    .nav-menu {
        gap: 1rem;
        flex-wrap: wrap;
    }

    .banner-content h2 {
        font-size: 2rem;
    }

    .banner-content p {
        font-size: 1rem;
    }

    .info-cards {
        grid-template-columns: 1fr;
    }

    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-menu {
        width: 100%;
        justify-content: center;
        font-size: smaller;
    }

    table {
        font-size: 0.9rem;
    }

    table th,
    table td {
        padding: 0.5rem;
    }
}

/* ========== Dashboard Styles ========== */
.dashboard-container {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    margin: 2rem 0;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #ecf0f1;
}

.dashboard-header h2 {
    color: #2c3e50;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

.stat-card h4 {
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.stat-card p {
    font-size: 2rem;
    font-weight: bold;
}

/* ========== Modal Styles ========== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #ecf0f1;
}

.modal-header h2 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #7f8c8d;
}

.modal-close:hover {
    color: #2c3e50;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #ecf0f1;
}

/* ========== Loading Spinner ========== */
.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========== Utility Classes ========== */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.hidden {
    display: none !important;
}

.d-flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }