:root {
    --primary: #0066CC;
    --primary-dark: #004C99;
    --primary-light: #E6F0FA;
    --accent: #FF8C00;
    --accent-light: #FFF3E6;
    --success: #22C55E;
    --warning: #F59E0B;
    --neutral: #64748B;
    --bg-light: #F8FAFC;
    --bg-white: #FFF;
    --text-dark: #1E293B;
    --text-muted: #64748B;
    --border: #E2E8F0;
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 24px
}

.page-header {
    text-align: center;
    margin-bottom: 48px
}

.page-header h1 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.02em
}

.page-header p {
    font-size: 1.125rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 24px;
    margin-bottom: 100px
}

.tool-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 2px solid var(--border);
    padding: 24px;
    transition: all 0.25s ease;
    position: relative
}

.tool-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md)
}

.tool-card.selected {
    border-color: var(--primary);
    background: var(--primary-light)
}

.tool-card.selected .compare-checkbox {
    background: var(--primary);
    border-color: var(--primary)
}

.tool-card.selected .compare-checkbox svg {
    opacity: 1
}

.tool-badge {
    display: inline-flex;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 6px;
    margin-bottom: 16px;
    background: var(--accent-light);
    color: var(--accent)
}

.tool-badge.best-overall {
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    color: #B45309
}

.tool-badge.enterprise {
    background: var(--primary-light);
    color: var(--primary)
}

.tool-badge.ai-powered {
    background: #F3E8FF;
    color: #7C3AED
}

.tool-badge.open-source {
    background: #DCFCE7;
    color: #16A34A
}

.tool-header {
    display: flex;
    gap: 16px;
    margin-bottom: 20px
}

.tool-logo {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    border: 1px solid var(--border);
    overflow: hidden;
    background: #fff
}

.tool-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px
}

.tool-info h3 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 4px
}

.tool-rating {
    display: flex;
    align-items: center;
    gap: 8px
}

.rating-score {
    font-size: 1.125rem;
    font-weight: 700
}

.rating-stars {
    display: flex;
    gap: 2px
}

.rating-stars svg {
    width: 18px;
    height: 18px;
    fill: #FBBF24
}

.rating-stars svg.empty {
    fill: #E5E7EB
}

.rating-source {
    font-size: 0.8rem;
    color: var(--text-muted)
}

.highlight-feature {
    background: linear-gradient(135deg, var(--primary-light), #DBEAFE);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
    display: flex;
    gap: 12px
}

.highlight-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0
}

.highlight-icon svg {
    width: 20px;
    height: 20px;
    stroke: var(--primary);
    fill: none;
    stroke-width: 2
}

.highlight-content h4 {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 4px
}

.highlight-content p {
    font-size: 0.875rem;
    line-height: 1.5
}

.quick-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    margin-bottom: 20px
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px
}

.stat-value {
    font-size: 0.95rem;
    font-weight: 600
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem
}

.status-indicator.excellent {
    color: var(--success)
}

.status-indicator.good {
    color: var(--warning)
}

.status-indicator.limited {
    color: var(--neutral)
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%
}

.status-dot.excellent {
    background: var(--success)
}

.status-dot.good {
    background: var(--warning)
}

.status-dot.limited {
    background: var(--neutral)
}

.expandable-section {
    border-top: 1px solid var(--border)
}

.expand-trigger {
    display: flex;
    justify-content: space-between;
    padding: 14px 0;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    font-family: inherit;
    text-align: left
}

.expand-trigger span {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary)
}

.expand-trigger svg {
    width: 20px;
    height: 20px;
    stroke: var(--primary);
    fill: none;
    stroke-width: 2;
    transition: transform 0.2s
}

.expand-trigger.active svg {
    transform: rotate(180deg)
}

.expand-content {
    display: none;
    padding-bottom: 16px
}

.expand-content.active {
    display: block
}

.expand-content p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-dark)
}

.pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px
}

.pros-list,
.cons-list {
    list-style: none
}

.pros-list li,
.cons-list li {
    display: flex;
    gap: 8px;
    font-size: 0.875rem;
    margin-bottom: 8px;
    line-height: 1.4
}

.pros-list li::before {
    content: '✓';
    color: var(--success);
    font-weight: 700
}

.cons-list li::before {
    content: '✗';
    color: #EF4444;
    font-weight: 700
}

.compare-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    cursor: pointer
}

.compare-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s
}

.compare-checkbox svg {
    width: 14px;
    height: 14px;
    stroke: white;
    fill: none;
    stroke-width: 3;
    opacity: 0;
    transition: opacity 0.2s
}

.compare-checkbox-label {
    font-size: 0.875rem;
    color: var(--text-muted)
}

.compare-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    padding: 16px 24px;
    transform: translateY(100%);
    transition: transform 0.3s;
    z-index: 1000
}

.compare-bar.visible {
    transform: translateY(0)
}

