/* === 色彩變數設定 === */
:root {
    --bg-main: #120a2e;      /* 深紫背景 */
    --bg-card: #1f1440;      /* 卡片背景 */
    --neon-blue: #00f0ff;    /* 霓虹藍 */
    --neon-purple: #bc13fe;  /* 霓虹紫 */
    --shrimp-red: #FF4500;   /* 鮮蝦橘紅 (用於前台按鈕) */
    --neon-green: #39ff14;   /* 霓虹綠 (用於後台出菜按鈕) */
    
    /* 其他輔助用色 */
    --text-white: #ffffff;
    --text-gray: #b0a8d6;
}

/* === 全域重置與基礎設定 === */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-white);
    font-family: 'Noto Sans TC', sans-serif;
    min-height: 100vh;
    padding-bottom: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

input, select, button {
    font-family: inherit;
}

/* === SPA 單頁切換隱藏控制 === */
.hidden {
    display: none !important;
}

/* === 動畫效果定義 === */

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

.fade-in {
    animation: fadeIn 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes breatheLogo {
    0%, 100% { filter: drop-shadow(0 0 5px var(--neon-purple)) drop-shadow(0 0 10px var(--neon-purple)); transform: scale(1); }
    50% { filter: drop-shadow(0 0 15px var(--neon-blue)) drop-shadow(0 0 30px var(--neon-blue)); transform: scale(1.05); }
}

/* ================================== */
/* === 前台: 共同區塊 & 點餐表單 === */
/* ================================== */
header {
    text-align: center;
    padding: 2.5rem 1rem 1.5rem;
    width: 100%;
}

.logo {
    max-width: 120px;
    margin-bottom: 1.5rem;
    animation: breatheLogo 3s infinite ease-in-out;
}

header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--neon-blue);
    text-shadow: 0 0 15px var(--neon-blue);
    margin-bottom: 0.5rem;
}

header p {
    color: var(--text-gray);
    font-size: 1rem;
}

#orderingView {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 1rem;
}

#loginForm {
    width: 100%;
    max-width: 500px;
    background: var(--bg-card);
    padding: 2.5rem 1.5rem;
    border-radius: 20px;
    border: 1px solid rgba(188, 19, 254, 0.3);
    box-shadow: 0 0 25px rgba(188, 19, 254, 0.15);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--neon-blue);
    font-weight: 500;
    letter-spacing: 1px;
}

.form-group input, 
.form-group select {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(0, 240, 255, 0.3);
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-white);
    border-radius: 10px;
    outline: none;
    transition: all 0.3s ease;
}

.form-group input:focus, 
.form-group select:focus {
    border-color: var(--neon-blue);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
}

#startOrderBtn {
    width: 100%;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
    color: #fff;
    border: none;
    padding: 1.2rem;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    margin-top: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

#startOrderBtn:hover {
    box-shadow: 0 0 20px var(--neon-purple);
    transform: translateY(-2px);
}

/* ================================== */
/* === 前台: 菜單卡片與餐點控制 === */
/* ================================== */
#menuArea {
    width: 100%;
}

#menuArea h2 {
    color: var(--neon-purple);
    text-shadow: 0 0 15px var(--neon-purple);
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 2rem;
}

#menuGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.menu-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1rem;
    border: 1px solid transparent;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.menu-card:hover {
    transform: translateY(-8px);
    border-color: var(--neon-blue);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
}

.menu-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.menu-card .menu-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
}

.menu-card .menu-price {
    color: var(--neon-blue);
    font-weight: 700;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.qty-control {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.4);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    border: 1px solid rgba(255, 69, 0, 0.3);
}

