/* ============================
   DVTV Mail Manager - 検疫管理CSS
   ============================ */

/* 全体ラップ */
.dvtv-quarantine-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.dvtv-quarantine-wrap h2 {
    margin: 0 0 20px;
    font-size: 24px;
    color: #1e3a5f;
}

/* タブナビゲーション */
.dvtv-quarantine-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

.dvtv-tab {
    padding: 10px 16px;
    text-decoration: none;
    color: #555;
    background: #f5f5f5;
    border-radius: 6px 6px 0 0;
    font-size: 14px;
    transition: all 0.2s;
}

.dvtv-tab:hover {
    background: #e8e8e8;
    color: #333;
}

.dvtv-tab.active {
    background: #1e3a5f;
    color: #fff;
}

/* セクション */
.dvtv-quarantine-section {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.dvtv-quarantine-section h3 {
    margin: 0 0 10px;
    font-size: 18px;
    color: #1e3a5f;
}

.dvtv-quarantine-section .description {
    color: #666;
    margin-bottom: 20px;
    font-size: 14px;
}

/* インラインフォーム */
.dvtv-inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.dvtv-inline-form input,
.dvtv-inline-form select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.dvtv-inline-form input:focus,
.dvtv-inline-form select:focus {
    outline: none;
    border-color: #1e3a5f;
    box-shadow: 0 0 0 2px rgba(30,58,95,0.1);
}

/* テーブル */
.dvtv-quarantine-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.dvtv-quarantine-table th,
.dvtv-quarantine-table td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid #e8e8e8;
}

.dvtv-quarantine-table th {
    background: #f5f7fa;
    font-weight: 600;
    color: #555;
}

.dvtv-quarantine-table tbody tr:hover {
    background: #fafbfc;
}

.dvtv-quarantine-table code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
    word-break: break-all;
}

.dvtv-empty {
    text-align: center;
    color: #999;
    padding: 30px !important;
}

/* バッジ */
.dvtv-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.dvtv-badge-domain {
    background: #e3f2fd;
    color: #1565c0;
}

.dvtv-badge-email {
    background: #f3e5f5;
    color: #7b1fa2;
}

/* ステータスバッジ */
.dvtv-status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.dvtv-status-safe {
    background: #e8f5e9;
    color: #2e7d32;
}

.dvtv-status-caution {
    background: #fff3e0;
    color: #e65100;
}

.dvtv-status-danger {
    background: #ffebee;
    color: #c62828;
}

/* ルールバッジ */
.dvtv-rule-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
}

