* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary-color: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --our-color: #3b82f6;
    --company-a-color: #10b981;
    --company-b-color: #f59e0b;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --border-radius: 8px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    background-color: #f8fafc;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeIn 0.5s ease-in-out;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 700;
}

header p {
    color: var(--gray-700);
    font-size: 1.2rem;
}

.table-container {
    overflow-x: auto;
    margin-bottom: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

.comparison-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background-color: white;
    overflow: hidden;
    border-radius: var(--border-radius);
}

.comparison-table th,
.comparison-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    transition: all 0.2s ease;
}

.comparison-table tr:hover:not(.category-row) {
    background-color: var(--gray-100);
}

.feature-header {
    width: 30%;
    text-align: left;
    font-weight: 600;
    border-right: 1px solid var(--gray-200);
}

.company-header {
    width: 23.33%;
    font-weight: 600;
    position: relative;
    overflow: hidden;
    background-color: var(--gray-100);
}

.company-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
}

.our-company {
    color: var(--our-color);
}

.our-company::after {
    background-color: var(--our-color);
}

.company-a {
    color: var(--company-a-color);
}

.company-a::after {
    background-color: var(--company-a-color);
}

.company-b {
    color: var(--company-b-color);
}

.company-b::after {
    background-color: var(--company-b-color);
}

.feature-name {
    border-right: 1px solid var(--gray-200);
    text-align: left;
    padding-left: 1.25rem;
    flex-direction: column;
}

.feature-title {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.feature-description {
    font-size: 0.85rem;
    color: var(--gray-700);
}

.category-row {
    background: linear-gradient(90deg, var(--primary-light), var(--primary-dark));
    color: white;
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 10;
}

.category-row td {
    text-align: left;
    padding: 1rem 1.5rem;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
}

.has-feature {
    background-color: rgba(34, 197, 94, 0.05);
}

.partial-feature {
    background-color: rgba(245, 158, 11, 0.05);
}

.no-feature {
    background-color: rgba(239, 68, 68, 0.05);
}

footer {
    text-align: center;
    margin-top: 2rem;
    color: var(--gray-700);
    font-size: 0.9rem;
    animation: fadeIn 1s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .comparison-table {
        font-size: 0.9rem;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 0.75rem;
    }

    .category-row td {
        font-size: 1rem;
    }

    .feature-description {
        display: none;
    }
}

.pest-comparison-table .category-row {
    background: linear-gradient(90deg, #4b5563, #1f2937);
}

.pest-comparison-table .compliance-row {
    background: linear-gradient(90deg, #7c3aed, #4c1d95);
}

.pest-comparison-table .governance-row {
    background: linear-gradient(90deg, #2563eb, #1e40af);
}

.pest-comparison-table .feature-name {
    background-color: rgba(249, 250, 251, 0.8);
}

.pest-comparison-table .no-feature {
    color: #6b7280;
    font-style: italic;
}

.pest-comparison-table .has-feature {
    position: relative;
    padding-left: 1.5rem;
}

.pest-comparison-table .has-feature::before {
    content: "✓";
    position: absolute;
    left: 0.5rem;
    color: var(--success);
    font-weight: bold;
}

/* カテゴリごとの色分け */
.pest-comparison-table tr:nth-child(2),
.pest-comparison-table tr:nth-child(3),
.pest-comparison-table tr:nth-child(4) {
    border-left: 4px solid rgba(239, 68, 68, 0.7);
    /* Political - 赤系 */
}

.pest-comparison-table tr:nth-child(6),
.pest-comparison-table tr:nth-child(7),
.pest-comparison-table tr:nth-child(8),
.pest-comparison-table tr:nth-child(9) {
    border-left: 4px solid rgba(245, 158, 11, 0.7);
    /* Economic - オレンジ系 */
}

.pest-comparison-table tr:nth-child(11),
.pest-comparison-table tr:nth-child(12),
.pest-comparison-table tr:nth-child(13),
.pest-comparison-table tr:nth-child(14),
.pest-comparison-table tr:nth-child(15),
.pest-comparison-table tr:nth-child(16) {
    border-left: 4px solid rgba(16, 185, 129, 0.7);
    /* Social - 緑系 */
}

.pest-comparison-table tr:nth-child(18),
.pest-comparison-table tr:nth-child(19),
.pest-comparison-table tr:nth-child(20),
.pest-comparison-table tr:nth-child(21) {
    border-left: 4px solid rgba(59, 130, 246, 0.7);
    /* Technological - 青系 */
}

.pest-comparison-table tr:nth-child(23) {
    border-left: 4px solid rgba(139, 92, 246, 0.7);
    /* Compliance - 紫系 */
}

.pest-comparison-table tr:nth-child(25) {
    border-left: 4px solid rgba(14, 165, 233, 0.7);
    /* Governance - 水色系 */
}

/* 分析コントロール用スタイル */
.analysis-controls {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: space-between;
    /* 左右に分かれるよう配置を変更 */
}

/* 情報収集セクションの分析ボタンと同じスタイルを適用 */
.action-button {
    padding: 8px 16px;
    background-color: #2196F3;
    /* 青色のボタン */
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.action-button:hover {
    background-color: #0b7dda;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.loading-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 2s linear infinite;
}

#competitor-loading .loading-spinner {
    margin-right: 15px;
    margin-bottom: 0;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}
