/**
 * カードローン2-in-1返済シミュレーター スタイルシート
 */

/* コンテナスタイル */
.cls-simulator-container {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

/* タブナビゲーション */
.cls-tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 20px;
}

.cls-tab-button {
    padding: 12px 20px;
    background: #f5f5f5;
    border: none;
    border-radius: 5px 5px 0 0;
    margin-right: 5px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    top: 2px;
}

.cls-tab-button:hover {
    background: #e9e9e9;
}

.cls-tab-button.active {
    background: #000080;
    color: white;
    border-bottom: 2px solid #000080;
}

/* フォームセクション */
.cls-form-section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.cls-form-header {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
    font-weight: 700;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
}

/* フォーム表レイアウト */
.cls-form-table {
    width: 100%;
    table-layout: fixed !important;
    border-collapse: collapse;
    margin-bottom: 20px;
    display: table;
}

.cls-form-row {
    display: table-row;
    border-bottom: 1px solid #f0f0f0;
}

.cls-form-row:last-child {
    border-bottom: none;
}

.cls-form-cell {
    display: table-cell;
    padding: 15px 10px;
    vertical-align: middle;
}

.cls-label-cell {
    width: 30% !important;
    background-color: #f9f9f5;
    font-weight: 600;
    color: #333;
    border-right: 1px solid #f0f0f0;
}

.cls-value-cell {
    width: 20% !important;
    text-align: center;
}

.cls-slider-cell {
    width: 50% !important;
}

.cls-method-cell {
    width: 70% !important;
    padding-left: 20px;
}

.cls-slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #e0e0e0;
    outline: none;
    border-radius: 3px;
    position: relative;
}

.cls-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #000080;
    cursor: pointer;
    position: relative;
    z-index: 2;
}

.cls-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #000080;
    cursor: pointer;
    position: relative;
    z-index: 2;
}

.cls-method-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cls-radio-group {
    display: flex;
    align-items: center;
}

.cls-radio-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    margin-right: 20px;
    cursor: pointer;
}

.cls-radio-group input[type="radio"] {
    margin-right: 5px;
}

.cls-radio-label {
    line-height: 1;
    white-space: nowrap;
}

.cls-info-link {
    color: #000080;
    text-decoration: underline;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
    display: inline-block;
    margin-left: 20px;
}

/* 入力フィールドとユニットを横並びにする */
.cls-input-with-unit {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
}

.cls-input {
    width: 100px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    text-align: right;
}

