/* ==========================================================================
   1. プランコンテナ設定
========================================================================== */

.plan-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

@media (max-width: 768px) {
    .plan-container {
        padding: 1rem;
    }
}

/* ==========================================================================
   2. おすすめポートフォリオ全体設定
========================================================================== */

/* ポートフォリオ全体設計 */
.portfolio-section {
    position: relative;
    border-left: 5px solid transparent;
    max-width: 1000px;
    margin: 40px auto;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
}

/* ヘッダースタイル */
.portfolio-header {
    margin-bottom: 10px;
    text-align: center;
}

.portfolio-header h2 {
    padding: 15px 25px;
    border-radius: 8px;
    margin-bottom: 20px;
    color: white;
    font-size: 1.4em;
    line-height: 1.4;
}

/* PCでは改行を無効化 */
.portfolio-header h2 span {
    display: inline;
}

.portfolio-notice {
    margin: 20px 0;
    text-align: center;
    line-height: 1.6;
}

.portfolio-notice p {
    margin: 10px 0;
    font-size: 0.95em;
    color: var(--text-gray);
}

.left-column {
    width: 50%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    font-size: 0.95em;
}

.fund-section {
    margin-bottom: 30px;
}

.fund-section h3 {
    padding: 10px 15px;
    margin: 25px 0 15px;
    border-radius: 4px;
    color: var(--text-dark);
}

.fund-section h3:first-child {
    margin-top: 0;
}

.summary-content {
    background: var(--bg-light);
    padding: 15px;
    border-radius: 8px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 8px;
    border-bottom: 1px solid var(--border-light);
    flex-wrap: nowrap;
    gap: 10px;
    font-size: 1em;
    align-items: center;
}

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

.summary-row span:first-child {
    flex: 0 1 60%;
    min-width: 0;
    padding-right: 15px;
    word-break: break-word;
}

/* 2列目の基本スタイル */
.summary-row span:last-child {
    flex: 1 1 40%;
    min-width: 120px;
    font-weight: 600;
    text-align: center;
    word-break: break-word;
    white-space: nowrap;
    padding: 0.3em 0.8em;
    border-radius: 4px;
}

/* 利益見込み行のスタイル */
.light-plan-section .summary-row[data-type="profit"] span:last-child {
    font-size: 1.4em;
    font-weight: 800;
    font-style: italic;
    color: #1a4d1a;
    background: linear-gradient(135deg, rgba(102, 205, 102, 0.15) 0%, rgba(102, 205, 102, 0.3) 100%);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    box-shadow: 0 2px 8px rgba(102, 205, 102, 0.2);
    animation: highlight-light 0.4s ease-out;
    position: relative;
    overflow: hidden;
}

.standard-plan-section .summary-row[data-type="profit"] span:last-child {
    font-size: 1.4em;
    font-weight: 800;
    font-style: italic;
    color: #142952;
    background: linear-gradient(135deg, rgba(100, 149, 237, 0.15) 0%, rgba(100, 149, 237, 0.3) 100%);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    box-shadow: 0 2px 8px rgba(100, 149, 237, 0.2);
    animation: highlight-standard 0.4s ease-out;
    position: relative;
    overflow: hidden;
}

.premium-plan-section .summary-row[data-type="profit"] span:last-child {
    font-size: 1.4em;
    font-weight: 800;
    font-style: italic;
    color: #614705;
    background: linear-gradient(135deg, rgba(218, 165, 32, 0.15) 0%, rgba(218, 165, 32, 0.3) 100%);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    box-shadow: 0 2px 8px rgba(218, 165, 32, 0.2);
    animation: highlight-premium 0.4s ease-out;
    position: relative;
    overflow: hidden;
}

@keyframes highlight-light {
    0% {
        background: linear-gradient(to left, rgba(102, 205, 102, 0.3), rgba(102, 205, 102, 0.3));
        background-size: 0% 100%;
        background-repeat: no-repeat;
    }
    100% {
        background: linear-gradient(to left, rgba(102, 205, 102, 0.15), rgba(102, 205, 102, 0.3));
        background-size: 100% 100%;
        background-repeat: no-repeat;
    }
}

@keyframes highlight-standard {
    0% {
        background: linear-gradient(to left, rgba(100, 149, 237, 0.3), rgba(100, 149, 237, 0.3));
        background-size: 0% 100%;
        background-repeat: no-repeat;
    }
    100% {
        background: linear-gradient(to left, rgba(100, 149, 237, 0.15), rgba(100, 149, 237, 0.3));
        background-size: 100% 100%;
        background-repeat: no-repeat;
    }
}

@keyframes highlight-premium {
    0% {
        background: linear-gradient(to left, rgba(218, 165, 32, 0.3), rgba(218, 165, 32, 0.3));
        background-size: 0% 100%;
        background-repeat: no-repeat;
    }
    100% {
        background: linear-gradient(to left, rgba(218, 165, 32, 0.15), rgba(218, 165, 32, 0.3));
        background-size: 100% 100%;
        background-repeat: no-repeat;
    }
}

.summary-row[data-type="profit"] span:last-child::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 70%);
    animation: move-sparkle 3s;
    pointer-events: none;
}

@keyframes move-sparkle {
    0% {
        left: -20px;
        top: -20px;
        transform: scale(0);
    }
    50% {
        transform: scale(1);
    }
    100% {
        left: calc(100%);
        top: calc(100%);
        transform: scale(0);
    }
}

