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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
    background: linear-gradient(135deg, #ffc0e3 0%, #ffeff7 50%, #ffd6ea 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* ヘッダー */
header {
    background: linear-gradient(135deg, #ff9ecf 0%, #ffb4d9 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2rem;
    font-weight: 600;
}

header i {
    margin-right: 10px;
}

/* タブメニュー */
.tab-menu {
    display: flex;
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.tab-button {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: #6c757d;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.tab-button:hover {
    background: #e9ecef;
    color: #495057;
}

.tab-button.active {
    color: #ff6fb5;
    border-bottom-color: #ff6fb5;
    background: white;
}

.tab-button i {
    margin-right: 8px;
}

/* タブコンテンツ */
.tab-content {
    display: none;
    padding: 30px;
}

.tab-content.active {
    display: block;
}

/* セクション */
.section {
    margin-bottom: 30px;
}

.section h2 {
    color: #d63384;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ff9ecf;
}

/* フォームアクション */
.form-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.form-actions-bottom {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #ff9ecf;
    position: sticky;
    bottom: 0;
    background: white;
    padding: 15px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

/* 商品フォーム */
.product-form {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s;
    animation: slideIn 0.4s ease-out;
}

.product-form:hover {
    border-color: #ff9ecf;
    box-shadow: 0 4px 12px rgba(255, 158, 207, 0.2);
}

/* フォーム追加アニメーション */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.form-slide-in {
    animation: slideIn 0.4s ease-out;
}

.product-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.product-form-header h3 {
    color: #ff6fb5;
    font-size: 1.1rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #ff9ecf;
    box-shadow: 0 0 0 3px rgba(255, 158, 207, 0.15);
}

.form-group input[readonly] {
    background-color: #e9ecef;
    cursor: not-allowed;
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 5px;
}

.jan-input-group {
    display: flex;
    gap: 5px;
}

.jan-input-group input {
    flex: 1;
}

.btn-search-jan {
    padding: 10px 15px;
    background: #ff9ecf;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-search-jan:hover {
    background: #ff7aba;
}

.btn-clear-form {
    padding: 5px 15px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.btn-clear-form:hover {
    background: #c82333;
}

/* ボタン */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #ff9ecf;
    color: white;
}

.btn-primary:hover {
    background: #ff7aba;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 158, 207, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}

/* 検索エリア */
.search-area {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
}

.search-box {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 15px;
    color: #6c757d;
}

.search-box input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: #ff9ecf;
    box-shadow: 0 0 0 3px rgba(255, 158, 207, 0.15);
}

/* 商品リスト */
.product-list {
    overflow-x: auto;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-size: 1.1rem;
}

.product-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.product-table thead {
    background: linear-gradient(135deg, #ff9ecf 0%, #ffb4d9 100%);
    color: white;
}

.product-table th,
.product-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.product-table th {
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.product-table tbody tr {
    transition: all 0.3s;
}

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

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

.action-buttons {
    display: flex;
    gap: 5px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 5px;
}

.no-products {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

/* 価格オプション設定 */
.price-options-area {
    max-width: 600px;
}

.add-option {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.add-option input {
    flex: 1;
    padding: 12px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 1rem;
}

.options-list {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.option-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: white;
    border-radius: 5px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.option-item:last-child {
    margin-bottom: 0;
}

.option-name {
    font-weight: 500;
    color: #333;
    flex: 1;
}

.option-actions {
    display: flex;
    gap: 5px;
    align-items: center;
}

.btn-order {
    padding: 6px 10px;
    background: #ff9ecf;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.btn-order:hover {
    background: #ff7aba;
}

.btn-order:disabled {
    background: #ddd;
    cursor: not-allowed;
    opacity: 0.5;
}

/* モーダル */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover,
.close:focus {
    color: #333;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-actions .btn {
    flex: 1;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        border-radius: 10px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .tab-content {
        padding: 15px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .search-area {
        flex-direction: column;
    }

    .product-table {
        font-size: 0.85rem;
    }

    .product-table th,
    .product-table td {
        padding: 10px 8px;
    }

    .form-actions {
        flex-direction: column;
    }

    .tab-button {
        font-size: 0.9rem;
        padding: 12px 10px;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }
}

/* アラート・通知 */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ローディングスピナー */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* バッジ */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-reduced {
    background: #ffe0f0;
    color: #c72167;
}

.badge-standard {
    background: #fff0d4;
    color: #c97000;
}

/* エラーメッセージ */
.error-message {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 5px;
    display: block;
    font-weight: 500;
}

.form-group input.error {
    border-color: #dc3545 !important;
}

/* 店舗選択エリア */
.store-selection {
    background: linear-gradient(135deg, #fff0f7 0%, #ffe6f0 100%);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 2px solid #ff9ecf;
}

.store-selection label {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: #d63384;
    margin-bottom: 10px;
}

.store-selection label i {
    margin-right: 8px;
}

.store-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ff9ecf;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.store-select:focus {
    outline: none;
    border-color: #ff6fb5;
    box-shadow: 0 0 0 3px rgba(255, 158, 207, 0.2);
}

.store-select:hover {
    border-color: #ff7aba;
}
