/**
 * SOICO Securities CTA - フロントエンドスタイル
 *
 * @package Soico_Securities_CTA
 */

/* ==========================================================================
   CSS Variables (fallback)
   ========================================================================== */
:root {
    --soico-cta-primary: #FF6B35;
    --soico-cta-secondary: #1E88E5;
    --soico-cta-border-radius: 8px;
    --soico-cta-gradient-start: #E8F4FC;
    --soico-cta-gradient-end: #F0F8FF;
}

/* ==========================================================================
   共通スタイル
   ========================================================================== */
.soico-cta-button {
    display: inline-block;
    padding: 16px 48px;
    border-radius: var(--soico-cta-border-radius);
    font-size: 18px;
    font-weight: bold;
    text-decoration: none;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    border: none;
}

.soico-cta-button-primary {
    background-color: var(--soico-cta-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
}

.soico-cta-button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 53, 0.5);
    color: #fff;
    text-decoration: none;
}

.soico-cta-badge {
    display: inline-block;
    background: #E53935;
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 3px;
    margin-left: 8px;
    vertical-align: middle;
}

/* ==========================================================================
   結論ボックス
   ========================================================================== */
.soico-cta-conclusion-box {
    background: linear-gradient(135deg, var(--soico-cta-gradient-start) 0%, var(--soico-cta-gradient-end) 100%);
    border: 2px solid var(--soico-cta-secondary);
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
    box-shadow: 0 4px 12px rgba(30, 136, 229, 0.15);
}

