<?php
/**
 * Child Theme Theme functions and definitions
 *
 * @link https://developer.wordpress.org/themes/basics/theme-functions/
 *
 * @package Child Theme
 * @since 1.0.0
 */

/**
 * Define Constants
 */
define( 'CHILD_THEME_CHILD_THEME_VERSION', '1.0.0' );

/**
 * Enqueue styles
 */
function child_enqueue_styles() {

  wp_enqueue_style( 'child-theme-theme-css', get_stylesheet_directory_uri() . '/style.css', array('astra-theme-css'), CHILD_THEME_CHILD_THEME_VERSION, 'all' );

}

add_action( 'wp_enqueue_scripts', 'child_enqueue_styles', 15 );

// เรียกใช้ไฟล์ register.php เมื่อมีการ Submit ฟอร์ม
function register_new_user() {
  if ( isset( $_POST['submit'] ) ) {
    include_once( get_stylesheet_directory() . '/register.php' ); // เปลี่ยน path ให้ถูกต้อง
  }
}
add_action( 'init', 'register_new_user' );

form label {
    display: block;
    margin-top: 10px;
}

form input[type="radio"] {
    margin-right: 5px;
}

.site-title a,
.ast-site-identity a,
header .site-title a,
header .ast-site-title-wrap a {
    text-decoration: none !important;
}

.booking-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.booking-card {
    background: #fff;
    border-radius: 10px; /* ✅ เพิ่มขอบโค้งมน */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); /* ✅ เพิ่มเงา */
    padding: 20px;
    width: 100%;
    max-width: 100%;
}

.booking-header {
    display: flex;
    justify-content: space-between;
    align-items: center; /* ✅ ทำให้ status อยู่แนวเดียวกับชื่อบริการ */
    border-bottom: 1px solid #EE994E;
    padding-bottom: 10px;
    margin-bottom: 10px;
    gap: 10px; /* ✅ เพิ่มช่องว่างระหว่างชื่อกับสถานะ */
}

.service-name {
    font-size: 18px;
    font-weight: bold;
    white-space: nowrap; /* ✅ ป้องกันขึ้นบรรทัดใหม่ */
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0; /* ✅ เอา margin ที่อาจดัน status ลงมาออก */
    padding: 0; /* ✅ เอา padding ที่อาจเป็นปัญหาออก */
    flex-grow: 1; /* ✅ ให้ชื่อบริการใช้พื้นที่แค่พอดี ไม่ดัน status ออกไป */
}

.status {
    background: #0073e6;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    display: inline-block;
    min-width: 120px;
    text-align: center;
    white-space: nowrap; /* ✅ ป้องกันขึ้นบรรทัดใหม่ */
    flex-shrink: 0; /* ✅ ป้องกัน status หดตัวหรือถูกดันลง */
}