/**
 * Income Simulator Frontend Styles
 */

/* ベーススタイル */
.income-simulator {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
}

.income-simulator * {
    box-sizing: border-box;
}

/* タイトル */
.simulator-title {
    text-align: center;
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 30px;
    color: #2c3e50;
    border-bottom: 3px solid #3498db;
    padding-bottom: 10px;
}

/* フォームセクション */
.form-section {
    margin-bottom: 35px;
    padding: 25px;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.section-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #2c3e50;
    border-left: 4px solid #3498db;
    padding-left: 12px;
}

/* スキル選択 */
.skill-rank-group {
    margin-bottom: 25px;
}

.skill-rank-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #34495e;
    padding: 8px 12px;
    border-radius: 4px;
    background: #f8f9fa;
}

.skill-type-group {
    margin-bottom: 20px;
}

.skill-type-title {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #5d6d7e;
}

.skill-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.skill-item {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid #d1d9e0;
    border-radius: 20px;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.skill-item:hover {
    border-color: #3498db;
    background: #f8f9fa;
}

.skill-item input[type="checkbox"] {
    margin-right: 6px;
    margin-left: 0;
}

.skill-item input[type="checkbox"]:checked + .skill-name {
    color: #3498db;
    font-weight: bold;
}

.skill-item.selected {
    border-color: #3498db;
    background: #ebf3fd;
}

.skill-name {
    font-size: 14px;
    transition: color 0.3s ease;
}

/* スキルタイプ別カラー */
.skill-type-group .skill-item {
    border-color: #3498db;
}

.skill-type-group .skill-item:hover,
.skill-type-group .skill-item.selected {
    border-color: #2980b9;
    background: #ebf3fd;
}

/* 選択カウンター */
.selected-count {
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
    color: #5d6d7e;
}

/* ラジオボタン・チェックボックスグループ */
.radio-group,
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.radio-item,
.checkbox-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border: 1px solid #d1d9e0;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.radio-item:hover,
.checkbox-item:hover {
    border-color: #3498db;
    background: #f8f9fa;
}

.radio-item input[type="radio"],
.checkbox-item input[type="checkbox"] {
    margin-right: 8px;
    margin-left: 0;
}

.radio-item input[type="radio"]:checked,
.checkbox-item input[type="checkbox"]:checked {
    accent-color: #3498db;
}

.radio-item.selected,
.checkbox-item.selected {
    border-color: #3498db;
    background: #ebf3fd;
    color: #3498db;
    font-weight: bold;
}

/* プロセス選択補助ボタン */
.process-actions {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
}

.process-action-btn {
    padding: 6px 12px;
    border: 1px solid #d1d9e0;
    border-radius: 4px;
    background: #fff;
    color: #5d6d7e;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.process-action-btn:hover {
    border-color: #3498db;
    color: #3498db;
}

/* ボタン */
.form-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #3498db;
    color: #fff;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.btn-primary:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: #95a5a6;
    color: #fff;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

/* エラーメッセージ */
.error-message {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #e74c3c;
    border-radius: 6px;
    background: #fdf2f2;
    color: #c0392b;
    font-weight: bold;
}

/* 結果表示 */
.result-container {
    margin-top: 40px;
    padding: 30px;
    border: 2px solid #27ae60;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.2);
}

.result-title {
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 25px;
    color: #27ae60;
}

.main-result {
    text-align: center;
    margin-bottom: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
}

.salary-range {
    margin-bottom: 15px;
}

.salary-amount {
    font-size: 36px;
    font-weight: bold;
    color: #27ae60;
    margin-bottom: 10px;
}

.amount-min,
.amount-max {
    color: #2c3e50;
}

.amount-separator {
    margin: 0 10px;
    color: #7f8c8d;
}

.amount-unit {
    font-size: 24px;
    margin-left: 5px;
}

.salary-average {
    font-size: 18px;
    color: #5d6d7e;
}

.avg-amount {
    font-weight: bold;
    color: #27ae60;
}

/* 選択されたスキル表示 */
.selected-info {
    margin-bottom: 25px;
}

.selected-info h4 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 16px;
}

.selected-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    color: #fff;
    background: #3498db;
}

/* その他の条件 */
.other-conditions {
    margin-bottom: 25px;
}

.other-conditions h4 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 16px;
}

.condition-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.condition-list li {
    padding: 8px 0;
    border-bottom: 1px solid #ecf0f1;
}

.condition-list li:last-child {
    border-bottom: none;
}

.condition-list strong {
    color: #2c3e50;
    margin-right: 10px;
}

/* 注意事項 */
.result-note {
    padding: 15px;
    background: #fef9e7;
    border: 1px solid #f1c40f;
    border-radius: 6px;
    margin-bottom: 20px;
}

.result-note p {
    margin: 0;
    font-size: 14px;
    color: #856404;
}

/* 結果アクション */
.result-actions {
    text-align: center;
    margin-bottom: 20px;
}

.toggle-details {
    padding: 8px 16px;
    border: 1px solid #3498db;
    border-radius: 4px;
    background: #fff;
    color: #3498db;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.toggle-details:hover {
    background: #3498db;
    color: #fff;
}

/* 詳細データテーブル */
.result-details {
    margin-top: 20px;
}

.result-details h4 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 16px;
}

.details-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.details-table th,
.details-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.details-table th {
    background: #f8f9fa;
    font-weight: bold;
    color: #2c3e50;
}

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

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .income-simulator {
        padding: 15px;
    }
    
    .simulator-title {
        font-size: 24px;
    }
    
    .form-section {
        padding: 20px;
    }
    
    .skill-items {
        gap: 8px;
    }
    
    .skill-item {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .radio-group,
    .checkbox-group {
        gap: 10px;
    }
    
    .radio-item,
    .checkbox-item {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .form-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .salary-amount {
        font-size: 28px;
    }
    
    .amount-unit {
        font-size: 20px;
    }
    
    .selected-skills {
        gap: 6px;
    }
    
    .skill-badge {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    .details-table {
        font-size: 12px;
    }
    
    .details-table th,
    .details-table td {
        padding: 8px 6px;
    }
}

@media (max-width: 480px) {
    .simulator-title {
        font-size: 20px;
    }
    
    .section-title {
        font-size: 18px;
    }
    
    .skill-items {
        flex-direction: column;
    }
    
    .skill-item {
        justify-content: flex-start;
    }
    
    .radio-group,
    .checkbox-group {
        flex-direction: column;
    }
    
    .salary-amount {
        font-size: 24px;
    }
    
    .amount-separator {
        margin: 0 5px;
    }
    
    .result-container {
        padding: 20px;
    }
}

/* ローディング状態 */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

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

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

/* フォーカス状態 */
.skill-item:focus-within,
.radio-item:focus-within,
.checkbox-item:focus-within {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* 印刷対応 */
@media print {
    .form-actions,
    .result-actions,
    .toggle-details {
        display: none;
    }
    
    .result-details {
        display: block !important;
    }
    
    .income-simulator {
        max-width: none;
        padding: 0;
    }
}