.soico-cta-conclusion-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.soico-cta-conclusion-label {
    background: var(--soico-cta-secondary);
    color: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

.soico-cta-conclusion-title {
    margin: 0;
    font-size: 20px;
    color: #1E3A5F;
    line-height: 1.4;
}

.soico-cta-conclusion-features {
    margin: 0 0 20px 0;
    padding-left: 20px;
    color: #333;
    line-height: 1.8;
}

.soico-cta-conclusion-features li {
    margin-bottom: 4px;
}

.soico-cta-conclusion-action {
    text-align: center;
}

.soico-cta-conclusion-note {
    margin-top: 8px;
    font-size: 12px;
    color: #666;
}

/* ==========================================================================
   インラインCTA
   ========================================================================== */
.soico-cta-inline {
    background: #F8F9FA;
    border-left: 4px solid var(--soico-cta-secondary);
    padding: 16px 20px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.soico-cta-inline-content {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.soico-cta-inline-name {
    color: #1E3A5F;
    font-size: 16px;
}

.soico-cta-inline-feature {
    color: #666;
    font-size: 14px;
}

.soico-cta-inline-button {
    background: var(--soico-cta-primary);
    color: #fff;
    padding: 8px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.soico-cta-inline-button:hover {
    opacity: 0.9;
    color: #fff;
    text-decoration: none;
}

/* スタイルバリエーション */
.soico-cta-inline-subtle {
    background: transparent;
    border: 1px solid #E0E0E0;
    border-left: 4px solid var(--soico-cta-secondary);
}

/* ==========================================================================
   単体ボタン
   ========================================================================== */
.soico-cta-single-button-wrapper {
    text-align: center;
    padding: 20px 0;
}

.soico-cta-pr-label {
    margin-top: 8px;
    font-size: 12px;
    color: #888;
}

/* ==========================================================================
   比較表
   ========================================================================== */
.soico-cta-comparison-wrapper {
    margin: 24px 0;
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.soico-cta-comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 600px;
    background: #fff;
}

.soico-cta-comparison-table thead tr {
    background: linear-gradient(135deg, #1E3A5F 0%, #2C5282 100%);
    color: #fff;
}

.soico-cta-comparison-table th {
    padding: 14px 12px;
    text-align: left;
    font-weight: bold;
    font-size: 13px;
    letter-spacing: 0.5px;
}

.soico-cta-comparison-table th.soico-cta-col-rank,
.soico-cta-comparison-table th.soico-cta-col-commission,
.soico-cta-comparison-table th.soico-cta-col-action {
    text-align: center;
}

.soico-cta-comparison-table tbody tr {
    background: #fff;
    transition: background 0.2s;
}

/* 偶数行のゼブラストライプ */
.soico-cta-comparison-table tbody tr:nth-child(even) {
    background: #F8FAFC;
}

/* ホバー効果 */
.soico-cta-comparison-table tbody tr:hover {
    background: #EDF2F7;
}

.soico-cta-comparison-table td {
    padding: 16px 12px;
    border-bottom: 1px solid #E2E8F0;
    vertical-align: middle;
}

.soico-cta-comparison-table td.soico-cta-col-rank,
.soico-cta-comparison-table td.soico-cta-col-commission,
.soico-cta-comparison-table td.soico-cta-col-action {
    text-align: center;
}

/* 1位のハイライト - 左ボーダーで控えめに強調 */
.soico-cta-row-highlight {
    background: #fff !important;
    border-left: 4px solid var(--soico-cta-primary);
}

.soico-cta-row-highlight:hover {
    background: #FFF5F0 !important;
}

/* 証券会社名の強調 */
.soico-cta-comparison-table td.soico-cta-col-name strong {
    color: #1E3A5F;
    font-size: 15px;
}

.soico-cta-row-highlight td.soico-cta-col-name strong {
    color: var(--soico-cta-primary);
}

/* ランキングバッジ */
.soico-cta-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.soico-cta-rank-gold {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.soico-cta-rank-silver {
    background: linear-gradient(135deg, #E8E8E8 0%, #A0A0A0 100%);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.soico-cta-rank-bronze {
    background: linear-gradient(135deg, #CD7F32 0%, #A0522D 100%);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* 4位以降のランク */
.soico-cta-rank-default {
    background: #E2E8F0;
    color: #4A5568;
}

/* 手数料 */
.soico-cta-commission {
    color: #E53935;
    font-weight: bold;
    font-size: 15px;
}

/* 特徴テキスト */
.soico-cta-col-features {
    color: #4A5568;
    font-size: 13px;
    line-height: 1.5;
}

/* テーブルボタン */
.soico-cta-table-button {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: bold;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.soico-cta-table-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    color: #fff;
    text-decoration: none;
}

/* 1位のボタン強調 */
.soico-cta-row-highlight .soico-cta-table-button {
    padding: 12px 24px;
    font-size: 14px;
}

.soico-cta-table-note {
    text-align: right;
    font-size: 12px;
    color: #718096;
    margin-top: 12px;
    padding-right: 4px;
}

/* ==========================================================================
   控えめバナー
   ========================================================================== */
.soico-cta-subtle-banner {
    background: #F5F5F5;
    border: 1px solid #E0E0E0;
    border-radius: var(--soico-cta-border-radius);
    padding: 12px 16px;
    margin: 16px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.soico-cta-subtle-message {
    font-size: 13px;
    color: #666;
}

.soico-cta-subtle-message a {
    color: var(--soico-cta-secondary);
    font-weight: bold;
    text-decoration: none;
}

.soico-cta-subtle-message a:hover {
    text-decoration: underline;
}

.soico-cta-subtle-pr {
    font-size: 11px;
    color: #999;
}

/* ==========================================================================
   レスポンシブ
   ========================================================================== */
@media (max-width: 768px) {
    .soico-cta-conclusion-box {
        padding: 16px;
    }
    
    .soico-cta-conclusion-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .soico-cta-conclusion-title {
        font-size: 18px;
    }
    
    .soico-cta-button {
        padding: 14px 32px;
        font-size: 16px;
        width: 100%;
        max-width: 300px;
    }
    
    .soico-cta-inline {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .soico-cta-inline-button {
        width: 100%;
        text-align: center;
    }
    
    .soico-cta-comparison-table {
        font-size: 12px;
    }
    
    .soico-cta-comparison-table th,
    .soico-cta-comparison-table td {
        padding: 10px 8px;
    }
    
    .soico-cta-col-features {
        max-width: 200px;
    }
}

/* ==========================================================================
   SWELL テーマ互換性
   ========================================================================== */
.swell-block-columns .soico-cta-conclusion-box,
.swell-block-columns .soico-cta-inline {
    margin: 0;
}

.post_content .soico-cta-conclusion-features {
    padding-left: 20px;
    list-style-type: disc;
}

.post_content .soico-cta-comparison-table th,
.post_content .soico-cta-comparison-table td {
    border: none;
    border-bottom: 1px solid #ddd;
}

/* SWELLテーマのテーブルスタイルを上書き */
.post_content .soico-cta-comparison-table,
.post_content table.soico-cta-comparison-table,
body .soico-cta-comparison-table {
    background: #fff !important;
}

.post_content .soico-cta-comparison-table thead tr,
.post_content table.soico-cta-comparison-table thead tr,
body .soico-cta-comparison-table thead tr {
    background: linear-gradient(135deg, #1E3A5F 0%, #2C5282 100%) !important;
    color: #fff !important;
}

.post_content .soico-cta-comparison-table tbody tr,
.post_content table.soico-cta-comparison-table tbody tr,
body .soico-cta-comparison-table tbody tr {
    background: #fff !important;
}

.post_content .soico-cta-comparison-table tbody tr:nth-child(even),
.post_content table.soico-cta-comparison-table tbody tr:nth-child(even),
body .soico-cta-comparison-table tbody tr:nth-child(even) {
    background: #F8FAFC !important;
}

.post_content .soico-cta-comparison-table tbody tr:hover,
.post_content table.soico-cta-comparison-table tbody tr:hover,
body .soico-cta-comparison-table tbody tr:hover {
    background: #EDF2F7 !important;
}

.post_content .soico-cta-comparison-table tbody tr.soico-cta-row-highlight,
.post_content table.soico-cta-comparison-table tbody tr.soico-cta-row-highlight,
body .soico-cta-comparison-table tbody tr.soico-cta-row-highlight {
    background: #fff !important;
    border-left: 4px solid var(--soico-cta-primary) !important;
}

.post_content .soico-cta-comparison-table tbody tr.soico-cta-row-highlight:hover,
.post_content table.soico-cta-comparison-table tbody tr.soico-cta-row-highlight:hover,
body .soico-cta-comparison-table tbody tr.soico-cta-row-highlight:hover {
    background: #FFF5F0 !important;
}

/* SWELL .editor-content テーブルスタイル上書き */
.editor-content .soico-cta-comparison-table tr:nth-of-type(1) th,
.editor-content .soico-cta-comparison-table tr:nth-of-type(1) td,
.editor-content table.soico-cta-comparison-table tr:nth-of-type(1) th,
.editor-content table.soico-cta-comparison-table tr:nth-of-type(1) td {
    background-color: transparent !important;
    background: transparent !important;
    color: inherit !important;
}

/* thead（ヘッダー行）のスタイル */
.editor-content .soico-cta-comparison-table thead tr th,
.editor-content table.soico-cta-comparison-table thead tr th {
    background: linear-gradient(135deg, #1E3A5F 0%, #2C5282 100%) !important;
    color: #fff !important;
}

/* tbody（データ行）のスタイル */
.editor-content .soico-cta-comparison-table tbody tr td,
.editor-content table.soico-cta-comparison-table tbody tr td {
    background: #fff !important;
    color: #333 !important;
}

.editor-content .soico-cta-comparison-table tbody tr:nth-child(even) td,
.editor-content table.soico-cta-comparison-table tbody tr:nth-child(even) td {
    background: #F8FAFC !important;
}

.editor-content .soico-cta-comparison-table tbody tr:hover td,
.editor-content table.soico-cta-comparison-table tbody tr:hover td {
    background: #EDF2F7 !important;
}

.editor-content .soico-cta-comparison-table tbody tr.soico-cta-row-highlight td,
.editor-content table.soico-cta-comparison-table tbody tr.soico-cta-row-highlight td {
    background: #fff !important;
}

.editor-content .soico-cta-comparison-table tbody tr.soico-cta-row-highlight:hover td,
.editor-content table.soico-cta-comparison-table tbody tr.soico-cta-row-highlight:hover td {
    background: #FFF5F0 !important;
}
