/* ==========================================================================
   極光茶作 - 點餐機專用高質感樣式表 (CSS)
   ========================================================================== */

/* 全域 CSS 變數：精選極致質感茶金色系 */
:root {
    --bg-primary: #12100e;       /* 極深炭金黑 */
    --bg-card: rgba(26, 22, 19, 0.75); /* 半透明茶色玻璃 */
    --border-color: rgba(224, 169, 109, 0.15); /* 金絲線條 */
    --border-hover: rgba(224, 169, 109, 0.4);
    
    --primary: #e0a96d;          /* 暖陽茶金 */
    --primary-hover: #d49352;    /* 焦糖深金 */
    --primary-light: rgba(224, 169, 109, 0.1);
    
    --text-main: #f8f6f4;        /* 椰奶白 */
    --text-muted: #a69e97;       /* 烘焙燕麥灰 */
    
    --success: #10b981;          /* 靜謐抹茶綠 */
    --success-light: rgba(16, 185, 129, 0.15);
    --pending: #f59e0b;          /* 蜜漬琥珀黃 */
    --pending-light: rgba(245, 158, 11, 0.15);
    
    --font-primary: 'Noto Sans TC', 'Outfit', sans-serif;
    --transition-smooth: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    --border-radius-lg: 20px;
    --border-radius-md: 12px;
}

/* 基礎重設 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-main);
    font-family: var(--font-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    /* 背景漸變光暈特效 */
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(224, 169, 109, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.05) 0%, transparent 40%);
}

/* 主容器 */
.app-container {
    width: 100%;
    max-width: 1200px;
    min-height: 90vh;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* 頁首樣式 */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.logo-area {
    display: flex;
    flex-direction: column;
}

.brand-en {
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 5px;
    color: var(--primary);
    font-weight: 700;
}

.brand-title {
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 1px;
    background: linear-gradient(135deg, var(--text-main) 30%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.system-status {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 16px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    position: relative;
}

.status-indicator.online {
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.status-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* 主內容區佈局 */
.app-main {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 30px;
    align-items: start;
}

@media (max-width: 992px) {
    .app-main {
        grid-template-columns: 1fr;
    }
}

/* 毛玻璃卡片基底 */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transition: var(--transition-smooth);
}

.glass-card:hover {
    border-color: rgba(224, 169, 109, 0.25);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

/* 卡片頁首 */
.panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 15px;
}

.step-badge {
    font-family: 'Outfit', sans-serif;
    background: var(--primary);
    color: #12100e;
    font-weight: 800;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.step-badge.alt {
    background: var(--success);
    color: #ffffff;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

/* 表單群組 */
.form-group {
    margin-bottom: 25px;
}

.group-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: 500;
    position: relative;
    padding-left: 10px;
}

.group-label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 12px;
    background-color: var(--primary);
    border-radius: 2px;
}

/* 品項網格 (Drink Grid) */
.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

/* 選項按鈕通用樣式 */
.option-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    position: relative;
    outline: none;
}

.option-btn:hover {
    background: rgba(224, 169, 109, 0.05);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

/* 飲料卡片專用 */
.drink-btn {
    flex-direction: column;
    padding: 20px 15px;
    gap: 8px;
    text-align: center;
}

.drink-btn .option-icon {
    font-size: 2rem;
    margin-bottom: 5px;
    transition: transform 0.3s ease;
}

.drink-btn:hover .option-icon {
    transform: scale(1.15) rotate(5deg);
}

.drink-btn .option-name {
    font-size: 1rem;
    font-weight: 700;
}

.drink-btn .option-price {
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 600;
}

/* 列狀按鈕組 (冰塊與甜度) */
.options-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.sweetness-btn, .ice-btn {
    flex: 1 1 calc(20% - 10px);
    min-width: 80px;
    justify-content: center;
    padding: 12px 10px;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
}

/* 選中狀態（Magic class `selected`） */
.option-btn.selected {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 15px rgba(224, 169, 109, 0.15);
    font-weight: 700;
}

.option-btn.selected::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: bold;
}

/* 數量選擇器與送出區 */
.form-footer-action {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 20px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: 4px;
}

.qty-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-main);
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    justify-content: center;
    align-items: center;
}

