/* ==========================================
   微風茶香 - 智能點餐機 全域樣式表
   設計風格：清新現代暖茶風、玻璃微光澤、平滑微動畫
   語言規範：全繁體中文註解
   ========================================== */

/* 宣告全域 CSS 變數，方便統一管理配色 */
:root {
    --primary-color: #2e7d32;       /* 主色：茶葉深綠色 */
    --primary-light: #e8f5e9;       /* 淺綠底色 */
    --accent-color: #d84315;        /* 強調色：熟成橘紅色 */
    --accent-light: #fbe9e7;       /* 淺橘底色 */
    --text-main: #263238;           /* 主要字型顏色：深灰 */
    --text-sub: #546e7a;            /* 次要字型顏色：藍灰 */
    --bg-app: linear-gradient(135deg, #f4f6f4 0%, #eef2f3 100%); /* 漸層背景 */
    --card-bg: #ffffff;             /* 卡片背景色 */
    --border-color: #cfd8dc;        /* 邊框顏色 */
    --shadow-sm: 0 4px 6px rgba(0,0,0,0.05);
    --shadow-md: 0 8px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 30px rgba(46, 125, 50, 0.15);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 基本重設與字型設定 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Noto Sans TC', 'Outfit', sans-serif;
    background: var(--bg-app);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* 應用程式主容器 */
.app-container {
    width: 100%;
    max-width: 1200px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* 頂部頁首樣式 */
.app-header {
    background: linear-gradient(90deg, var(--primary-color) 0%, #1b5e20 100%);
    color: #ffffff;
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.logo {
    display: flex;
    align-items: center;
    gap: 16px;
}

.icon-logo {
    font-size: 2.2rem;
    color: #a5d6a7;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    animation: pulse 2s infinite ease-in-out;
}

.logo-text h1 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.logo-text span {
    font-size: 0.85rem;
    color: #c8e6c9;
    font-weight: 300;
}

.header-status {
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(5px);
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #69f0ae;
    border-radius: 50%;
    box-shadow: 0 0 8px #69f0ae;
    animation: blink 1.5s infinite;
}

/* 主要排版版面 */
.main-content {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 32px;
    padding: 32px;
    min-height: 600px;
}

@media (max-width: 992px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 20px;
    }
}

/* 區塊標題設計 */
.section-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-color);
}

.section-title i {
    font-size: 1.4rem;
}

/* --- 左側：點餐區樣式 --- */
.order-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* 飲料卡片網格 */
.drink-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

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

.drink-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.drink-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent-color);
    color: #ffffff;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 50px;
    font-weight: 500;
}

.drink-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
    transition: var(--transition);
}

/* 不同茶飲圖示配色 */
.black-tea { color: #8d6e63; }
.green-tea { color: #81c784; }
.milk-tea { color: #bcaaa4; }

.drink-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
}

.drink-desc {
    font-size: 0.75rem;
    color: var(--text-sub);
}

.price {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary-color);
    font-family: 'Outfit', sans-serif;
    margin-top: auto;
}

/* 卡片啟用與懸停狀態 */
.drink-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.drink-card.active {
    border-color: var(--primary-color);
    background: var(--primary-light);
    box-shadow: var(--shadow-lg);
}

.drink-card.active .drink-icon {
    transform: scale(1.15) rotate(5deg);
}

/* 客製化調整面板 */
.custom-panel {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.panel-subtitle {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.option-group, .qty-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-sub);
    display: flex;
    align-items: center;
    gap: 6px;
}

.option-label i {
    color: var(--primary-color);
}

/* 暱稱輸入框樣式 */
.nickname-field {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-main);
    background-color: #fafafa;
    transition: var(--transition);
    outline: none;
}

.nickname-field:focus {
    border-color: var(--primary-color);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.15);
}

/* 選項按鈕組 */
.option-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.opt-btn {
    background: #f5f5f5;
    border: 1px solid var(--border-color);
    padding: 10px 6px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.opt-btn:hover {
    background: #eeeeee;
    border-color: var(--text-sub);
}

.opt-btn.active {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(46, 125, 50, 0.3);
}

/* 數量計數器 */
.qty-counter {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #f5f5f5;
    width: fit-content;
    padding: 6px;
    border-radius: 50px;
    border: 1px solid var(--border-color);
}

.qty-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #ffffff;
    color: var(--text-main);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.qty-btn:hover {
    background: var(--primary-color);
    color: #ffffff;
}

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

/* 送出點單按鈕 */
.submit-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1b5e20 100%);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    padding: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    box-shadow: 0 6px 15px rgba(46, 125, 50, 0.4);
    transition: var(--transition);
    margin-top: 10px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(46, 125, 50, 0.5);
    filter: brightness(1.1);
}

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

.submit-btn:disabled {
    background: #b0bec5;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* --- 右側：最新點單看板樣式 --- */
.board-section {
    display: flex;
    flex-direction: column;
    background: #fafafa;
    border-left: 1px solid var(--border-color);
    padding-left: 32px;
}

@media (max-width: 992px) {
    .board-section {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid var(--border-color);
        padding-top: 24px;
    }
}

.board-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.board-header .section-title {
    margin-bottom: 0;
}

/* 重新整理按鈕 */
.refresh-btn {
    background: #ffffff;
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    color: var(--text-sub);
}

.refresh-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: rotate(180deg);
}

/* 訂單清單外容器 */
.order-list-container {
    flex: 1;
    min-height: 400px;
    max-height: 520px;
    overflow-y: auto;
    padding-right: 8px;
}

/* 客製滾動條 */
.order-list-container::-webkit-scrollbar {
    width: 6px;
}
.order-list-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}
.order-list-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}
.order-list-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-sub);
}

/* 看板狀態訊息 */
.list-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    height: 300px;
    color: var(--text-sub);
    text-align: center;
}

.list-message i {
    font-size: 2.5rem;
}

.hidden {
    display: none !important;
}

/* 訂單卡片清單 */
.order-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 單張訂單卡片 */
.order-item-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--primary-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
    animation: slideIn 0.3s ease-out;
}

.order-item-card:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.order-item-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.order-item-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.order-nickname {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-color);
    background: var(--accent-light);
    padding: 2px 8px;
    border-radius: 4px;
}

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

.order-qty {
    background: var(--primary-light);
    color: var(--primary-color);
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

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

.tag {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 50px;
    font-weight: 500;
}

.tag-sugar {
    background: var(--accent-light);
    color: var(--accent-color);
}

.tag-ice {
    background: #e1f5fe;
    color: #0288d1;
}

.order-time {
    font-size: 0.7rem;
    color: var(--text-sub);
}

.order-item-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

/* 狀態徽章 */
.status-badge {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 50px;
    font-weight: 600;
}

.status-badge.pending {
    background: #fff8e1;
    color: #ffb300;
}

.status-badge.completed {
    background: #e8f5e9;
    color: #4caf50;
}

/* --- 頁尾樣式 --- */
.app-footer {
    background: #f5f5f5;
    border-top: 1px solid var(--border-color);
    padding: 16px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-sub);
}

/* --- 動畫效果 --- */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes blink {
    0% { opacity: 0.4; }
    50% { opacity: 1; }
    100% { opacity: 0.4; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
