/* 基本スタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    padding-top: 80px; /* 固定合計表示のための上部余白 */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 固定合計表示（上部） */
.fixed-total {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 15px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 1000;
    border-bottom: 3px solid rgba(255,255,255,0.2);
}

/* PC用の固定合計表示調整 */
@media (min-width: 769px) {
    .fixed-total {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background: linear-gradient(45deg, #ff6b6b, #ee5a24);
        color: white;
        padding: 20px;
        text-align: center;
        box-shadow: 0 4px 20px rgba(0,0,0,0.3);
        z-index: 1000;
        border-bottom: 3px solid rgba(255,255,255,0.2);
    }
}

.total-amount {
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

#totalAmount {
    font-size: 1.8rem;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}


.total-with-tax {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-left: 10px;
}

.category-total-with-tax {
    font-size: 0.8rem;
    opacity: 0.9;
    margin-left: 5px;
}

/* ヘッダー */
header {
    text-align: center;
    margin-bottom: 20px;
    color: white;
}

header h1 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.notice {
    background: rgba(255,255,255,0.1);
    padding: 8px 15px;
    border-radius: 20px;
    margin-top: 10px;
    font-size: 0.9rem;
}

/* PC用ヘッダー調整 */
@media (min-width: 769px) {
    header {
        margin-bottom: 30px;
    }

    header h1 {
        font-size: 2.5rem;
        margin-bottom: 15px;
    }

    .notice {
        padding: 12px 20px;
        font-size: 1rem;
        margin-top: 15px;
    }
}

/* コントロールボタン */
.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tax-rate-control {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 20px;
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
}

.tax-rate-control label {
    white-space: nowrap;
}

.tax-rate-input {
    width: 60px;
    padding: 6px 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    touch-action: manipulation;
}

.tax-rate-input:focus {
    outline: none;
    border-color: #74b9ff;
    box-shadow: 0 0 5px rgba(116, 185, 255, 0.5);
    background: white;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    max-width: 120px;
    touch-action: manipulation;
}

.btn-primary {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
}

.btn-primary:active {
    transform: scale(0.95);
}

.btn-secondary {
    background: linear-gradient(45deg, #74b9ff, #0984e3);
    color: white;
}

.btn-secondary:active {
    transform: scale(0.95);
}

/* PC用ボタン調整 */
@media (min-width: 769px) {
    .controls {
        gap: 20px;
        margin-bottom: 30px;
    }

    .tax-rate-control {
        padding: 10px 20px;
        font-size: 1rem;
    }

    .tax-rate-input {
        width: 70px;
        padding: 8px 10px;
        font-size: 1rem;
    }

    .btn {
        padding: 15px 30px;
        font-size: 1rem;
        max-width: 150px;
        border-radius: 25px;
    }

    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(238, 90, 36, 0.4);
    }

    .btn-secondary:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(9, 132, 227, 0.4);
    }

    .btn-primary:active {
        transform: translateY(0);
    }

    .btn-secondary:active {
        transform: translateY(0);
    }
}

/* 合計金額表示（削除 - 固定表示に変更） */

/* メニューコンテナ */
.menu-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

/* PC用メニューコンテナ調整 */
@media (min-width: 769px) {
    .menu-container {
        padding: 30px;
        border-radius: 20px;
    }
}

#loadingMessage {
    text-align: center;
    font-size: 1.2rem;
    color: #636e72;
    padding: 40px;
}

/* 分類別メニュー */
.category-section {
    margin-bottom: 25px;
}