.qty-control button {
    background: transparent;
    border: 2px solid var(--shrimp-red);
    color: var(--shrimp-red);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.qty-control button:hover {
    background: var(--shrimp-red);
    color: var(--text-white);
    box-shadow: 0 0 12px var(--shrimp-red);
}

.qty-control .qty-display {
    font-size: 1.2rem;
    font-weight: bold;
    min-width: 30px;
    text-align: center;
}

/* ================================== */
/* === 前台: 底部購物車 === */
/* ================================== */
#cartBar, .cart-sticky {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(18, 10, 46, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(188, 19, 254, 0.5);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.5);
}

.cart-info {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-white);
}

#totalPrice {
    color: var(--neon-blue);
    text-shadow: 0 0 10px var(--neon-blue);
    font-size: 1.8rem;
    margin-left: 0.5rem;
}

#submitOrderBtn {
    background: var(--shrimp-red);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(255, 69, 0, 0.6);
    transition: all 0.3s ease;
}

#submitOrderBtn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(255, 69, 0, 0.9);
}

/* ================================== */
/* === SPA 感謝頁面遮罩動畫 === */
/* ================================== */
.thank-you-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(18, 10, 46, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.thank-you-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.success-checkmark {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 4px solid var(--neon-blue);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 25px var(--neon-blue);
    margin-bottom: 2rem;
    position: relative;
}

.thank-you-overlay.show .success-checkmark::after {
    content: '';
    width: 25px;
    height: 45px;
    border: solid var(--neon-blue);
    border-width: 0 5px 5px 0;
    transform: rotate(45deg) translate(-5px, -10px);
    opacity: 0;
    animation: drawCheckmark 0.6s 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes drawCheckmark {
    0% { opacity: 0; transform: rotate(45deg) translate(-5px, -10px) scale(0.5); }
    100% { opacity: 1; transform: rotate(45deg) translate(-5px, -10px) scale(1); }
}

.thank-you-overlay h2 {
    color: var(--neon-blue);
    font-size: 2.2rem;
    text-shadow: 0 0 15px var(--neon-blue);
    margin-bottom: 0.5rem;
}

.thank-you-overlay p {
    color: var(--text-white);
    font-size: 1.2rem;
}

/* ================================== */
/* === 後台: 廚房接單系統專屬樣式 === */
/* ================================== */

#refreshBtn:hover {
    background: var(--neon-blue) !important;
    color: var(--bg-main) !important;
    box-shadow: 0 0 15px var(--neon-blue) !important;
}

/* 歸戶訂單卡片設計 */
.order-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid rgba(188, 19, 254, 0.3);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: all 0.3s ease;
}

.order-card:hover {
    border-color: var(--neon-purple);
    box-shadow: 0 0 20px rgba(188, 19, 254, 0.4);
    transform: translateY(-5px);
}

.order-card .customer-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--neon-blue);
    text-shadow: 0 0 8px var(--neon-blue);
    margin-bottom: 0.5rem;
}

.order-card .customer-info {
    color: var(--text-gray);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.order-card .divider {
    width: 100%;
    height: 1px;
    background: rgba(188, 19, 254, 0.4);
    margin: 1rem 0;
}

.order-card .item-list {
    list-style: none;
    width: 100%;
    margin-bottom: 2rem;
}

.order-card .item-list li {
    margin-bottom: 0.8rem;
    padding-left: 1rem;
    border-left: 3px solid var(--neon-blue);
    color: var(--text-white);
    font-size: 1.1rem;
}

/* 顯眼的綠色霓虹出菜完成按鈕 */
.kitchen-btn {
    margin-top: auto;
    width: 100%;
    background: transparent;
    color: var(--neon-green);
    border: 2px solid var(--neon-green);
    padding: 1rem;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    text-shadow: 0 0 5px var(--neon-green);
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.2), inset 0 0 5px rgba(57, 255, 20, 0.2);
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.kitchen-btn:hover {
    background: var(--neon-green);
    color: #000;
    text-shadow: none;
    box-shadow: 0 0 20px var(--neon-green), inset 0 0 10px var(--neon-green);
    transform: scale(1.02);
}
