/* VPN Finder CSS */

/* VPN Finder CSS - 最終最適化版 */

/* メインコンテナ */
.vpn-finder-container {
    max-width: 500px;
    margin: 0 auto 10px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 10px;
    font-size: 12px;
    box-sizing: border-box;
}

/* ヘッダー */
.vpn-finder-header {
    text-align: center;
    padding-bottom: 8px;
    border-bottom: 1px solid #ddd;
    margin-bottom: 8px;
}

.vpn-finder-header h2 {
    font-size: 14px;
    margin: 0 0 3px;
    line-height: 1.3;
}

.vpn-finder-header p {
    font-size: 11px;
    color: #666;
    margin: 0;
    line-height: 1.2;
}

/* ステップインジケーター - 非表示 */
.vpn-finder-steps {
    display: none;
}

/* ステップコンテンツ */
.vpn-finder-step {
    margin-bottom: 8px;
}

.vpn-finder-step h3 {
    font-size: 13px;
    margin: 0 0 6px;
    text-align: center;
    line-height: 1.2;
}

/* オプション選択 - 改善版 */
.vpn-finder-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 4px;
    margin-bottom: 8px;
}

.vpn-option {
    background: #f8f8f8;
    border: 2px solid #ccc; /* より明確な枠線 */
    border-radius: 3px;
    padding: 4px 2px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 45px;
    box-sizing: border-box;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05); /* 影を追加 */
}

.vpn-option:hover {
    background: #f0f0f0;
    border-color: #bbb;
}

.vpn-option.selected {
    border-color: #3498db;
    border-width: 2px;
    background: #e6f3fb;
    box-shadow: 0 1px 3px rgba(52, 152, 219, 0.3);
}

.vpn-option .icon {
    font-size: 14px;
    color: #3498db;
    display: block;
    margin-bottom: 2px;
    height: 16px;
    line-height: 1;
}

.vpn-option h4 {
    margin: 0;
    padding: 0 2px;
    font-size: 10px;
    font-weight: normal;
    line-height: 1.1;
    max-width: 100%;
    display: block;
    word-break: keep-all;
    width: 100%;
    height: 22px;
}

.vpn-option p {
    display: none;
}

/* ステップ3（料金vs速度）用特別ルール */
#step-3 .vpn-finder-options {
    grid-template-columns: repeat(2, 1fr); /* 常に2列に */
}

#step-3 .vpn-option {
    padding: 4px 10px;
    height: 50px; /* より大きく */
}

#step-3 .vpn-option h4 {
    font-size: 12px;
    font-weight: bold;
}

/* ステップ6（企業選択）用特別ルール */
#step-6 .vpn-finder-options {
    grid-template-columns: repeat(1, 1fr); /* 常に1列に */
}

#step-6 .vpn-option {
    padding: 4px 10px;
    height: 50px;
    flex-direction: row; /* 横並び */
    justify-content: flex-start;
    text-align: left;
}

#step-6 .vpn-option .icon {
    margin-right: 10px;
    margin-bottom: 0;
}

#step-6 .vpn-option h4 {
    font-size: 12px;
    font-weight: bold;
    text-align: left;
}

/* サマリー */
.vpn-finder-summary {
    background: #f8f8f8;
    border-radius: 3px;
    padding: 6px;
    margin-bottom: 8px;
    font-size: 11px;
    line-height: 1.2;
    border: 1px solid #ddd;
}

.vpn-finder-summary p {
    margin: 0 0 3px;
}

.vpn-finder-summary p:last-child {
    margin-bottom: 0;
}

/* ナビゲーションボタン */
.vpn-finder-nav {
    display: flex;
    justify-content: space-between;
    gap: 6px;
}

.vpn-finder-nav button {
    padding: 6px 10px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 500;
    font-size: 12px;
    transition: opacity 0.15s;
    flex: 1;
    text-align: center;
    line-height: 1.2;
}

.prev-step {
    background: #f0f0f0;
    color: #555;
    border: 1px solid #ddd;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.next-step, #get-recommendations, #start-over {
    background: #3498db;
    color: white;
    border: 1px solid #2980b9;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.vpn-finder-nav button:hover {
    opacity: 0.9;
}

.vpn-finder-nav button:disabled {
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
    border-color: #ccc;
    box-shadow: none;
}

/* ローディング */
.vpn-finder-loading {
    text-align: center;
    padding: 10px;
}

.vpn-finder-loading .spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin: 0 auto 6px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.vpn-finder-loading p {
    margin: 0;
    font-size: 12px;
    color: #666;
}

/* 結果表示 */
.vpn-results-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vpn-result-item {
    background: #f8f8f8;
    border-radius: 3px;
    padding: 8px;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
        "header title"
        "features features"
        "pricing pricing"
        "cta cta";
    gap: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    border: 1px solid #ddd;
}

