/* ============================================================
   メインスタイル
   ワインリスト入力・編集画面のスタイル定義
   ============================================================ */

/* リセットと基本設定 */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Meiryo', sans-serif;
    font-size: 14px;
    color: #333;
    background: #f5f5f0;
    line-height: 1.6;
}

/* ============================================================
   ヘッダー
   ============================================================ */
.site-header {
    background: #2c1810;
    color: #f0e6d3;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-header h1 {
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 0.05em;
}

.site-header .tagline {
    font-size: 12px;
    color: #c4a882;
    margin-left: auto;
}

/* ============================================================
   メインコンテンツ
   ============================================================ */
.main-content {
    max-width: 1200px;
    margin: 24px auto;
    padding: 0 16px;
}

/* セクション共通 */
.section {
    background: #fff;
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.section-title {
    font-size: 13px;
    font-weight: bold;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

/* ============================================================
   ラジオボタングループ（スタイル・トーン選択）
   ============================================================ */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s, border-color 0.15s;
}

.radio-group label:hover {
    background: #f9f5f0;
    border-color: #c4a882;
}

.radio-group input[type="radio"] {
    display: none;
}

.radio-group input[type="radio"]:checked + span {
    /* チェック済みラベルの文字スタイル */
    font-weight: bold;
}

.radio-group label:has(input:checked) {
    background: #2c1810;
    border-color: #2c1810;
    color: #f0e6d3;
}

/* ============================================================
   ワインリストテーブル
   ============================================================ */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

thead th {
    background: #f5f5f0;
    padding: 8px 10px;
    text-align: left;
    font-weight: bold;
    color: #555;
    border-bottom: 2px solid #ddd;
    white-space: nowrap;
}

tbody td {
    padding: 6px 8px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

tbody tr.wine-row:hover {
    background: #fafaf8;
}

/* 生成中の行 */
tbody tr.generating {
    opacity: 0.6;
    pointer-events: none;
}

/* 生成完了の行（一時的なハイライト） */
tbody tr.generated {
    animation: highlight 1.5s ease-out;
}

@keyframes highlight {
    0%   { background: #e8f5e9; }
    100% { background: transparent; }
}

/* 列幅の指定 */
.col-num    { width: 36px; text-align: center; color: #999; }
.col-name   { min-width: 200px; }
.col-type   { width: 120px; }
.col-origin { width: 160px; }
.col-body   { width: 150px; }
.col-grape  { width: 150px; }
.col-desc   { min-width: 280px; }
.col-glass  { width: 90px; }
.col-bottle { width: 90px; }
.col-action { width: 80px; white-space: nowrap; }

/* ============================================================
   フォーム要素
   ============================================================ */
input[type="text"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    color: #333;
    background: #fff;
    transition: border-color 0.15s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #c4a882;
}

textarea {
    resize: vertical;
    min-height: 54px;
}

select {
    cursor: pointer;
}

/* ============================================================
   ボタン
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.15s, opacity 0.15s;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* プライマリボタン（AI生成） */
.btn-primary {
    background: #2c1810;
    color: #f0e6d3;
}

.btn-primary:hover:not(:disabled) {
    background: #3d2215;
}

/* セカンダリボタン */
.btn-secondary {
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover:not(:disabled) {
    background: #f5f5f0;
    border-color: #bbb;
}

/* 行内の小ボタン */
.btn-generate-single,
.btn-delete-row {
    width: 28px;
    height: 28px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
    color: #666;
    transition: background 0.15s;
    margin: 1px;
}

.btn-generate-single:hover {
    background: #e8f5e9;
    border-color: #aaa;
}

.btn-delete-row:hover {
    background: #fdecea;
    border-color: #e57373;
    color: #e57373;
}

/* ============================================================
   アクションバー（下部ボタン群）
   ============================================================ */
.action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}

.action-bar-left,
.action-bar-right {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ============================================================
   メッセージ表示
   ============================================================ */
.message {
    padding: 10px 16px;
    border-radius: 4px;
    margin-bottom: 12px;
    font-size: 13px;
    display: none;
}

.message.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.message.error {
    background: #fdecea;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.message.info {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #90caf9;
}

/* ============================================================
   価格設定の注記
   ============================================================ */
.price-note {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

/* ============================================================
   フッター
   ============================================================ */
.site-footer {
    text-align: center;
    padding: 24px;
    font-size: 12px;
    color: #999;
}

.site-footer-disclaimer {
    margin-top: 8px;
    font-size: 11px;
    color: #bbb;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

/* ============================================================
   レスポンシブ（タブレット以下）
   ============================================================ */
@media (max-width: 768px) {
    .main-content {
        padding: 0 8px;
    }

    .section {
        padding: 14px 14px;
    }

    .action-bar {
        flex-direction: column;
    }

    .action-bar-left,
    .action-bar-right {
        width: 100%;
    }

    .btn {
        flex: 1;
        justify-content: center;
    }
}

/* 印刷時は非表示 */
@media print {
    .site-header, .section, .action-bar, .site-footer {
        display: none !important;
    }
}
