/* 全域樣式重設 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', 'Noto Sans TC', sans-serif;
}

body {
    background: linear-gradient(135deg, #f3f7f4 0%, #e8efe9 100%);
    color: #2c3e50;
    min-height: 100vh;
    padding: 2rem 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 主容器 */
.app-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* 頁首樣式 */
.app-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.app-header .logo {
    font-size: 3.5rem;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
}

.app-header h1 {
    font-size: 2.5rem;
    color: #1f402b;
    font-weight: 800;
    margin-top: 0.5rem;
}

.app-header h1 span {
    font-weight: 300;
    color: #689f38;
}

.app-header p {
    color: #7f8c8d;
    font-size: 1.1rem;
    margin-top: 0.25rem;
}

/* 雙欄主排版 */
.main-content {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem;
    align-items: start;
}

/* 卡片基礎樣式 */
.card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(44, 94, 67, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.8);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 15px 35px rgba(44, 94, 67, 0.1);
}

h2 {
    font-size: 1.25rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    font-weight: 600;
}

h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: #689f38;
    margin-right: 8px;
    border-radius: 4px;
}

/* 飲料卡片選項 */
.drink-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.drink-card {
    background: #fafcfb;
    border: 2px solid #e1e9e3;
    border-radius: 16px;
    padding: 1.5rem 1rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.drink-card:hover {
    border-color: #a3c9ae;
    transform: translateY(-3px);
}

.drink-card.active {
    border-color: #1f402b;
    background: #eaf2eb;
}

.drink-emoji {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.drink-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f402b;
    margin-bottom: 0.25rem;
}

.drink-price {
    font-size: 0.95rem;
    font-weight: 600;
    color: #e67e22;
}

/* 選擇群組 (糖度與冰塊) */
.option-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.option-btn {
    flex: 1;
    min-width: 90px;
    background: #fafcfb;
    border: 1px solid #e1e9e3;
    color: #556b2f;
    padding: 0.75rem 0.5rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.option-btn:hover {
    background: #f0f5f1;
    border-color: #bdffd3;
}

.option-btn.active {
    background: #1f402b;
    color: #ffffff;
    border-color: #1f402b;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(31, 64, 43, 0.15);
}

/* 暱稱輸入框樣式 */
.input-group {
    margin-bottom: 2rem;
    width: 100%;
}

.nickname-input {
    width: 100%;
    background: #fafcfb;
    border: 2px solid #e1e9e3;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    font-size: 1rem;
    color: #1f402b;
    font-weight: 500;
    outline: none;
    transition: all 0.25s ease;
}

.nickname-input:focus {
    border-color: #1f402b;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(31, 64, 43, 0.08);
}

.nickname-input::placeholder {
    color: #bdc3c7;
}

/* 數量控制 */
.quantity-control {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.qty-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid #e1e9e3;
    background: #ffffff;
    font-size: 1.2rem;
    font-weight: 600;
    color: #1f402b;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.15s;
}

.qty-btn:hover {
    background: #eaf2eb;
    border-color: #1f402b;
}

.qty-btn:active {
    transform: scale(0.9);
}

.qty-display {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f402b;
    min-width: 30px;
    text-align: center;
}

/* 訂單預覽區 */
.order-summary-box {
    background: #f5f8f5;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid #689f38;
}

.summary-line {
    font-size: 0.95rem;
    color: #555;
}

.summary-line strong {
    color: #1f402b;
    font-weight: 700;
}

/* 送出訂單按鈕 */
.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #27ae60 0%, #1e8449 100%);
    color: white;
    border: none;
    padding: 1.2rem;
    font-size: 1.15rem;
    font-weight: 700;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.25);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.35);
}

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

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

/* 右側歷史紀錄面板 */
.records-panel {
    display: flex;
    flex-direction: column;
    max-height: 700px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.subtitle {
    font-size: 0.85rem;
    color: #95a5a6;
    margin-bottom: 1.5rem;
}

/* Live 指示燈 */
.live-indicator {
    background: #fbeee6;
    color: #e67e22;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.live-indicator::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #e67e22;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

/* 訂單清單列表 */
.orders-list {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-right: 0.5rem;
}

/* 滾動條美化 */
.orders-list::-webkit-scrollbar {
    width: 6px;
}
.orders-list::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.02);
    border-radius: 10px;
}
.orders-list::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
}

/* 單個訂單卡片 */
.order-item {
    background: #fafafa;
    border: 1px solid #eef2ef;
    padding: 1.2rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    animation: slideIn 0.4s ease-out;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-item:hover {
    background: #f4faf5;
    border-color: #a9dfbf;
    transform: scale(1.02);
}

.order-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.order-drink {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f402b;
}

.order-spec {
    font-size: 0.85rem;
    color: #7f8c8d;
    background: #eaeded;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    display: inline-block;
    width: fit-content;
}

.order-time {
    font-size: 0.75rem;
    color: #bdc3c7;
}

.order-qty-badge {
    background: #eaf2eb;
    color: #27ae60;
    font-weight: 700;
    padding: 0.4rem 0.8rem;
    border-radius: 30px;
    font-size: 0.9rem;
}

/* 狀態訊息 */
.loading-spinner, .no-orders {
    text-align: center;
    color: #95a5a6;
    padding: 3rem 0;
    font-size: 0.95rem;
}

/* 動畫定義 */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.5; }
}

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

/* 響應式排版 */
@media (max-width: 850px) {
    body {
        padding: 1rem;
    }
    .main-content {
        grid-template-columns: 1fr;
    }
    .records-panel {
        max-height: 500px;
    }
}
