/**
 * スクレイピングシステム V2 - スタイルシート
 * @version 2.0.0
 */

/* ============================================
   コンテナ
   ============================================ */
.sms-scraping-v2-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.sms-section-v2 {
    margin-bottom: 30px;
}

/* ============================================
   ヘッダー部分
   ============================================ */
.sms-v2-header {
    margin-bottom: 30px;
}

.sms-user-info-v2 {
    display: flex;
    gap: 30px;
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    flex-wrap: wrap;
}

.sms-info-item-v2 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sms-info-label {
    font-weight: 500;
    color: #666;
}

.sms-info-value {
    font-weight: bold;
    color: #333;
}

.sms-point-balance-v2 {
    color: #0073aa;
    font-size: 18px;
}

/* ============================================
   アラート
   ============================================ */
.sms-alert-v2 {
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
    border-left: 4px solid;
}

.sms-alert-warning-v2 {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.sms-alert-danger-v2 {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

/* ============================================
   サイト選択UI
   ============================================ */
.sms-site-controls-v2 {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.sms-control-button-v2 {
    padding: 8px 16px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.sms-control-button-v2:hover {
    background: #e0e0e0;
}

.sms-site-grid-v2 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.sms-site-item-v2 {
    padding: 20px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    background: #fff;
}

.sms-site-item-v2:hover {
    border-color: #0073aa;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.2);
}

.sms-site-item-v2.selected {
    border-color: #0073aa;
    background: #e7f5ff;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.sms-site-name-v2 {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.sms-site-status-v2 {
    font-size: 12px;
    color: #666;
}

.sms-no-sites-v2 {
    padding: 20px;
    text-align: center;
    color: #999;
}

/* ============================================
   価格設定
   ============================================ */
.sms-price-settings-v2 {
    background: #f8f9fa;
    padding: 20px;
}

.sms-price-settings-grid-v2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

/* ============================================
   タブ
   ============================================ */
.sms-tabs-v2 {
    margin-top: 20px;
}

.sms-tab-nav-v2 {
    display: flex;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 30px;
}

.sms-tab-nav-v2 a {
    padding: 12px 24px;
    text-decoration: none;
    color: #666;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
}

.sms-tab-nav-v2 a.active {
    color: #0073aa;
    border-bottom-color: #0073aa;
}

.sms-tab-nav-v2 a:hover {
    color: #0073aa;
}

.sms-tab-content-v2 {
    padding: 20px 0;
}

/* ============================================
   フォーム
   ============================================ */
.sms-form-v2 {
    /* Base form styles */
}

.sms-form-group-v2 {
    margin-bottom: 20px;
}

.sms-form-label-v2 {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.sms-form-required-v2 {
    color: #dc3545;
    margin-left: 4px;
}

.sms-form-input-v2,
.sms-form-select-v2 {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.sms-form-input-v2:focus,
.sms-form-select-v2:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.sms-form-help-v2 {
    font-size: 13px;
    color: #666;
    margin-top: 5px;
}

.sms-help-inline-v2 {
    font-size: 13px;
    font-weight: normal;
    color: #666;
    margin-left: 8px;
}

/* ラジオボタン */
.sms-radio-group-v2 {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.sms-radio-v2 {
    display: flex;
    align-items: center;
}

.sms-radio-v2 input[type="radio"] {
    margin-right: 6px;
    cursor: pointer;
}

.sms-radio-label-v2 {
    cursor: pointer;
    margin-bottom: 0;
}

/* フォームアイテム */
.sms-form-items-v2 {
    margin-bottom: 20px;
}

.omakase-item-v2,
.url-item-v2 {
    position: relative;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 15px;
    background: #fafafa;
}

.remove-item-v2 {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border: none;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: background 0.3s ease;
}

.remove-item-v2:hover {
    background: #c82333;
}

.sms-add-item-v2 {
    padding: 10px 20px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.sms-add-item-v2:hover {
    background: #218838;
}

/* ============================================
   コスト表示
   ============================================ */
.sms-cost-display-v2 {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 30px 0;
    border-left: 4px solid #0073aa;
}

.sms-cost-row-v2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.sms-cost-row-v2:last-child {
    margin-bottom: 0;
}

.sms-cost-row-v2.total {
    border-top: 1px solid #e0e0e0;
    padding-top: 10px;
    margin-top: 10px;
    font-weight: bold;
}

.sms-cost-label-v2 {
    color: #666;
    font-weight: 500;
}

.sms-cost-value-v2 {
    font-weight: bold;
    color: #333;
}

/* ============================================
   ボタン
   ============================================ */
.sms-btn-v2 {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
}

.sms-btn-primary-v2 {
    background: #0073aa;
    color: white;
}

.sms-btn-primary-v2:hover {
    background: #005a87;
}

.sms-btn-primary-v2:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.sms-btn-secondary-v2 {
    background: #6c757d;
    color: white;
}

.sms-btn-secondary-v2:hover {
    background: #545b62;
}

.sms-btn-success-v2 {
    background: #28a745;
    color: white;
}

.sms-btn-success-v2:hover {
    background: #218838;
}

.sms-btn-large-v2 {
    padding: 15px 30px;
    font-size: 16px;
    width: 100%;
}

.sms-btn-small-v2 {
    padding: 6px 12px;
    font-size: 13px;
}

.sms-submit-button-v2 {
    margin-top: 20px;
}

/* ============================================
   進捗表示
   ============================================ */
.sms-progress-v2 {
    width: 100%;
    height: 30px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin: 20px 0;
}

.sms-progress-bar-v2 {
    height: 100%;
    background: linear-gradient(90deg, #0073aa, #00a0d2);
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.sms-status-v2 {
    text-align: center;
    color: #666;
    margin-top: 10px;
}

/* ============================================
   レスポンシブデザイン
   ============================================ */
@media (max-width: 768px) {
    .sms-scraping-v2-container {
        padding: 10px;
    }

    .sms-user-info-v2 {
        flex-direction: column;
        gap: 15px;
    }

    .sms-site-grid-v2 {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    .sms-tab-nav-v2 {
        flex-direction: column;
    }

    .sms-tab-nav-v2 a {
        text-align: center;
        border-bottom: 1px solid #f0f0f0;
    }

    .sms-tab-nav-v2 a.active {
        border-left: 3px solid #0073aa;
        border-bottom: 1px solid #f0f0f0;
    }

    .sms-radio-group-v2 {
        flex-direction: column;
        gap: 10px;
    }

    .sms-price-settings-grid-v2 {
        grid-template-columns: 1fr;
    }

    .sms-cost-row-v2 {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .sms-site-grid-v2 {
        grid-template-columns: 1fr;
    }

    .sms-site-controls-v2 {
        flex-direction: column;
    }

    .sms-control-button-v2 {
        width: 100%;
    }
}

/* ============================================
   アクセシビリティ
   ============================================ */
.sms-site-item-v2:focus,
.sms-btn-v2:focus,
.sms-form-input-v2:focus,
.sms-form-select-v2:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* ============================================
   カードスタイル（既存のsms-cardと互換）
   ============================================ */
.sms-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.sms-card-header {
    margin-bottom: 20px;
}

.sms-card-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
}

.sms-card-subtitle {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* ============================================
   確認モーダル
   ============================================ */
.sms-modal-v2 {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.sms-modal-overlay-v2 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
}

.sms-modal-content-v2 {
    position: relative;
    max-width: 700px;
    max-height: 90vh;
    margin: 5vh auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sms-modal-header-v2 {
    padding: 24px 30px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.sms-modal-header-v2 h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.sms-modal-close-v2 {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    line-height: 28px;
    text-align: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.sms-modal-close-v2:hover {
    background: #e0e0e0;
    color: #333;
}

.sms-modal-body-v2 {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.sms-confirm-section-v2 {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f0f0f0;
}

.sms-confirm-section-v2:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.sms-confirm-heading-v2 {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 12px 0;
}

.sms-confirm-value-v2 {
    font-size: 16px;
    color: #333;
    line-height: 1.6;
    margin: 0;
}

.sms-confirm-value-v2 strong {
    color: #0073aa;
    font-weight: 600;
}

.sms-confirm-request-item-v2 {
    background: #f8f9fa;
    border-left: 3px solid #0073aa;
    padding: 12px 16px;
    margin-bottom: 12px;
    border-radius: 4px;
    line-height: 1.8;
}

.sms-confirm-request-item-v2:last-child {
    margin-bottom: 0;
}

.sms-confirm-request-item-v2 p {
    margin: 4px 0;
    font-size: 14px;
    color: #555;
}

.sms-confirm-request-item-v2 strong {
    display: block;
    color: #333;
    font-weight: 600;
    margin-bottom: 6px;
}

/* ============================================
   確認モーダル内のテーブル
   ============================================ */
.sms-confirm-table-v2 {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: white;
}

.sms-confirm-table-v2 thead {
    background: #f0f0f0;
}

.sms-confirm-table-v2 th,
.sms-confirm-table-v2 td {
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    text-align: left;
}

.sms-confirm-table-v2 th {
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.sms-confirm-table-v2 tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.sms-confirm-table-v2 tbody tr:hover {
    background: #e8f4f8;
}

.sms-confirm-table-v2 td {
    color: #333;
    word-break: break-word;
}

/* URL列専用スタイル */
.sms-table-url-cell-v2 {
    max-width: 300px;
    word-break: break-all;
    font-family: monospace;
    font-size: 12px;
    color: #0073aa;
}

.sms-confirm-highlight-v2 {
    background: #fff9e6;
    border: 2px solid #ffd700;
    border-radius: 8px;
    padding: 20px;
}

.sms-confirm-points-v2 {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sms-confirm-row-v2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    color: #333;
}

.sms-confirm-row-v2 span {
    flex: 1;
}

.sms-confirm-row-v2 strong {
    flex: 0 0 auto;
    font-weight: 600;
    color: #0073aa;
}

.sms-confirm-total-v2 {
    padding-top: 12px;
    border-top: 2px solid #ffd700;
    font-size: 18px;
    font-weight: 600;
}

.sms-confirm-total-v2 strong {
    color: #d63384;
    font-size: 20px;
}

.sms-confirm-points-value-v2 {
    color: #d63384 !important;
}

.sms-modal-footer-v2 {
    padding: 20px 30px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #f8f9fa;
}

.sms-modal-footer-v2 .sms-btn-v2 {
    min-width: 120px;
}

/* モーダルアニメーション */
.sms-modal-v2 {
    animation: fadeIn 0.3s ease;
}

.sms-modal-content-v2 {
    animation: slideUp 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* レスポンシブ */
@media (max-width: 768px) {
    .sms-modal-content-v2 {
        max-width: 95%;
        margin: 2vh auto;
        max-height: 96vh;
    }

    .sms-modal-header-v2,
    .sms-modal-body-v2,
    .sms-modal-footer-v2 {
        padding: 20px;
    }

    .sms-modal-footer-v2 {
        flex-direction: column;
    }

    .sms-modal-footer-v2 .sms-btn-v2 {
        width: 100%;
    }

    .sms-confirm-row-v2 {
        font-size: 14px;
    }

    .sms-confirm-total-v2 {
        font-size: 16px;
    }
}