.summary-row.header {
    background-color: var(--bg-light);
    font-weight: 600;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 5px;
}

.right-column {
    width: 50%;
    height: 100%;
    font-size: 0.9em;
}

.info-icon {
    color: #718096;
    font-size: 0.9em;
    margin-left: 0.3em;
    cursor: pointer;
    position: relative;
    transition: color 0.3s ease;
}

.info-icon:hover {
    color: #4A5568;
}

/* ツールチップのスタイル */
.tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5em 1em;
    background-color: #2D3748;
    color: white;
    font-size: 0.85em;
    border-radius: 4px;
    z-index: 10;
    font-family: sans-serif;
    font-weight: normal;
    width: max-content;
    max-width: 250px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    white-space: normal;
    line-height: 1.4;
}

/* 三角形の部分 */
.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #2D3748;
}

@media (max-width: 1440px) {
    .portfolio-section { margin: 60px 120px; }
}

@media (max-width: 1240px) {
    .portfolio-section { margin: 50px 80px; }
}

@media (max-width: 1024px) {
    .portfolio-section { 
        margin: 40px 60px;
        padding: 30px;
    }
    .portfolio-summary-grid {
        flex-direction: column;
        gap: 10px;
    }
    .left-column,
    .right-column {
        width: 100%;
    }
    .fund-section h3 {
        font-size: 1.1em;
        padding: 8px 12px;
    }
}

@media (max-width: 768px) {
    .portfolio-section {
        margin: 30px 40px;
        padding: 25px;
    }
    .portfolio-header h2 {
        font-size: 1.1em;
        padding: 12px 20px;
    }
    /* タブレット以下で改行を有効化 */
    .portfolio-header h2 span {
        display: block;
        margin-top: 5px;
    }
    .feature-header,
    .feature-name {
        width: 25%;
        min-width: 120px;
    }
    .portfolio-notice {
        text-align: left;
        margin: 15px 0;
    }
    
    .portfolio-notice p {
        font-size: 0.85em;
        margin: 8px 0;
    }
    .summary-row {
        font-size: 0.85em;
        padding: 6px 0 6px 6px;
    }
    .summary-row span:last-child {
        min-width: 100px;
        padding: 0.2em 0.6em;
    }
    .fund-section h3 {
        font-size: 1em;
        margin: 20px 0 12px;
    }
    .tooltip {
        font-size: 0.8em;
        max-width: 220px;
    }
}

@media (max-width: 480px) {
    .portfolio-section {
        margin: 20px;
        padding: 15px;
    }
    .portfolio-header h2 {
        font-size: 0.95em;
        padding: 10px 15px;
    }
    .portfolio-header h2 span {
        margin-top: 3px;
    }
    .portfolio-summary-grid {
        gap: 0;
    }
    .feature-header,
    .feature-name {
        width: 30%;
        min-width: 100px;
    }
    .portfolio-notice {
        margin: 12px 0;
    }
    
    .portfolio-notice p {
        font-size: 0.75em;
        margin: 6px 0;
    }
    .summary-row {
        font-size: 0.8em;
        padding: 6px 0 6px 4px;
        gap: 0;
    }
    .summary-row span:first-child {
        flex: 0 1 65%;
        padding-right: 8px;
    }
    .summary-row span:last-child {
        flex: 1 1 35%;
        min-width: 100px;
        font-size: 1.0em;
        padding: 0.2em 0.4em;
    }
    .summary-row[data-type="profit"] span:last-child::before {
        width: 0;
        height: 0;
    }
    .fund-section h3 {
        font-size: 0.9em;
        padding: 6px 10px;
        margin: 15px 0 10px;
    }
    .info-icon {
        font-size: 0.8em;
    }
    
    .tooltip {
        font-size: 0.75em;
        max-width: 200px;
        padding: 0.4em 0.8em;
    }
}

/* ==========================================================================
   3. 各種おすすめポートフォリオ設定
========================================================================== */

/* プラン別背景とボーダー */
.light-plan-section {
    background: linear-gradient(135deg, rgba(102, 205, 102, 0.1) 0%, rgba(102, 205, 102, 0.05) 100%);
    border-left-color: var(--light-color);
}

.standard-plan-section {
    background: linear-gradient(135deg, rgba(100, 149, 237, 0.1) 0%, rgba(100, 149, 237, 0.05) 100%);
    border-left-color: var(--standard-color);
}

.premium-plan-section {
    background: linear-gradient(135deg, rgba(218, 165, 32, 0.1) 0%, rgba(218, 165, 32, 0.05) 100%);
    border-left-color: var(--premium-color);
}

.light-plan-section .portfolio-header h2 { background: var(--light-color); }
.standard-plan-section .portfolio-header h2 { background: var(--standard-color); }
.premium-plan-section .portfolio-header h2 { background: var(--premium-color); }

.portfolio-summary-grid {
    display: flex;
    gap: 20px;
}

.light-plan-section .fund-section h3 {
    background-color: rgba(102, 205, 102, 0.15);
    border-left: 4px solid rgba(102, 205, 102, 0.5);
}

.standard-plan-section .fund-section h3 {
    background-color: rgba(100, 149, 237, 0.15);
    border-left: 4px solid rgba(100, 149, 237, 0.5);
}

.premium-plan-section .fund-section h3 {
    background-color: rgba(218, 165, 32, 0.15);
    border-left: 4px solid rgba(218, 165, 32, 0.5);
}