.cls-unit {
    margin-left: 5px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.cls-calculate-button {
    background: #000080;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    margin: 20px auto;
    display: block;
    width: 80%;
}

.cls-calculate-button:hover {
    background: #000066;
}

/* 入力値変更時のアニメーション */
.cls-input-changed {
    background-color: #f0f7ff;
    transition: background-color 0.3s ease;
}

/* 結果セクション */
.cls-results-section {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    animation: fadeIn 0.5s ease;
}

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

.cls-result-cards {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 30px;
}

.cls-result-card {
    flex: 1;
    background: #f5f5f5;
    border-radius: 6px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.cls-result-card:hover {
    transform: translateY(-5px);
}

.cls-result-title {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.cls-result-value {
    font-size: 24px;
    font-weight: 700;
    color: #000080;
}

/* チャートコンテナ */
.cls-charts-container {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.cls-chart-box {
    flex: 1;
    background: #fff;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.cls-chart-title {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

.cls-chart-container {
    height: 250px;
    position: relative;
}

.cls-section-title {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

/* スケジュール表 */
.cls-schedule-container {
    margin-bottom: 30px;
}

.cls-schedule-table-wrapper {
    overflow-x: auto;
    max-height: 300px;
    overflow-y: auto;
}

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

.cls-schedule-table th,
.cls-schedule-table td {
    padding: 10px;
    text-align: right;
    border-bottom: 1px solid #e0e0e0;
}

.cls-schedule-table th {
    background: #f5f5f5;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
}

.cls-schedule-table tr:hover {
    background: #f9f9f9;
}

/* 注釈のスタイル */
.cls-disclaimer {
    margin-top: 20px;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
    color: #666;
}

.cls-disclaimer p {
    margin: 0;
}

/* ポップアップスタイル */
.cls-popup {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
    animation: fadeIn 0.3s ease;
    justify-content: center;
    align-items: center;
}

.cls-popup-content {
    background-color: #fff;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
}

.cls-popup-header {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 20px;
    font-weight: 700;
    color: #333;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
}

.cls-popup-body {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

.cls-popup-body p {
    margin-bottom: 15px;
}

.cls-popup-body ul {
    margin-top: 0;
    margin-bottom: 15px;
    padding-left: 20px;
}

.cls-popup-body li {
    margin-bottom: 5px;
}

.cls-popup-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.cls-popup-close:hover,
.cls-popup-close:focus {
    color: #000;
    text-decoration: none;
}

/* レスポンシブスタイル（修正部分） */
@media (max-width: 768px) {
    /* テーブルレイアウトをブロックレイアウトに変更 */
    .cls-form-table {
        display: block;
    }
    
    /* 行をリセット */
    .cls-form-row {
        display: block;
        margin-bottom: 20px;
        border-bottom: 1px solid #e0e0e0;
        padding-bottom: 15px;
    }
    
    /* すべてのセルを横並びにリセット */
    .cls-form-cell {
        display: block;
        width: 100% !important;
    }
    
    /* 条件タイトルと入力値を横並びにする */
    .cls-label-cell {
        float: left;
        width: 50% !important;
        background-color: transparent;
        border-right: none;
        padding: 10px 0;
        font-size: 16px;
        font-weight: 600;
    }
    
    /* 入力値フィールドのスタイル */
    .cls-value-cell {
        float: right;
        width: 50% !important;
        text-align: right;
        padding: 10px 0;
    }

    /* クリアフィックス */
    .cls-form-row:after {
        content: "";
        display: table;
        clear: both;
    }
    
    /* スライダーセルのスタイル */
    .cls-slider-cell {
        clear: both;
        padding-top: 0;
        padding-bottom: 10px;
    }
    
    /* 入力欄とユニットの配置調整 */
    .cls-input-with-unit {
        justify-content: flex-end;
    }
    
    /* 入力欄のサイズ調整 */
    .cls-input {
        width: 80px;
    }
    
    /* 返済方式セルのスタイル */
    .cls-method-cell {
        clear: both;
        width: 100% !important;
        text-align: left;
        padding-left: 0;
        padding-top: 0;
    }
    
    /* 返済方式コンテナのレイアウト */
    .cls-method-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    /* ラジオグループのレイアウト */
    .cls-radio-group {
        display: flex;
        flex-direction: row;
        align-items: center;
        margin-bottom: 10px;
        width: 100%;
    }
    
    /* 返済方式の違いリンクのマージン */
    .cls-info-link {
        margin-left: 0;
        margin-top: 5px;
    }
    
    /* 結果カードのレイアウト */
    .cls-result-cards {
        flex-direction: column;
    }
    
    /* チャートコンテナのレイアウト */
    .cls-charts-container {
        flex-direction: column;
    }
    
    /* チャートのサイズ調整 */
    .cls-chart-container {
        height: 200px;
    }
    
    /* スマホ表示時のスケジュール表のレイアウト調整 */
    .cls-schedule-table-wrapper {
        overflow-x: auto;
    }
    
    .cls-schedule-table {
        table-layout: auto;
        width: 100%;
    }
    
    .cls-schedule-table th,
    .cls-schedule-table td {
        padding: 10px;
        min-width: 100px;
    }
    
    .cls-schedule-table th:first-child,
    .cls-schedule-table td:first-child {
        min-width: 60px;
    }

    .cls-schedule-table th:nth-child(2),
    .cls-schedule-table td:nth-child(2),
    .cls-schedule-table th:nth-child(3),
    .cls-schedule-table td:nth-child(3),
    .cls-schedule-table th:nth-child(4),
    .cls-schedule-table td:nth-child(4),
    .cls-schedule-table th:nth-child(5),
    .cls-schedule-table td:nth-child(5) {
        min-width: 120px;
    }
    
    /* 注釈のスタイル調整 */
    .cls-disclaimer {
        font-size: 12px;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .cls-tabs {
        flex-direction: column;
    }
    
    .cls-tab-button {
        width: 100%;
        border-radius: 4px;
        margin-bottom: 5px;
    }
    
    /* 小さい画面では返済方式のラジオボタンを縦に */
    .cls-radio-group {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .cls-radio-group label {
        margin-right: 0;
        margin-bottom: 10px;
    }
}