.compare-bar-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px
}

.selected-tools {
    display: flex;
    gap: 12px;
    flex: 1
}

.selected-tool-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px
}

.chip-logo {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    overflow: hidden
}

.chip-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain
}

.selected-tool-chip span {
    font-size: 0.875rem;
    font-weight: 500
}

.remove-chip {
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s
}

.remove-chip:hover {
    background: var(--border)
}

.remove-chip svg {
    width: 16px;
    height: 16px;
    stroke: var(--text-muted);
    fill: none;
    stroke-width: 2
}

.add-tool-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    font-size: 0.875rem;
    color: var(--text-muted)
}

.compare-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s
}

.compare-btn:hover {
    background: var(--primary-dark)
}

.compare-btn:disabled {
    background: var(--border);
    cursor: not-allowed
}

.compare-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    z-index: 2000;
    padding: 40px 24px;
    overflow-y: auto
}

.compare-modal.active {
    display: flex
}

.compare-modal-content {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 1100px;
    margin: auto
}

.compare-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--border)
}

.compare-modal-header h2 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.5rem;
    font-weight: 700
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    font-size: 0.95rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px
}

.compare-table-wrapper {
    padding: 24px
}

.compare-cards-header {
    display: grid;
    gap: 24px;
    margin-bottom: 32px
}

.compare-cards-header.cols-2 {
    grid-template-columns: repeat(2, 1fr)
}

.compare-cards-header.cols-3 {
    grid-template-columns: repeat(3, 1fr)
}

.compare-card-mini {
    text-align: center;
    padding: 24px;
    background: var(--bg-light);
    border-radius: var(--radius-md)
}

.mini-logo {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    border-radius: var(--radius-md);
    background: var(--bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    border: 1px solid var(--border);
    overflow: hidden
}

.mini-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px
}

.compare-card-mini h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px
}

.cta-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px
}

.website-link {
    display: block;
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--text-muted)
}

.compare-section {
    border-top: 1px solid var(--border)
}

.compare-section-header {
    background: var(--bg-light);
    padding: 16px 24px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center
}

.compare-section-header h3 {
    font-size: 1rem;
    font-weight: 700
}

.compare-section-header svg {
    width: 20px;
    height: 20px;
    transition: transform 0.2s;
    stroke: currentColor;
    fill: none;
    stroke-width: 2
}

.compare-section-header.active svg {
    transform: rotate(180deg)
}

.compare-section-content {
    display: none
}

.compare-section-content.active {
    display: block
}

.compare-row {
    display: table;
    width: 100%;
    table-layout: fixed;
    border-bottom: 1px solid var(--border)
}

.compare-row-label {
    display: table-cell;
    width: 180px;
    padding: 16px 24px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    vertical-align: middle;
    background: var(--bg-light)
}

.compare-cells {
    display: table-cell;
    vertical-align: middle
}

.compare-cells-inner {
    display: grid;
    gap: 0
}

.compare-cells-inner.cols-2 {
    grid-template-columns: repeat(2, 1fr)
}

.compare-cells-inner.cols-3 {
    grid-template-columns: repeat(3, 1fr)
}

.compare-cell {
    padding: 16px 24px;
    font-size: 0.95rem;
    border-left: 1px solid var(--border)
}

.compare-cell .value {
    font-weight: 600
}

@media(max-width:900px) {
    .tools-grid {
        grid-template-columns: 1fr
    }

    .compare-cards-header.cols-2,
    .compare-cards-header.cols-3 {
        grid-template-columns: 1fr
    }

    .compare-row {
        display: block
    }

    .compare-row-label {
        display: block;
        width: 100%;
        padding: 12px 24px
    }

    .compare-cells {
        display: block
    }

    .compare-cells-inner.cols-2,
    .compare-cells-inner.cols-3 {
        grid-template-columns: 1fr
    }

    .compare-cell {
        border-left: none;
        border-top: 1px solid var(--border)
    }

    .compare-bar-inner {
        flex-direction: column
    }

    .selected-tools {
        flex-wrap: wrap;
        justify-content: center
    }
}

/* Intro/Outro Styles */
.intro-container {
    max-width: 800px;
    margin: 0 auto 40px;
    position: relative;
}

/* Ensure iframe adjusts width */
iframe {
    width: 100%;
    border: none;
    overflow: hidden;
    display: block;
}

.intro-content {
    overflow: hidden;
    transition: height 0.3s ease;
    position: relative;
}

.intro-content.collapsed {
    height: 60px !important;
    overflow: hidden;
}

.intro-content.collapsed::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to bottom, transparent, var(--bg-light));
    pointer-events: none;
}

.read-more-btn {
    display: block;
    margin: 12px auto 0;
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 4px 8px;
}

.read-more-btn:hover {
    text-decoration: underline;
}

.outro-container {
    max-width: 800px;
    margin: 60px auto 0;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}