/* Main CSS File - Global Styles */

/* Font Family */
@font-face {
    font-family: 'TH Sarabun New Bold';
    src: url('/font/TH Sarabun New Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

/* Global Font Settings */
* {
    font-family: 'TH Sarabun New Bold', 'Kanit', 'Sarabun', sans-serif;
    font-size: 23px; /* เพิ่มจาก 18px เป็น 23px */
}

body {
    font-family: 'TH Sarabun New Bold', 'Kanit', 'Sarabun', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    color: #333;
    font-size: 23px; /* เพิ่มจาก 18px เป็น 23px */
}

/* Common Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Common Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.4rem; /* เพิ่มจาก 1.2rem เป็น 1.4rem */
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'TH Sarabun New Bold', 'Kanit', 'Sarabun', sans-serif;
}

.btn-primary {
    background: linear-gradient(135deg, #14a1ab 0%, #fcb235 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(20, 161, 171, 0.3);
}

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

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

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

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
}

/* Common Card Styles */
.card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

/* Common Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
    font-family: 'TH Sarabun New Bold', 'Kanit', 'Sarabun', sans-serif;
    font-size: 1.4rem; /* เพิ่มจาก 1.2rem เป็น 1.4rem */
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1.5rem; /* เพิ่มจาก 1.3rem เป็น 1.5rem */
    font-family: 'TH Sarabun New Bold', 'Kanit', 'Sarabun', sans-serif;
    transition: all 0.3s ease;
    background: white;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #14a1ab;
    box-shadow: 0 0 0 3px rgba(20, 161, 171, 0.1);
}

/* Dropdown Styles */
.form-control.dropdown {
    position: relative;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

.form-control.dropdown:focus {
    border-color: #14a1ab;
    box-shadow: 0 0 0 3px rgba(20, 161, 171, 0.1);
}

/* Dropdown Hint */
.dropdown-hint {
    font-size: 1.3rem; /* เพิ่มจาก 1.1rem เป็น 1.3rem */
    color: #666;
    margin-top: 0.25rem;
    font-style: italic;
    font-family: 'TH Sarabun New Bold', 'Kanit', 'Sarabun', sans-serif;
}

/* File Upload */
.form-control[type="file"] {
    padding: 0.5rem;
    border: 2px dashed #e0e0e0;
    background: #f8f9fa;
    cursor: pointer;
}

.form-control[type="file"]:hover {
    border-color: #14a1ab;
    background: #f0f8ff;
}

.form-control[type="file"]:focus {
    border-color: #14a1ab;
    box-shadow: 0 0 0 3px rgba(20, 161, 171, 0.1);
}

/* Image Upload Styles */
.image-upload {
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #f8f9fa;
}

.image-upload:hover {
    border-color: #14a1ab;
    background: #f0f8ff;
}

.upload-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #666;
}

.upload-text {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1.5rem; /* เพิ่มจาก 1.3rem เป็น 1.5rem */
}

.upload-hint {
    font-size: 1.3rem; /* เพิ่มจาก 1.1rem เป็น 1.3rem */
    color: #666;
    font-style: italic;
}

/* Common Header Styles */
.page-header {
    background: white;
    padding: 1rem 2rem;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2.9rem; /* เพิ่มจาก 2.4rem เป็น 2.9rem */
    color: #14a1ab;
    margin: 0;
    font-weight: 600;
    font-family: 'TH Sarabun New Bold', 'Kanit', 'Sarabun', sans-serif;
}

.page-subtitle {
    color: #666;
    margin: 0.5rem 0 0 0;
    font-family: 'TH Sarabun New Bold', 'Kanit', 'Sarabun', sans-serif;
    font-size: 1.5rem; /* เพิ่มจาก 1.3rem เป็น 1.5rem */
}

.main-content {
    min-height: 100vh;
}

/* Section Styles */
.section-content {
    display: none;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.section-content.active {
    display: block;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
    font-size: 2.2rem;
    font-weight: 600;
    color: #14a1ab;
}

.section-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.5rem;
    color: #666;
}

.progress-bar {
    width: 100px;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #14a1ab 0%, #fcb235 100%);
    transition: width 0.3s ease;
}

/* Section Tabs */
.section-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.section-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 1.5rem;
    color: #666;
    position: relative;
}

.section-tab:hover {
    background: #e9ecef;
    border-color: #14a1ab;
    transform: translateY(-2px);
}

.section-tab.active {
    background: linear-gradient(135deg, #14a1ab 0%, #fcb235 100%);
    color: white;
    border-color: #14a1ab;
    box-shadow: 0 4px 15px rgba(20, 161, 171, 0.3);
}

.section-tab.completed {
    border-color: #28a745;
}

.progress-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.section-tab.completed .progress-badge {
    background: #28a745;
}

.section-tab.active .progress-badge {
    background: white;
    color: #14a1ab;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .page-header {
        padding: 1rem;
    }
    
    .page-title {
        font-size: 2.4rem; /* เพิ่มจาก 1.9rem เป็น 2.4rem */
    }
    
    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 1.3rem; /* เพิ่มจาก 1.1rem เป็น 1.3rem */
    }
    
    .section-tabs {
        flex-direction: column;
    }
    
    .section-tab {
        width: 100%;
        justify-content: center;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* Pagination Styles */
.pagination {
    margin-top: 2rem;
    text-align: center;
}

/* AJAX Pagination Loading */
.pagination-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #14a1ab;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error Message */
.pagination-error {
    margin: 1rem 0;
}

.error-message {
    background: #ffebee;
    border: 1px solid #f44336;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #c62828;
}

.error-message button {
    background: none;
    border: none;
    font-size: 2.2rem;
    cursor: pointer;
    color: #f44336;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-message button:hover {
    background: #f44336;
    color: white;
    border-radius: 50%;
}

/* Smooth scrolling for pagination */
html {
    scroll-behavior: smooth;
}



.pagination-info {
    margin-bottom: 1rem;
    color: #666;
    font-size: 1.6rem;
}

.pagination-links {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pagination-link {
    padding: 0.5rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    text-decoration: none;
    color: #666;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 40px;
    text-align: center;
}

.pagination-link:hover {
    background: #28a745;
    color: white;
    border-color: #28a745;
    text-decoration: none;
}

.pagination-link.active {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

@media (max-width: 768px) {
    .pagination-links {
        gap: 0.25rem;
    }
    
    .pagination-link {
        padding: 0.4rem 0.8rem;
        font-size: 1.6rem;
        min-width: 35px;
    }
} 