/* ===== MAIN.CSS - CSS หลักของระบบ ===== */
/* Typography, Layout, Base Styles */

/* CSS Reset และ Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Import Google Fonts if not already loaded */
@import url('https://fonts.googleapis.com/css2?family=Sarabun:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800&display=swap');

body {
    font-family: 'Sarabun', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.5;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Sarabun', sans-serif;
    font-weight: 600;
    line-height: 1.3;
    color: #2c3e50;
}

p {
    font-family: 'Sarabun', sans-serif;
    line-height: 1.6;
    color: #34495e;
    font-weight: 400;
}

/* Better font rendering */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container และ Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Section */
.header {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.2);
}

.header h1 {
    color: #2c3e50;
    font-size: 1.3rem;
    margin-bottom: 10px;
    font-weight: 600;
    font-family: 'Sarabun', sans-serif;
}

.header .subtitle {
    color: #7f8c8d;
    font-size: 1rem;
    margin-bottom: 20px;
    font-family: 'Sarabun', sans-serif;
    font-weight: 400;
}

.period-info {
    /* background: linear-gradient(45deg, #3498db, #2980b9); */
    background-color: rgb(194, 194, 194);
    color: white;
    padding: 15px 25px;
    border-radius: 50px;
    display: inline-block;
    font-weight: 500;
    font-family: 'Sarabun', sans-serif;
    font-size: 0.95rem;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-tab {
    background: rgba(255,255,255,0.9);
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    color: #2c3e50;
}

.nav-tab.active {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(231,76,60,0.3);
}

.nav-tab:hover:not(.active) {
    background: rgba(255,255,255,1);
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Content Sections */
.content-section {
    display: none;
}

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

/* Form Container */
.form-container {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.3s ease;
}

.form-container:hover {
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

/* Step Containers */
.step-container {
    display: none;
}

.step-container.active {
    display: block;
}

/* Step Indicator */
.step-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
    gap: 20px;
}

.step {
    display: flex;
    align-items: center;
    gap: 10px;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ecf0f1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #7f8c8d;
    transition: all 0.3s ease;
}

.step.active .step-circle {
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
    transform: scale(1.1);
}

.step.completed .step-circle {
    background: linear-gradient(45deg, #27ae60, #2ecc71);
    color: white;
}

.step-line {
    width: 100px;
    height: 3px;
    background: #ecf0f1;
    transition: all 0.3s ease;
}

.step-line.completed {
    background: linear-gradient(45deg, #27ae60, #2ecc71);
}

/* Personal Info Grid */
.personal-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

/* Loading Styles */
.loading {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 99999 !important;
    background: white !important;
    padding: 40px 50px !important;
    border-radius: 20px !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3) !important;
    display: none !important;
    min-width: 400px !important;
    text-align: center !important;
}

.loading.show {
    display: block !important;
}

.loading-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0,0,0,0.8) !important;
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
    z-index: 99998 !important;
    display: none !important;
}

.loading-overlay.show {
    display: block !important;
}

body.loading-active {
    overflow: hidden !important;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading p {
    margin: 0;
    color: #2c3e50;
    font-weight: 600;
    font-size: 1.1rem;
    line-height: 1.4;
}

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

/* Alert Styles */
.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin: 20px 0;
    font-weight: 600;
    background: white;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-left: 5px solid;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    color: #27ae60;
    border-left-color: #27ae60;
}

.alert-error {
    color: #e74c3c;
    border-left-color: #e74c3c;
}

/* Progress Bar */
.progress-bar {
    background: #ecf0f1;
    border-radius: 10px;
    height: 10px;
    margin: 10px 0;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    height: 100%;
    border-radius: 10px;
    transition: width 0.8s ease;
}

/* Bilingual Text Styles */
.bilingual-text .text-thai {
    color: #2c3e50;
    font-weight: 600;
}

.bilingual-text .text-english {
    color: #4d4d4d;
    /* font-style: italic; */
    margin-top: 2px;
}

.stat-label .text-thai {
    color: white;
    font-weight: 600;
}

.stat-label .text-english {
    color: rgba(255,255,255,0.8);
    /* font-style: italic; */
}

/* Enhanced Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-container {
    animation: fadeInUp 0.6s ease-out;
}

/* Improved Button Styles */
.btn {
    transition: all 0.3s ease;
    border: none;
    border-radius: 25px;
    padding: 12px 25px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.btn-primary {
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(45deg, #2980b9, #1abc9c);
}

.btn-secondary {
    background: linear-gradient(45deg, #95a5a6, #7f8c8d);
    color: white;
}

.btn-success {
    background: linear-gradient(45deg, #27ae60, #2ecc71);
    color: white;
}