.dvtv-rule-whitelist { background: #e8f5e9; color: #2e7d32; }
.dvtv-rule-blacklist { background: #ffebee; color: #c62828; }
.dvtv-rule-keyword { background: #fff3e0; color: #e65100; }
.dvtv-rule-ai { background: #e3f2fd; color: #1565c0; }

/* ボタン */
.dvtv-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.dvtv-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.dvtv-btn-primary {
    background: #1e3a5f;
    color: #fff;
}

.dvtv-btn-primary:hover:not(:disabled) {
    background: #2c4a73;
}

.dvtv-btn-secondary {
    background: #6c757d;
    color: #fff;
}

.dvtv-btn-secondary:hover:not(:disabled) {
    background: #5a6268;
}

.dvtv-btn-success {
    background: #28a745;
    color: #fff;
}

.dvtv-btn-success:hover:not(:disabled) {
    background: #218838;
}

.dvtv-btn-danger {
    background: #dc3545;
    color: #fff;
}

.dvtv-btn-danger:hover:not(:disabled) {
    background: #c82333;
}

.dvtv-btn-info {
    background: #17a2b8;
    color: #fff;
}

.dvtv-btn-info:hover:not(:disabled) {
    background: #138496;
}

.dvtv-btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

/* フィルター */
.dvtv-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 15px;
}

.dvtv-filter-btn {
    padding: 6px 12px;
    text-decoration: none;
    color: #555;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 13px;
}

.dvtv-filter-btn:hover {
    background: #e0e0e0;
}

.dvtv-filter-btn.active {
    background: #1e3a5f;
    color: #fff;
}

.dvtv-filter-count {
    color: #888;
    font-size: 13px;
}

/* ログテーブル */
.dvtv-logs-table .dvtv-corrected {
    background: #fffde7;
}

.dvtv-corrected-mark {
    display: inline-block;
    padding: 1px 5px;
    background: #fff59d;
    border-radius: 3px;
    font-size: 10px;
    margin-right: 5px;
}

.dvtv-action-cell {
    white-space: nowrap;
}

.dvtv-action-cell .dvtv-btn {
    margin-right: 3px;
}

/* ページネーション */
.dvtv-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e8e8e8;
}

.dvtv-page-btn {
    padding: 6px 12px;
    background: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
}

.dvtv-page-btn:hover {
    background: #e0e0e0;
}

.dvtv-page-info {
    color: #666;
    font-size: 14px;
}

/* 統計 */
.dvtv-stats-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.dvtv-stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 25px;
    border-radius: 8px;
    min-width: 100px;
}

.dvtv-stat-safe { background: #e8f5e9; }
.dvtv-stat-danger { background: #ffebee; }

.dvtv-stat-number {
    font-size: 28px;
    font-weight: 700;
    color: #333;
}

.dvtv-stat-label {
    font-size: 13px;
    color: #666;
    margin-top: 5px;
}

/* ヒント */
.dvtv-hint {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.dvtv-hint ul {
    margin: 10px 0 0 20px;
    padding: 0;
}

.dvtv-hint li {
    margin: 5px 0;
}

/* 設定カード */
.dvtv-settings-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.dvtv-settings-card h4 {
    margin: 0 0 15px;
    font-size: 16px;
    color: #333;
}

.dvtv-form-group {
    margin-bottom: 15px;
}

.dvtv-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.dvtv-form-group input,
.dvtv-form-group select,
.dvtv-form-group textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
}

.dvtv-form-group .description {
    margin-top: 5px;
    font-size: 12px;
    color: #888;
}

.dvtv-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.dvtv-status-ok {
    color: #2e7d32;
    font-weight: 500;
}

.dvtv-status-error {
    color: #c62828;
    font-weight: 500;
}

/* フローダイアグラム */
.dvtv-flow-diagram {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dvtv-flow-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.dvtv-flow-num {
    width: 28px;
    height: 28px;
    background: #1e3a5f;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.dvtv-flow-text {
    flex: 1;
    font-weight: 500;
}

.dvtv-flow-result {
    color: #666;
    font-size: 13px;
}

/* モーダル */
.dvtv-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.dvtv-modal-content {
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.dvtv-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.dvtv-modal-header h4 {
    margin: 0;
    font-size: 18px;
}

.dvtv-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #888;
    padding: 0;
    line-height: 1;
}

.dvtv-modal-close:hover {
    color: #333;
}

.dvtv-modal-body {
    padding: 20px;
}

.dvtv-modal-body .dvtv-form-group {
    margin-bottom: 15px;
}

.dvtv-modal-body .dvtv-form-actions {
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .dvtv-quarantine-tabs {
        gap: 3px;
    }
    
    .dvtv-tab {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .dvtv-inline-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .dvtv-inline-form input,
    .dvtv-inline-form select {
        width: 100% !important;
    }
    
    .dvtv-quarantine-table {
        font-size: 12px;
    }
    
    .dvtv-quarantine-table th,
    .dvtv-quarantine-table td {
        padding: 8px 5px;
    }
    
    .dvtv-action-cell .dvtv-btn {
        padding: 3px 6px;
        font-size: 11px;
    }
}

/* 詳細モーダル */
.dvtv-modal-detail {
    max-width: 600px;
}

.dvtv-detail-row {
    margin-bottom: 15px;
}

.dvtv-detail-row label {
    display: block;
    font-weight: 600;
    color: #555;
    margin-bottom: 5px;
    font-size: 13px;
}

.dvtv-detail-text {
    background: #f8f9fa;
    padding: 10px 12px;
    border-radius: 4px;
    word-break: break-word;
    line-height: 1.5;
}

.dvtv-detail-reason {
    min-height: 60px;
    white-space: pre-wrap;
}

.dvtv-score-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #e0e0e0;
    border-radius: 4px;
    font-size: 12px;
    margin-left: 10px;
}

.dvtv-reason-link {
    cursor: pointer;
    color: #1565c0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.dvtv-reason-link:hover {
    text-decoration: underline;
}

.dvtv-view-detail {
    opacity: 0.6;
    font-size: 14px;
}

.dvtv-reason-link:hover .dvtv-view-detail {
    opacity: 1;
}
