/* 買取シミュレーション フロントエンドスタイル */

.buyback-simulation-container {
    margin: 0 auto;
}

.buyback-simulation-header {
    background: linear-gradient(135deg, #c580ff, #D9B4FF);
    color: white;
    padding: 20px;
    border-radius: 10px 10px 0 0;
    text-align: center;
    margin-bottom: 0;
}

.buyback-simulation-title {
    margin: 0;
    font-size: 24px;
    font-weight: bold;
}

.buyback-simulation-input {
    background: #f8f9fa;
    padding: 25px;
    border: 1px solid #e9ecef;
    border-top: none;
}

.buyback-simulation-input label {
    display: block;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
    font-size: 16px;
    text-align: center;
}

.slider-container {
    position: relative;
    margin-bottom: 20px;
}

.buyback-amount-slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.buyback-amount-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ff6b35;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.buyback-amount-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ff6b35;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 14px;
    color: #666;
}

.current-amount {
    text-align: center;
    font-size: 15px;
    font-weight: bold;
    color: #333;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 2px solid #C9F;
    margin-bottom: 20px;
}

.current-amount span {
    color: #B366FF;
    font-size: 1.5em;
}

.buyback-simulation-results {
    background: white;
    border: 1px solid #e9ecef;
    border-top: none;
    border-radius: 0 0 10px 10px;
    padding: 20px;
}

#buyback-sites-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.buyback-site-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    background: #fafafa;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
}

.buyback-site-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.buyback-site-card:nth-child(1) {
    border-left: 4px solid #ffd700;
    background: linear-gradient(135deg, #fff9e6, #fafafa);
}

.buyback-site-card:nth-child(2) {
    border-left: 4px solid #c0c0c0;
    background: linear-gradient(135deg, #f8f9fa, #fafafa);
}

.buyback-site-card:nth-child(3) {
    border-left: 4px solid #cd7f32;
    background: linear-gradient(135deg, #fdf6e6, #fafafa);
}

.site-rank {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.rank-badge {
    display: inline-block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    text-align: center;
    line-height: 40px;
    font-weight: bold;
    font-size: 14px;
    color: white;
}

.rank-1 {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #333;
}

.rank-2 {
    background: linear-gradient(135deg, #c0c0c0, #e0e0e0);
    color: #333;
}

.rank-3 {
    background: linear-gradient(135deg, #cd7f32, #daa520);
}

.rank-4,
.rank-5,
.rank-6,
.rank-7,
.rank-8,
.rank-9,
.rank-10 {
    background: linear-gradient(135deg, #6c757d, #495057);
}

.site-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 15px;
    padding-top: 10px;
}

.site-logo img {
    max-width: 130px;
    max-height: 52px;
    object-fit: contain;
}

.site-name {
    font-size: .8em;
    font-weight: bold;
    color: #555;
}

.site-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.buyback-amount {
    background: #28a745;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 18px;
    min-width: 140px;
    text-align: center;
    position: relative;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.buyback-amount::before {
    content: "💰 買取金額";
    display: block;
    font-size: 12px;
    font-weight: normal;
    margin-bottom: 2px;
    opacity: 0.9;
}

.site-link {
    margin-top: 5px;
}

.site-link a,
.site-link span {
    background: #ff6b35;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
    transition: all 0.3s ease;
    cursor: pointer;
}

.site-link a:hover,
.site-link span:hover {
    background: #e55a2b;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.no-sites-message {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

/* タブレット対応 */
@media (max-width: 1024px) and (min-width: 769px) {
    #buyback-sites-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* モバイル対応 */
@media (max-width: 768px) {
    #buyback-sites-list {
        display: flex;
        overflow-x: auto;
        gap: 15px;
        padding: 10px 0;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }
    
    /* スクロールバーのスタイリング */
    #buyback-sites-list::-webkit-scrollbar {
        height: 8px;
    }
    
    #buyback-sites-list::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 10px;
    }
    
    #buyback-sites-list::-webkit-scrollbar-thumb {
        background: #c580ff;
        border-radius: 10px;
    }
    
    #buyback-sites-list::-webkit-scrollbar-thumb:hover {
        background: #b366ff;
    }
    
    .buyback-site-card {
        min-width: 280px;
        flex-shrink: 0;
        margin-bottom: 0;
        flex-direction: column;
        text-align: center;
        padding: 15px;
        padding-top: 25px;
        position: relative;
        scroll-snap-align: start;
    }
    
    .site-rank {
        position: absolute;
        top: -10px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 2;
        margin-right: 0;
    }
    
    .site-info {
        flex: 1;
        margin-bottom: 15px;
        padding-top: 10px;
        align-items: center;
        text-align: center;
    }
    
    .site-actions {
        align-items: center;
        width: 100%;
    }
    
    .slider-labels {
        font-size: 12px;
    }
    
    .current-amount {
        font-size: 16px;
    }
    
    /* スライダーインジケーター */
    .buyback-simulation-results::after {
        content: "←→ スワイプして他の買取サイトを確認";
        display: block;
        text-align: center;
        margin-top: 10px;
        font-size: 12px;
        color: #666;
        font-style: italic;
    }
}

/* ローディングアニメーション */
.buyback-amount.calculating {
    background: #6c757d;
    position: relative;
    overflow: hidden;
}

.buyback-amount.calculating::before {
    content: "💰 買取金額";
    display: block;
    font-size: 12px;
    font-weight: normal;
    margin-bottom: 2px;
    opacity: 0.9;
}

.buyback-amount.calculating::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: loading 1.5s infinite;
    z-index: 1;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}
