/* 全域樣式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Microsoft JhengHei', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f8f8;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h1, h2, h3 {
    margin-bottom: 20px;
    color: #333;
}

h1 {
    font-size: 28px;
    border-bottom: 2px solid #d9534f;
    padding-bottom: 10px;
}

h2 {
    font-size: 22px;
}

h3 {
    font-size: 18px;
}

/* 表單樣式 */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.form-row .form-group {
    padding: 0 10px;
    flex: 1;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.radio-group {
    display: flex;
    gap: 20px;
}

.radio-group input[type="radio"] {
    margin-right: 5px;
}

.lunar-birthday {
    display: flex;
    gap: 10px;
}

.lunar-birthday input {
    flex: 1;
}

.lunar-birthday label {
    display: block;
    margin-bottom: 5px; /* 可選：添加下方間距 */
}

/* 按鈕樣式 */
.button-group {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

.btn-primary,
.btn-secondary,
.btn-error {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
}

.btn-primary {
    background-color: #d9534f;
    color: white;
}

.btn-primary:hover {
    background-color: #c9302c;
}

.btn-secondary {
    background-color: #5bc0de;
    color: white;
}

.btn-secondary:hover {
    background-color: #46b8da;
}

.btn-error {
    background-color: #d9534f;
    color: white;
}

.btn-error:hover {
    background-color: #c9302c;
}

/* 卡片樣式 */
.card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 30px;
}

/* 標籤樣式 */
.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.tab.active {
    border-bottom: 2px solid #d9534f;
    font-weight: bold;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 點燈者容器 */
.person-container {
    background-color: #f9838f;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
}

.person-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.remove-person {
    background-color: #d9534f;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}

/* 訊息樣式 */
.message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.success {
    background-color: #dff0d8;
    color: #3c763d;
    border: 1px solid #d6e9c6;
}

.error {
    background-color: #f2dede;
    color: #a94442;
    border: 1px solid #ebccd1;
}

/* 訂單詳情樣式 */
.order-detail, .person-detail {
    margin-bottom: 30px;
}

.detail-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.detail-table th, .detail-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.detail-table th {
    font-weight: bold;
    width: 150px;
}

/* 數據表格樣式 */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th, .data-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.data-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.data-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.data-table tr:hover {
    background-color: #f1f1f1;
}

/* 分頁導航 */
.pagination {
    margin-top: 20px;
    text-align: center;
}

.pagination a {
    display: inline-block;
    padding: 5px 10px;
    margin: 0 5px;
    text-decoration: none;
    border: 1px solid #ddd;
    color: #333;
}

.pagination a.active {
    background-color: #d9534f;
    color: white;
    border: 1px solid #d9534f;
}

/* 後台登入頁面 */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 30px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.login-container h1 {
    text-align: center;
    margin-bottom: 30px;
}

.order-summary {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f8f8;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.total-amount-container {
    font-size: 1.2em;
    text-align: right;
    font-weight: bold;
}

.total-amount-container p {
    margin: 0;
}

#totalAmount {
    color: #e63946;
    font-size: 1.3em;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }
    
    .form-row .form-group {
        padding: 0;
    }
    
    .lunar-birthday {
        flex-wrap: wrap;
    }
    
    .lunar-birthday input {
        flex: 1 0 40%;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .button-group button, .button-group a {
        width: 100%;
        margin-bottom: 10px;
    }
}
