/**
 * CSVチェックツール - 固有スタイル
 */

/* ========================================
   アップロードエリア
   ======================================== */

.upload-area {
    border: 3px dashed var(--border-light);
    border-radius: 16px;
    padding: 4rem 2rem;
    text-align: center;
    background: var(--bg-light);
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--schit-blue);
    background: #f0f8ff;
}

.upload-area.drag-over {
    border-color: var(--schit-blue);
    background: #e6f3ff;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 4rem;
    color: var(--schit-blue);
    margin-bottom: 1rem;
}

.upload-text {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-dark);
    margin: 1rem 0 0.5rem;
}

.upload-or {
    color: var(--text-medium);
    margin: 1rem 0;
}

.upload-hint {
    font-size: 0.9rem;
    color: var(--text-medium);
    margin-top: 1rem;
}

/* ========================================
   プログレスバー
   ======================================== */

.progress-container {
    margin: 2rem 0;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: var(--bg-light);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--schit-blue) 0%, var(--schit-green) 100%);
    border-radius: 15px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    margin-top: 0.75rem;
    color: var(--text-dark);
    font-weight: 500;
}

/* ========================================
   サマリーグリッド
   ======================================== */

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-light);
    border-radius: 12px;
    transition: transform 0.2s ease;
}

.summary-item:hover {
    transform: translateY(-2px);
}

.summary-item-wide {
    grid-column: span 3;
}

.summary-item i {
    font-size: 2rem;
    color: var(--schit-blue);
}

.summary-label {
    font-size: 0.85rem;
    color: var(--text-medium);
    margin-bottom: 0.25rem;
}

.summary-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    word-break: break-all;
    line-height: 1.4;
}

/* ========================================
   タブ
   ======================================== */

.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-light);
    padding-bottom: 0;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-medium);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-btn:hover {
    color: var(--schit-blue);
    background: var(--bg-light);
}

.tab-btn.active {
    color: var(--schit-blue);
    border-bottom-color: var(--schit-blue);
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: var(--text-medium);
    color: white;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
}

.tab-btn.active .badge {
    background: var(--schit-blue);
}

/* ========================================
   詳細結果
   ======================================== */

.details-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.result-item {
    padding: 1.25rem;
    border-radius: 12px;
    border-left: 4px solid;
    transition: all 0.2s ease;
}

.result-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.result-item-error {
    background: #fff5f5;
    border-left-color: var(--error-red);
}

.result-item-warning {
    background: #fff8f0;
    border-left-color: var(--schit-orange);
}

.result-item-empty {
    background: #fffef5;
    border-left-color: #ffc107;
}

.result-item-success {
    background: #f0fdf4;
    border-left-color: var(--schit-green);
}

.result-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.result-item i {
    font-size: 1.5rem;
    margin-top: 0.25rem;
}

.result-item-error i {
    color: var(--error-red);
}

.result-item-warning i {
    color: var(--schit-orange);
}

.result-item-empty i {
    color: #ffc107;
}

.result-item-success i {
    color: var(--schit-green);
}

.result-content {
    flex: 1;
}

.result-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.result-message {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.result-details {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: white;
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-medium);
    line-height: 1.6;
}

.no-results {
    text-align: center;
    padding: 2rem;
    color: var(--text-medium);
}

/* ========================================
   プレビューテーブル
   ======================================== */

.preview-container {
    margin-top: 1rem;
}

.preview-table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border-light);
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.preview-table thead {
    background: var(--schit-blue);
    color: white;
}

.preview-table th,
.preview-table td {
    padding: 0.75rem;
    text-align: left;
    border: 1px solid var(--border-light);
    white-space: nowrap;
}