.category-header {
    background: linear-gradient(45deg, #fd79a8, #e84393);
    color: white;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 4px 15px rgba(232, 67, 147, 0.3);
    position: relative;
}

/* 分類ごとの合計金額表示 */
.category-total {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* PC用分類ヘッダー調整 */
@media (min-width: 769px) {
    .category-section {
        margin-bottom: 40px;
    }

    .category-header {
        padding: 15px 20px;
        border-radius: 10px;
        margin-bottom: 20px;
        font-size: 1.3rem;
    }

    .category-total {
        right: 20px;
        font-size: 1rem;
        padding: 3px 10px;
        border-radius: 15px;
    }

    .total-with-tax {
        font-size: 1.4rem;
    }

    .category-total-with-tax {
        font-size: 0.9rem;
    }
}

/* 分類別の色分け */
.category-その他 .category-header {
    background: linear-gradient(45deg, #a29bfe, #6c5ce7);
}

.category-肉串 .category-header {
    background: linear-gradient(45deg, #fd79a8, #e84393);
}

.category-海鮮串 .category-header {
    background: linear-gradient(45deg, #74b9ff, #0984e3);
}

.category-野菜串 .category-header {
    background: linear-gradient(45deg, #00b894, #00a085);
}

.category-他串 .category-header {
    background: linear-gradient(45deg, #fdcb6e, #e17055);
}

.category-甘串 .category-header {
    background: linear-gradient(45deg, #fd79a8, #e84393);
}

/* メニューテーブル */
.menu-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    font-size: 0.9rem;
}

.menu-table th {
    background: #f8f9fa;
    padding: 10px 8px;
    text-align: center;
    font-weight: bold;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    font-size: 0.85rem;
}

.menu-table td {
    padding: 12px 8px;
    text-align: center;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

.menu-table tr:hover {
    background: #f8f9fa;
}

.menu-table tr:last-child td {
    border-bottom: none;
}

/* PC用テーブル調整 */
@media (min-width: 769px) {
    .menu-table {
        margin-bottom: 20px;
        border-radius: 10px;
        font-size: 1rem;
    }

    .menu-table th {
        padding: 15px 10px;
        font-size: 1rem;
    }

    .menu-table td {
        padding: 15px 10px;
    }
}

/* メニュー項目のスタイル */
.item-number {
    font-weight: bold;
    color: #6c757d;
    width: 40px;
    font-size: 0.8rem;
}

.item-name {
    text-align: left;
    font-weight: 500;
    color: #2d3436;
    padding-left: 10px;
    font-size: 0.85rem;
}

.item-price {
    font-weight: bold;
    color: #e17055;
    width: 70px;
    font-size: 0.85rem;
}

.item-price-with-tax {
    font-weight: bold;
    color: #00b894;
    width: 80px;
    font-size: 0.85rem;
}

.price-input {
    width: 60px;
    padding: 4px;
    border: 2px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
    color: #e17055;
    font-size: 0.8rem;
    touch-action: manipulation;
}

.price-input:focus {
    outline: none;
    border-color: #74b9ff;
    box-shadow: 0 0 5px rgba(116, 185, 255, 0.3);
}

.quantity-select {
    padding: 6px 8px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 60px;
    touch-action: manipulation;
}

.quantity-select:focus {
    outline: none;
    border-color: #74b9ff;
    box-shadow: 0 0 5px rgba(116, 185, 255, 0.3);
}

.quantity-select:hover {
    border-color: #74b9ff;
}

/* PC用メニュー項目調整 */
@media (min-width: 769px) {
    .item-number {
        width: 60px;
        font-size: 1rem;
    }

    .item-name {
        padding-left: 15px;
        font-size: 1rem;
    }

    .item-price {
        width: 100px;
        font-size: 1rem;
    }

    .item-price-with-tax {
        width: 120px;
        font-size: 1rem;
    }

    .price-input {
        width: 80px;
        padding: 5px;
        font-size: 1rem;
        border-radius: 5px;
    }

    .quantity-select {
        width: 80px;
        padding: 8px 12px;
        font-size: 1rem;
        border-radius: 8px;
    }
}

/* スマホ最適化 - 追加のレスポンシブ調整 */
@media (max-width: 480px) {
    body {
        padding-top: 70px; /* スマホ用の上部余白調整 */
    }

    .container {
        padding: 10px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .menu-container {
        padding: 15px;
    }

    .menu-table {
        font-size: 0.8rem;
    }

    .menu-table th,
    .menu-table td {
        padding: 8px 4px;
    }

    .item-name {
        padding-left: 5px;
        font-size: 0.8rem;
    }

    .price-input,
    .quantity-select {
        width: 50px;
        font-size: 0.75rem;
        padding: 3px;
    }

    .item-price-with-tax {
        width: 60px;
        font-size: 0.75rem;
    }

    .category-header {
        font-size: 1rem;
        padding: 10px 12px;
    }

    .category-total {
        right: 12px;
        font-size: 0.8rem;
        padding: 2px 6px;
        border-radius: 10px;
    }

    .fixed-total {
        padding: 12px;
    }

    .total-amount {
        font-size: 1.3rem;
    }

    #totalAmount {
        font-size: 1.6rem;
    }
}

/* アニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.menu-container {
    animation: fadeIn 0.5s ease-out;
}

.category-section {
    animation: fadeIn 0.5s ease-out;
}

/* ローディングアニメーション */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loadingMessage::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #74b9ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}
