/* styles.css - ไฟล์สไตล์หลัก */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 15px;
    line-height: 1.3;
    font-size: 12px;
}

.container {
    max-width: 95vw;
    width: 95vw;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Header Styles */
/* Header Styles */
.header {
    background: #d4af37; /* ทองแบบหรู ๆ จะใช้ #ffd700 ก็ได้ */
    color: white;
    padding: 20px;
    text-align: center;
}


.header h1 {
    font-size: 1.8em;
    margin-bottom: 6px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.header p {
    font-size: 0.9em;
    opacity: 0.9;
    margin-bottom: 3px;
}

/* Form Container */
.form-container {
    padding: 20px;
}

/* Form Sections - Accordion Style */
.accordion-section {
    margin-bottom: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
}

.accordion-section:hover {
    border-color: #4ecdc4;
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.1);
}

.accordion-header {
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    color: white;
    padding: 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    user-select: none;
}

.accordion-header:hover {
    background: linear-gradient(135deg, #45b7b8, #3d8b87);
}

.accordion-header h3 {
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
}

.accordion-icon {
    font-size: 1.8em;
    font-weight: bold;
    transition: transform 0.3s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

.accordion-section.active .accordion-icon {
    transform: rotate(45deg);
    background: rgba(255, 255, 255, 0.3);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out;
    background: #f8f9fa;
}

.accordion-section.active .accordion-content {
    max-height: 5000px; /*  max-height: 3000px; เพิ่มความสูงให้เพียงพอ */
    transition: max-height 0.7s ease-in;
}

.accordion-content > div {
    padding: 15px;
}

/* ปรับ Member Section ใน Accordion */
.accordion-content .member-section {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
	overflow:hidden;
}

.accordion-content .member-section:hover {
    border-color: #4ecdc4;
    box-shadow: 0 2px 10px rgba(78, 205, 196, 0.1);
}

/* สำหรับ Member Section ปกติ (ถ้ายังมี) */
.form-section {
    margin-bottom: 40px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 5px solid #4ecdc4;
}

.form-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.4em;
    display: flex;
    align-items: center;
}

/* Animation สำหรับ Accordion */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(78, 205, 196, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(78, 205, 196, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(78, 205, 196, 0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.accordion-section.active .accordion-content > div {
    animation: slideDown 0.4s ease-out;
}

.accordion-section {
    animation: fadeInUp 0.6s ease-out;
}

.accordion-section:nth-child(1) { animation-delay: 0.1s; }
.accordion-section:nth-child(2) { animation-delay: 0.2s; }
.accordion-section:nth-child(3) { animation-delay: 0.3s; }
.accordion-section:nth-child(4) { animation-delay: 0.4s; }

.submit-btn:hover {
    animation: pulse 1.5s infinite;
}

/* เพิ่ม Visual Feedback */
.accordion-header:active {
    transform: scale(0.98);
}

.member-section {
    position: relative;
    overflow: hidden;
}

.member-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.member-section:hover::before {
    left: 100%;
}

/* Loading State */
.form-container.loading {
    opacity: 0.7;
    pointer-events: none;
}

.form-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4ecdc4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #4ecdc4;
    box-shadow: 0 0 10px rgba(78, 205, 196, 0.2);
    outline: none;
}


/* Help text */
.help-text {
    font-size: 0.7em;
    color: #7f8c8d;
    margin-top: 2px;
}

.error-text {
    font-size: 0.7em;
    color: #e74c3c;
    margin-top: 2px;
}

/* Form Rows */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* Member Sections */
.member-section {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    background: white;
    transition: all 0.3s ease;
}

.member-section:hover {
    border-color: #4ecdc4;
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.1);
}

.member-section h4 {
    color: #e74c3c;
    margin-bottom: 15px;
    font-size: 1.1em;
    padding-bottom: 10px;
    border-bottom: 2px solid #e74c3c;
}

.reserve-member {
    border-color: #f39c12;
}

.reserve-member h4 {
    color: #f39c12;
    border-bottom-color: #f39c12;
}

/* File Input Styling */
.file-input-wrapper {
    position: relative;
    display: inline-block;
    cursor: pointer;
    width: 100%;
}

.file-input-wrapper input[type=file] {
    position: absolute;
    left: -9999px;
}

.file-input-display {
    display: inline-block;
    padding: 6px 8px;
    background: #3498db;
    color: white;
    border-radius: 4px;
    text-align: center;
    width: 100%;
    transition: background 0.3s ease;
    cursor: pointer;
    font-size: 0.8em;
}

.file-input-display:hover {
    background: #2980b9;
}

/* Buttons */
.submit-btn {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    color: white;
    padding: 15px 40px;
    border: none;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 10px;
    text-decoration: none;
    display: inline-block;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.dashboard-btn {
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    color: white;
    padding: 15px 40px;
    border: none;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.dashboard-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Form Actions */
.form-actions {
    text-align: center;
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}

.form-actions .submit-btn {
    font-size: 1em;
    padding: 10px 25px;
    margin: 0;
}

.form-actions .dashboard-btn {
    font-size: 0.8em;
    padding: 6px 18px;
    margin: 0;
}

/* Alert Messages */
.alert {
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 10px;
    font-weight: 500;
    font-size: 0.85em;
}

.alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

/* Required Field Indicator */
label:after {
    content: "";
}

label[for*="required"]:after,
.form-group label:has(+ input[required]):after {
    content: " *";
    color: #e74c3c;
    font-weight: bold;
}

/* Loading Animation */
.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.loading.show {
    display: block;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        border-radius: 10px;
    }
    
    .header {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .form-container {
        padding: 20px;
    }
    
    .accordion-section {
        margin-bottom: 15px;
    }
    
    .accordion-header {
        padding: 15px;
    }
    
    .accordion-header h3 {
        font-size: 1.1em;
    }
    
    .accordion-icon {
        font-size: 1.5em;
        width: 25px;
        height: 25px;
    }
    
    .accordion-content > div {
        padding: 15px;
    }
    
    .form-section {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .member-section {
        padding: 15px;
    }
    
    .submit-btn,
    .dashboard-btn {
        width: 100%;
        margin-bottom: 10px;
        margin-right: 0;
        padding: 12px 20px;
        font-size: 1em;
    }
    
    .form-actions {
        text-align: center;
    }

}

@media (max-width: 480px) {
	
    .header h1 {
        font-size: 1.5em;
    }
    
    .header p {
        font-size: 1em;
    }
    
    .accordion-header h3 {
        font-size: 1em;
    }
    
    .accordion-header {
        padding: 12px;
    }
    
    .accordion-content > div {
        padding: 12px;
    }
    
    .member-section h4 {
        font-size: 1em;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .accordion-icon {
        font-size: 1.3em;
        width: 22px;
        height: 22px;
    }
    /* ===== MODERN GAMING FONT ===== */


}