.qty-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--primary);
}

.qty-display {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    width: 35px;
    text-align: center;
}

/* 送出訂單按鈕 */
.submit-btn {
    flex-grow: 1;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    border: none;
    border-radius: 30px;
    color: #12100e;
    font-size: 1.05rem;
    font-weight: 900;
    padding: 16px 20px;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 10px 20px rgba(224, 169, 109, 0.2);
    position: relative;
    overflow: hidden;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(224, 169, 109, 0.35);
}

.submit-btn:active {
    transform: translateY(1px);
}

.submit-btn .submit-loader {
    display: inline-block;
}

/* 看板排版 */
.orders-board {
    height: 100%;
}

.board-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 576px) {
    .board-columns {
        grid-template-columns: 1fr;
    }
}

.board-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.column-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 2px solid rgba(255, 255, 255, 0.03);
    padding-bottom: 8px;
}

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 450px;
    overflow-y: auto;
    padding-right: 5px;
}

/* 滾動條美化 */
.orders-list::-webkit-scrollbar {
    width: 4px;
}

.orders-list::-webkit-scrollbar-track {
    background: transparent;
}

.orders-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

/* 訂單卡片設計 */
.order-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: var(--transition-smooth);
}

.order-card:hover {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.04);
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-drink {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-main);
}

.order-qty {
    position: absolute;
    bottom: 15px;
    right: 15px;
    font-family: 'Outfit', sans-serif;
    background: var(--primary-light);
    border: 1px solid rgba(224, 169, 109, 0.15);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
}

.order-custom-details {
    display: flex;
    gap: 8px;
}

.custom-tag {
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.order-time {
    font-family: 'Outfit', sans-serif;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.25);
    margin-top: 5px;
}

/* 狀態徽章 */
.status-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
}

.status-badge.pending {
    background: var(--pending-light);
    color: var(--pending);
}

.status-badge.completed {
    background: var(--success-light);
    color: var(--success);
}

/* 空白狀態 */
.empty-state {
    text-align: center;
    padding: 40px 10px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.15);
    border: 1px dashed rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-md);
}

/* 頁尾 */
.app-footer {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    padding-top: 15px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.15);
}

/* 彈出提示 Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 18, 16, 0.9);
    border: 1px solid var(--primary);
    border-radius: 30px;
    color: var(--text-main);
    padding: 12px 28px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    transition: opacity 0.3s ease, transform 0.3s ease;
    backdrop-filter: blur(10px);
}

/* 輔助類別 */
.hidden {
    display: none !important;
}

/* 暱稱輸入框高級樣式 */
.nickname-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    color: var(--text-main);
    padding: 14px 18px;
    font-size: 0.95rem;
    font-family: var(--font-primary);
    outline: none;
    transition: var(--transition-smooth);
}

.nickname-input:focus {
    background: rgba(224, 169, 109, 0.05);
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(224, 169, 109, 0.15);
}

.nickname-input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

/* 訂單卡片中的暱稱標籤 */
.order-nickname {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-light);
    border: 1px solid rgba(224, 169, 109, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 6px;
    display: inline-block;
    vertical-align: middle;
}

.order-drink-text {
    vertical-align: middle;
}

/* 配料網格與按鈕樣式 */
.topping-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

@media (max-width: 576px) {
    .topping-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.topping-btn {
    padding: 12px 8px;
    font-size: 0.85rem;
    font-weight: 500;
    justify-content: center;
    text-align: center;
}

/* 訂單卡片中的配料綠色標籤 */
.topping-tag {
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--success-light);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* 動畫設定 */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