.vpn-result-header {
    grid-area: header;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-right: 8px;
}

.vpn-rank {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3498db;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 10px;
    margin-bottom: 4px;
    border: 1px solid #2980b9;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.vpn-logo {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    background: white;
    border-radius: 3px;
    padding: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.vpn-logo img {
    max-width: 90%;
    max-height: 90%;
}

.vpn-result-title {
    grid-area: title;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.vpn-result-title h4 {
    font-size: 13px;
    margin: 0 0 2px;
    line-height: 1.2;
}

.vpn-score {
    font-size: 10px;
    color: #666;
}

.vpn-features {
    grid-area: features;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    border-top: 1px solid #ddd;
    padding-top: 6px;
}

.vpn-features .feature {
    background: white;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 10px;
    line-height: 1.1;
    border: 1px solid #ddd;
    box-shadow: 0 1px 1px rgba(0,0,0,0.03);
}

.vpn-features .label {
    font-weight: bold;
    margin-right: 2px;
}

.vpn-pricing {
    grid-area: pricing;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    border-top: 1px solid #ddd;
    padding-top: 6px;
}

.vpn-pricing .price {
    text-align: center;
    font-size: 10px;
    line-height: 1.2;
    background: white;
    padding: 3px;
    border-radius: 3px;
    border: 1px solid #ddd;
    box-shadow: 0 1px 1px rgba(0,0,0,0.03);
}

.vpn-pricing .monthly {
    color: #e74c3c;
}

.vpn-pricing .yearly {
    color: #27ae60;
}

.vpn-cta {
    grid-area: cta;
    text-align: center;
    margin-top: 3px;
}

.vpn-cta-button {
    display: inline-block;
    background: #3498db;
    color: white;
    padding: 5px 12px;
    border-radius: 3px;
    text-decoration: none;
    font-weight: 500;
    font-size: 11px;
    transition: all 0.15s ease;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #2980b9;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.vpn-cta-button:hover {
    background: #2980b9;
}

/* モバイル最適化 */
@media (max-width: 480px) {
    .vpn-finder-container {
        width: 100%;
        margin: 0;
        border-radius: 0;
        padding: 8px;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .vpn-finder-options {
        grid-template-columns: repeat(3, 1fr); /* スマホでは常に3列に */
    }
    
    .vpn-option {
        height: 42px;
    }
    
    .vpn-option h4 {
        font-size: 9px;
        height: 19px;
    }
    
    #step-3 .vpn-finder-options {
        grid-template-columns: repeat(2, 1fr); /* 料金vs速度は常に2列に */
    }
    
    #step-6 .vpn-finder-options {
        grid-template-columns: 1fr; /* 企業選択は常に1列に */
    }
    
    .vpn-pricing {
        grid-template-columns: 1fr;
        gap: 3px;
    }
}

/* 超小型画面対応 */
@media (max-width: 360px) {
    .vpn-finder-container {
        padding: 6px;
    }
    
    .vpn-option {
        height: 40px;
        padding: 3px 1px;
    }
    
    .vpn-option .icon {
        font-size: 12px;
        margin-bottom: 1px;
    }
    
    .vpn-option h4 {
        font-size: 8px;
        height: 18px;
    }
}

/* ダークテーマ対応 */
.dark .vpn-finder-container {
    background: #1f2937;
    color: #f3f4f6;
}

.dark .vpn-finder-header {
    border-bottom-color: #374151;
}

.dark .vpn-finder-header p {
    color: #9ca3af;
}

.dark .vpn-option {
    background: #374151;
    border-color: #4b5563;
}

.dark .vpn-option:hover {
    background: #4b5563;
}

.dark .vpn-option.selected {
    border-color: #3b82f6;
    background: #1e40af;
}

.dark .vpn-option h4 {
    color: #f3f4f6;
}

.dark .vpn-finder-summary {
    background: #374151;
    border-color: #4b5563;
}

.dark .prev-step {
    background: #4b5563;
    color: #f3f4f6;
    border-color: #6b7280;
}

.dark .vpn-result-item {
    background: #374151;
    border-color: #4b5563;
}

.dark .vpn-logo {
    background: #1f2937;
    border-color: #4b5563;
}

.dark .vpn-features {
    border-top-color: #4b5563;
}

.dark .vpn-features .feature {
    background: #1f2937;
    border-color: #4b5563;
}

.dark .vpn-pricing {
    border-top-color: #4b5563;
}

.dark .vpn-pricing .price {
    background: #1f2937;
    border-color: #4b5563;
    color: #d1d5db;
}

.dark .vpn-pricing .monthly {
    color: #ef4444;
}

.dark .vpn-pricing .yearly {
    color: #10b981;
}

.dark .vpn-score {
    color: #9ca3af;
}
}