/* チーム分けツール専用スタイル */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.max-w-5xl {
    max-width: 1024px;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.px-5 {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.py-20 {
    padding-top: 5rem;
    padding-bottom: 5rem;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
    font-weight: 600;
    font-size: 2.5em;
}

.subtitle {
    text-align: center;
    margin-bottom: 40px;
    color: #666;
    font-size: 1.2em;
}

/* セクション共通スタイル */
.input-section,
.settings-section,
.results-section,
.error-section,
.usage-section,
.action-section {
    background: white;
    margin-bottom: 30px;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #f1f5f9;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 20px;
}

/* 参加者入力 */
.member-textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s ease;
}

.member-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 設定グリッド */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.setting-item {
    display: flex;
    flex-direction: column;
}

.setting-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.required {
    color: #ef4444;
    font-size: 0.75rem;
    margin-left: 4px;
}

.setting-select,
.team-name-input {
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.95rem;
    background-color: white;
    transition: all 0.2s;
}

.setting-select:focus,
.team-name-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* チーム名設定 */
.team-names-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.team-name-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.team-name-label {
    font-size: 0.75rem;
    color: #6b7280;
}

.team-name-input {
    width: 100%;
}


/* ボタン */
.control-btn {
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.control-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.control-btn.primary {
    background-color: #3b82f6;
    color: white;
}

.control-btn.primary:hover {
    background-color: #2563eb;
}

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

.control-btn.secondary:hover {
    background-color: #4b5563;
}

.control-btn:not(.primary):not(.secondary) {
    background-color: #f3f4f6;
    color: #374151;
}

.control-btn:not(.primary):not(.secondary):hover {
    background-color: #e5e7eb;
}

/* チーム分け実行ボタン */
.action-buttons {
    text-align: center;
    margin: 30px 0;
}

.generate-btn {
    padding: 14px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

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

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

/* 結果表示 */
.teams-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.team-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
}

.team-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.team-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.team-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1e293b;
}

.team-count {
    background: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #64748b;
}

.team-members {
    list-style: none;
    padding: 0;
}

.member-item {
    padding: 8px 12px;
    margin-bottom: 6px;
    background: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
}

.member-item:hover {
    background: #f8fafc;
    transform: translateX(4px);
}

.member-name {
    color: #334155;
    font-weight: 500;
}

.member-role {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.role-leader {
    background: #fef3c7;
    color: #92400e;
}

.role-organizer {
    background: #dbeafe;
    color: #1e40af;
}

/* 結果操作ボタン */
.result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

/* エラーセクション */
.error-section {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
}

/* 使い方 */
.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    font-size: 0.875rem;
    font-weight: 600;
    margin-right: 12px;
    flex-shrink: 0;
}

/* アニメーション */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .team-names-grid {
        grid-template-columns: 1fr;
    }
    
    .teams-container {
        grid-template-columns: 1fr;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .result-actions button {
        width: 100%;
    }
}


/* 通知メッセージ */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

.notification.success {
    background-color: #10b981;
}

.notification.error {
    background-color: #ef4444;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* hidden クラス */
.hidden {
    display: none !important;
}