/* 全体のリセットと基本スタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Yu Gothic', 'Meiryo', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

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

/* ヘッダー */
header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 3px solid #667eea;
}

header h1 {
    font-size: 2.5em;
    color: #667eea;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.1em;
}

/* 使い方アコーディオン */
.how-to-use {
    margin-bottom: 30px;
    background: transparent;
    border: none;
    padding: 0;
}

.accordion {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    padding: 18px;
    border: none;
    border-radius: 10px;
    text-align: left;
    font-size: 1.1em;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.accordion:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(102, 126, 234, 0.4);
}

.accordion::after {
    content: '▼';
    float: right;
    transition: transform 0.3s;
}

.accordion.active::after {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: #f8f9fa;
    border-radius: 0 0 10px 10px;
}

.accordion-content.active {
    max-height: 1000px;
    transition: max-height 0.5s ease-in;
}

.how-to-inner {
    padding: 25px;
    background: white;
    border-radius: 10px;
    margin-top: 10px;
    border: 2px solid #e9ecef;
}

.how-to-inner h3 {
    color: #667eea;
    margin-bottom: 15px;
    margin-top: 20px;
    font-size: 1.3em;
}

.how-to-inner h3:first-child {
    margin-top: 0;
}

.how-to-inner h4 {
    color: #495057;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.how-to-inner ol {
    margin-left: 20px;
    margin-bottom: 20px;
}

.how-to-inner ol li {
    margin-bottom: 12px;
    line-height: 1.6;
}

.how-to-inner ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.how-to-inner ul li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.usage-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
}

.usage-item p {
    margin: 0;
    line-height: 1.6;
    color: #495057;
}

/* セクション */
section {
    margin-bottom: 30px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 15px;
    border: 2px solid #e9ecef;
}

section h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5em;
    display: flex;
    align-items: center;
}

/* 入力グループ */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #495057;
}

.input-example {
    font-size: 0.9em;
    color: #6c757d;
    margin-bottom: 8px;
    font-style: italic;
}

.input-group input[type="number"],
.input-group input[type="text"],
.condition-group input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #ced4da;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.input-group input:focus,
.condition-group input:focus {
    outline: none;
    border-color: #667eea;
}

/* 行列設定 */
.row-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.capacity-info {
    margin-top: 15px;
    padding: 10px;
    background: #e7f3ff;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    color: #0066cc;
}

#seatCapacity {
    font-size: 1.2em;
    color: #667eea;
}

/* 条件グループ */
.condition-group {
    margin-bottom: 25px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    border: 2px solid #dee2e6;
}

.condition-group h3 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.condition-desc {
    color: #6c757d;
    font-size: 0.9em;
    margin-bottom: 15px;
}

/* 離す・隣接条件の入力 */
.separate-input,
.adjacent-input {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.separate-pair,
.adjacent-pair {
    flex: 1;
}

/* ボタンスタイル */
.btn-generate,
.btn-reset,
.btn-add,
.btn-remove {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-generate {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 1.3em;
    padding: 18px 40px;
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.btn-reset {
    background: #6c757d;
    color: white;
    font-size: 1.1em;
    padding: 15px 30px;
}

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

.btn-add {
    background: #28a745;
    color: white;
    margin-top: 10px;
}

.btn-add:hover {
    background: #218838;
}

.btn-remove {
    background: #dc3545;
    color: white;
    padding: 8px 16px;
}

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

.button-group {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 30px 0;
}

/* エラーメッセージ */
.error-message {
    display: none;
    padding: 15px;
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
    border-radius: 8px;
    margin: 20px 0;
    font-weight: bold;
}

.error-message.show {
    display: block;
}

/* 座席表セクション */
.seating-section {
    background: white;
    border: 3px solid #667eea;
}

.board-label {
    background: #2d3748;
    color: white;
    padding: 15px;
    text-align: center;
    font-weight: bold;
    font-size: 1.2em;
    border-radius: 8px;
    margin-bottom: 30px;
    letter-spacing: 10px;
}

.seating-chart {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.placeholder {
    text-align: center;
    color: #adb5bd;
    font-size: 1.1em;
    padding: 60px 20px;
}

/* 座席行 */
.seat-row {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* 座席 */
.seat {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    font-size: 1.3em;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s;
}

.seat:hover {
    transform: scale(1.05);
}

.seat.empty {
    background: #e9ecef;
    color: #adb5bd;
    box-shadow: none;
}

.seat.front-row {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
}

.seat.back-row {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
}

/* フッター */
footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e9ecef;
    color: #6c757d;
}

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

    header h1 {
        font-size: 2em;
    }

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

    .button-group {
        flex-direction: column;
    }

    .btn-generate,
    .btn-reset {
        width: 100%;
    }

    .seat {
        width: 60px;
        height: 60px;
        font-size: 1.1em;
    }

    .separate-input,
    .adjacent-input {
        flex-direction: column;
    }

    .btn-remove {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .seat {
        width: 50px;
        height: 50px;
        font-size: 1em;
    }

    .seat-row {
        gap: 5px;
    }
}