.preview-table th {
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.preview-table tbody tr:nth-child(even) {
    background: var(--bg-light);
}

.preview-table tbody tr:hover {
    background: #f0f8ff;
}

.preview-table .row-number {
    background: #e8eef5;
    font-weight: 600;
    color: var(--text-dark);
    text-align: center;
    min-width: 50px;
}

.preview-table .empty-cell,
.full-data-container .empty-cell {
    background: #fff3cd;
}

.empty-indicator {
    color: var(--text-medium);
    font-style: italic;
    font-size: 0.85rem;
}

/* ========================================
   アクションボタン
   ======================================== */

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

/* ========================================
   モーダル
   ======================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 95%;
    max-width: 1400px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 2px solid var(--border-light);
}

.modal-header h2 {
    margin: 0;
    color: var(--text-dark);
    font-size: 1.5rem;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-medium);
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--error-red);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-info {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 8px;
    color: var(--text-dark);
}

.modal-info i {
    color: var(--schit-blue);
    margin-right: 0.5rem;
}

.modal-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.modal-info-row p {
    margin: 0;
}

.modal-options {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.header-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.header-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.header-toggle span {
    font-size: 0.95rem;
    color: var(--text-dark);
}

.full-data-container {
    border: 1px solid var(--border-light);
    border-radius: 8px;
}

/* 上部の横スクロールバー（固定表示） */
.horizontal-scroll-top {
    overflow-x: auto;
    overflow-y: hidden;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-light);
    height: 20px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.horizontal-scroll-top::before {
    content: '← 横スクロール →';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75rem;
    color: var(--text-medium);
    pointer-events: none;
    white-space: nowrap;
}

.horizontal-scroll-top-content {
    height: 20px;
}

/* メインのデータテーブルコンテナ */
.full-data-table-container {
    overflow: auto;
    max-height: 60vh;
}

.full-data-container table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.full-data-container thead {
    position: sticky;
    top: 0;
    background: var(--schit-blue);
    color: white;
    z-index: 10;
}

.full-data-container th,
.full-data-container td {
    padding: 0.75rem;
    text-align: left;
    border: 1px solid var(--border-light);
    white-space: nowrap;
}

.full-data-container tbody tr:nth-child(even) {
    background: var(--bg-light);
}

.full-data-container tbody tr:hover {
    background: #f0f8ff;
}

.full-data-container .row-number {
    background: #e8eef5;
    font-weight: 600;
    color: var(--text-dark);
    text-align: center;
    min-width: 50px;
    position: sticky;
    left: 0;
    z-index: 5;
}

/* ハイライト表示 */
.full-data-container td.highlight-error {
    background-color: #ffe6e6 !important;
    border-left: 3px solid var(--error-red) !important;
}

.full-data-container td.highlight-warning {
    background-color: #fff4e6 !important;
    border-left: 3px solid var(--warning-orange) !important;
}

.full-data-container td.highlight-empty {
    background-color: #fff3cd !important;
    border-left: 3px solid #ffc107 !important;
}

.full-data-container tr.highlight-error-row {
    background-color: #fff5f5 !important;
}

.full-data-container tr.highlight-warning-row {
    background-color: #fffbf0 !important;
}

.full-data-container tr.highlight-empty-row {
    background-color: #fffef5 !important;
}

/* ========================================
   情報ボックス
   ======================================== */

.info-notice {
    background: rgba(74, 144, 217, 0.1);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(74, 144, 217, 0.2);
    margin-bottom: 2rem;
}

.info-notice h4 {
    color: var(--primary-blue);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-notice ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
    list-style-type: disc;
}

.info-notice li {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

/* ========================================
   レスポンシブ対応
   ======================================== */

@media (max-width: 768px) {
    .upload-area {
        padding: 3rem 1rem;
    }

    .upload-icon {
        font-size: 3rem;
    }

    .upload-text {
        font-size: 1.1rem;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .tab-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
        white-space: nowrap;
    }

    .result-item {
        padding: 1rem;
    }

    .result-header {
        gap: 0.75rem;
    }

    .result-item i {
        font-size: 1.25rem;
    }

    .result-title {
        font-size: 1rem;
    }

    .preview-table {
        font-size: 0.8rem;
    }

    .preview-table th,
    .preview-table td {
        padding: 0.5rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .upload-area {
        padding: 2rem 1rem;
    }

    .upload-icon {
        font-size: 2.5rem;
    }

    .summary-item {
        padding: 1rem;
    }

    .summary-item i {
        font-size: 1.5rem;
    }
}
