/**
 * AI Category Comparison - Premium Layout
 * Summary Table + Detailed Brand Cards
 */

:root {
    --ai-fuchsia: #ff00c8;
    --ai-cyan: #00f2ff;
    --ai-violet: #8b5cf6;
    --ai-green: #06ffa8;
    --ai-red: #ff4757;
    --ai-gold: #ffd700;
    --ai-bg-dark: #0a0a0a;
    --ai-bg-card: #0d0d0d;
    --ai-border: rgba(255, 0, 200, 0.2);
}

/* ========== PAGE WRAPPER ========== */
.ai-category-page-wrapper {
    padding: 40px 0 80px;
    background: var(--ai-bg-dark);
    min-height: 100vh;
}

/* ========== BREADCRUMB ========== */
.ai-breadcrumb {
    margin-bottom: 20px;
}

.ai-breadcrumb ol {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 8px;
    flex-wrap: wrap;
}

.ai-breadcrumb li {
    font-size: 13px;
    color: #666;
}

.ai-breadcrumb li:not(:last-child)::after {
    content: '›';
    margin-left: 8px;
    color: var(--ai-violet);
}

.ai-breadcrumb a {
    color: var(--ai-cyan);
    text-decoration: none;
}

/* ========== MAIN HEADER ========== */
.ai-category-header {
    text-align: center;
    margin-bottom: 15px;
}

.ai-category-header h1 {
    font-size: 42px;
    font-weight: 900;
    color: #fff;
    margin-bottom: 0;
}

.ai-category-header h1 .highlight {
    color: var(--ai-cyan);
}

.ai-category-header .dynamic-date {
    color: var(--ai-fuchsia);
}

.ai-header-subtitle {
    font-size: 16px;
    color: #888;
    margin-top: 15px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.ai-header-subtitle .next-update {
    color: var(--ai-green);
    font-weight: 600;
}

/* ========== SUMMARY TABLE ========== */
.ai-summary-section {
    margin: 40px 0;
}

.ai-summary-table-wrapper {
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.1) 0%, rgba(10, 10, 10, 0.95) 100%);
    border-radius: 20px;
    border: 1px solid var(--ai-border);
    overflow: visible;
    box-shadow: 0 0 60px rgba(139, 92, 246, 0.15);
}

@media (max-width: 991px) {
    .ai-summary-table-wrapper {
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch;
    }
}

.ai-summary-table {
    width: 100%;
    border-collapse: collapse;
}

.ai-summary-table thead {
    background: linear-gradient(90deg, rgba(255, 0, 200, 0.15), rgba(139, 92, 246, 0.2), rgba(0, 242, 255, 0.15));
}

.ai-summary-table th {
    padding: 18px 15px;
    text-align: center;
    color: var(--ai-cyan);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-bottom: 2px solid var(--ai-fuchsia);
}

.ai-summary-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s;
}

.ai-summary-table tbody tr:hover {
    background: rgba(255, 0, 200, 0.05);
}

.ai-summary-table td {
    padding: 20px 15px;
    text-align: center;
    vertical-align: middle;
    color: #ccc;
    font-size: 14px;
}

/* Rank */
.ai-summary-table .col-rank {
    width: 80px;
    font-size: 20px;
    font-weight: 900;
    color: var(--ai-fuchsia);
}

.ai-summary-table tbody tr:first-child .col-rank {
    color: var(--ai-gold);
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

/* Tool Name */
.ai-summary-table .col-tool {
    text-align: left;
    font-weight: 700;
    color: #fff;
    font-size: 15px;
}

/* Score */
.ai-summary-table .col-score {
    color: var(--ai-cyan);
    font-weight: 800;
    font-size: 18px;
}

/* Free Tier */
.ai-summary-table .col-free .yes {
    color: var(--ai-green);
}

.ai-summary-table .col-free .no {
    color: #666;
}

/* Crypto */
.ai-summary-table .col-crypto .yes {
    color: var(--ai-green);
    font-weight: 700;
}

.ai-summary-table .col-crypto .no {
    color: #555;
}

/* Best For */
.ai-summary-table .col-best {
    font-size: 13px;
    color: #aaa;
    max-width: 180px;
}

/* Pricing */
.ai-summary-table .col-pricing {
    font-size: 13px;
    color: #fff;
}

.ai-summary-table .col-pricing .discount {
    color: var(--ai-green);
    font-weight: 600;
}

/* Try Now Button */
.ai-summary-table .btn-try {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--ai-fuchsia), var(--ai-violet));
    color: #fff;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s;
    white-space: nowrap;
}

.ai-summary-table .btn-try:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 25px rgba(255, 0, 200, 0.5);
}

/* ========== DETAILED BRANDS SECTION ========== */
.ai-brands-section {
    margin-top: 60px;
}

.ai-brands-section-title {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--ai-border);
}

/* Brand Card */
.ai-brand-card {
    background: var(--ai-bg-card);
    border-radius: 20px;
    border: 1px solid var(--ai-border);
    margin-bottom: 40px;
    overflow: hidden;
    transition: all 0.3s;
}

.ai-brand-card:hover {
    border-color: var(--ai-fuchsia);
    box-shadow: 0 10px 40px rgba(255, 0, 200, 0.15);
}

/* Card Main Content */
.ai-brand-card-main {
    display: flex;
    gap: 30px;
    padding: 30px;
}

/* Brand Image - Full image, no crop */
.ai-brand-image {
    flex-shrink: 0;
    width: 282px !important;
    height: 340px !important;
    min-width: 282px;
    min-height: 340px;
    border-radius: 12px;
    overflow: hidden;
}

.ai-brand-image img {
    width: 282px !important;
    height: 340px !important;
    min-width: 282px;
    min-height: 340px;
    display: block;
    object-fit: cover;
}

/* Brand Info */
.ai-brand-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ai-brand-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 15px;
}

.ai-brand-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-weight: 900;
    font-size: 18px;
    margin-right: 15px;
    flex-shrink: 0;
}

.ai-brand-rank.rank-1 {
    background: linear-gradient(135deg, var(--ai-gold), #ffaa00);
    color: #000;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.ai-brand-rank.rank-2 {
    background: linear-gradient(135deg, #c0c0c0, #888);
    color: #000;
}

.ai-brand-rank.rank-3 {
    background: linear-gradient(135deg, #cd7f32, #8b4513);
    color: #fff;
}

.ai-brand-rank.rank-default {
    background: rgba(0, 242, 255, 0.1);
    color: var(--ai-cyan);
    border: 2px solid var(--ai-cyan);
}

.ai-brand-title-group {
    flex: 1;
}

.ai-brand-name {
    font-size: 26px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 8px 0;
}

.ai-brand-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 13px;
    color: #666;
}

.ai-brand-meta .date-added {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* User Feedback */
.ai-brand-feedback {
    display: flex;
    align-items: center;
    gap: 25px;
    margin: 20px 0;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.ai-feedback-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-feedback-stars {
    color: var(--ai-gold);
    font-size: 18px;
    letter-spacing: 2px;
}

.ai-feedback-score {
    font-size: 24px;
    font-weight: 900;
    color: var(--ai-cyan);
}

.ai-feedback-votes {
    font-size: 12px;
    color: #666;
}

.ai-feedback-likes {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ai-fuchsia);
    font-size: 16px;
}

.ai-feedback-likes .heart {
    font-size: 20px;
}

/* Brand Excerpt */
.ai-brand-excerpt {
    font-size: 15px;
    color: #aaa;
    line-height: 1.7;
    margin-bottom: 20px;
}

/* Action Buttons */
.ai-brand-actions {
    display: flex;
    gap: 15px;
    margin-top: auto;
}

.ai-brand-actions .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--ai-fuchsia), var(--ai-violet));
    color: #fff;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.3s;
}

.ai-brand-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 0, 200, 0.4);
}

.ai-brand-actions .btn-secondary {
    display: inline-flex;
    align-items: center;
    padding: 14px 28px;
    background: transparent;
    color: var(--ai-cyan);
    text-decoration: none;
    border: 2px solid var(--ai-cyan);
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
}

.ai-brand-actions .btn-secondary:hover {
    background: var(--ai-cyan);
    color: #000;
}

/* Pros/Cons Table */
.ai-brand-pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.ai-pros-section,
.ai-cons-section {
    padding: 25px 30px;
}

.ai-pros-section {
    background: rgba(6, 255, 168, 0.03);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.ai-cons-section {
    background: rgba(255, 71, 87, 0.03);
}

.ai-pros-title,
.ai-cons-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-pros-title {
    color: var(--ai-green);
}

.ai-cons-title {
    color: var(--ai-red);
}

.ai-pros-list,
.ai-cons-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ai-pros-list li,
.ai-cons-list li {
    padding: 8px 0;
    padding-left: 22px;
    position: relative;
    font-size: 14px;
    color: #bbb;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.ai-pros-list li:last-child,
.ai-cons-list li:last-child {
    border-bottom: none;
}

.ai-pros-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--ai-green);
    font-weight: bold;
}

.ai-cons-list li::before {
    content: '✗';
    position: absolute;
    left: 0;
    color: var(--ai-red);
    font-weight: bold;
}

/* ========== SIDEBAR ========== */
.ai-categories-sidebar {
    background: var(--ai-bg-card);
    border-radius: 16px;
    padding: 25px;
    border: 1px solid var(--ai-border);
    position: sticky;
    top: 100px;
}

.ai-categories-sidebar h3 {
    font-size: 14px;
    color: #fff;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ai-categories-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ai-categories-menu li {
    margin-bottom: 3px;
}

.ai-categories-menu a {
    display: block;
    padding: 10px 12px;
    color: #777;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.3s;
}

.ai-categories-menu a:hover {
    background: rgba(255, 0, 200, 0.1);
    color: var(--ai-cyan);
}

/* ========== DEBUG & UTILITIES ========== */
.ai-debug-box {
    background: rgba(139, 92, 246, 0.1);
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 10px;
    font-size: 12px;
}

.ai-debug-box h4 {
    color: var(--ai-cyan);
    margin-bottom: 10px;
    font-size: 13px;
}

.ai-debug-box p {
    color: #888;
    margin: 4px 0;
}

.ai-debug-box strong {
    color: var(--ai-fuchsia);
}

.ai-debug-box code {
    background: rgba(0,0,0,0.3);
    padding: 2px 5px;
    border-radius: 3px;
    color: var(--ai-green);
}

.ai-debug-box ul {
    margin: 8px 0;
    padding-left: 18px;
}

.ai-debug-box li {
    color: #666;
    margin: 2px 0;
}

.ai-no-brands {
    text-align: center;
    padding: 50px;
    background: var(--ai-bg-card);
    border-radius: 16px;
}

.ai-no-brands h3 {
    color: var(--ai-fuchsia);
}

.ai-no-brands p {
    color: #666;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1200px) {
}

@media (max-width: 991px) {
    .ai-summary-table-wrapper {
        overflow-x: auto;
    }
    
    .ai-summary-table {
        min-width: 900px;
    }
    
    .ai-brand-card-main {
        flex-direction: column;
    }
    
    .ai-brand-image {
        margin: 0 auto;
    }
    
    .ai-brand-pros-cons {
        grid-template-columns: 1fr;
    }
    
    .ai-pros-section {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .ai-categories-sidebar {
        position: relative;
        top: 0;
        margin-top: 40px;
    }
    
    .ai-category-header h1 {
        font-size: 28px;
    }
}

@media (max-width: 576px) {
    .ai-brand-card-main {
        padding: 20px;
    }
    
    .ai-brand-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .ai-brand-feedback {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .ai-brand-actions {
        flex-direction: column;
    }
    
    .ai-brand-name {
        font-size: 22px;
    }
}

/* ========== TABLE OF CONTENTS - Categoria Prova ========== */
/* Usa stessi stili delle review (definiti in custom.css) */
.ai-category-page-wrapper .table-of-contents-wrapper {
    position: sticky;
    top: 100px;
}

.ai-category-page-wrapper .table-of-contents {
    max-height: calc(100vh - 150px);
    overflow-y: auto;
}

@media (max-width: 991px) {
    .ai-category-page-wrapper .table-of-contents-wrapper {
        position: relative;
        top: 0;
        margin-top: 30px;
    }
}

/* ========== CATEGORY DESCRIPTION SECTION ========== */
.ai-category-description {
    margin-top: 60px;
    padding: 40px;
    background: linear-gradient(135deg, rgba(20, 18, 30, 0.95), rgba(30, 25, 45, 0.95));
    border: 1px solid rgba(255, 0, 200, 0.3);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.ai-category-description::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #ff00c8, #00f2ff, transparent);
}

.ai-category-description h2 {
    color: #fff;
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 25px 0;
    background: linear-gradient(135deg, #ff00c8, #00f2ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.category-description-content {
    color: #BDC1C6;
    font-size: 16px;
    line-height: 1.8;
}

.category-description-content p {
    margin-bottom: 15px;
}

.category-description-content a {
    color: #00f2ff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.category-description-content a:hover {
    color: #ff00c8;
}

/* TOC special items styling */
.toc-title-link .toc-link,
.toc-description-link .toc-link {
    font-weight: 600;
    color: #00f2ff;
}

.toc-title-link .toc-link:hover,
.toc-description-link .toc-link:hover {
    color: #ff00c8;
}

@media (max-width: 991px) {
    .ai-category-description {
        margin-top: 40px;
        padding: 25px;
    }
    
    .ai-category-description h2 {
        font-size: 22px;
    }
}

/* ========== CATEGORY CONTENT SECTION (ACF cstm-content) ========== */
.ai-category-content {
    margin-top: 60px;
    padding: 40px;
    background: linear-gradient(135deg, rgba(20, 18, 30, 0.95), rgba(30, 25, 45, 0.95));
    border: 1px solid rgba(255, 0, 200, 0.3);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.ai-category-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #ff00c8, #00f2ff, transparent);
}

.category-content-wrapper {
    color: #BDC1C6;
    font-size: 16px;
    line-height: 1.8;
}

.category-content-wrapper h2 {
    color: #fff;
    font-size: 26px;
    font-weight: 700;
    margin: 40px 0 20px 0;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 0, 200, 0.2);
    background: linear-gradient(135deg, #ff00c8, #00f2ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.category-content-wrapper > p:first-child,
.category-content-wrapper > *:first-child {
    margin-top: 0;
}

.category-content-wrapper h2:first-of-type {
    margin-top: 35px;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 0, 200, 0.2);
}

.category-content-wrapper p {
    margin-bottom: 20px;
}

.category-content-wrapper a {
    color: #00f2ff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.category-content-wrapper a:hover {
    color: #ff00c8;
}

/* TOC content links styling */
.toc-content-link .toc-link {
    font-weight: 500;
    color: #BDC1C6;
    padding-left: 10px;
    border-left: 2px solid rgba(255, 0, 200, 0.3);
}

.toc-content-link .toc-link:hover {
    color: #00f2ff;
    border-left-color: #00f2ff;
}

@media (max-width: 991px) {
    .ai-category-content {
        margin-top: 40px;
        padding: 25px;
    }
    
    .category-content-wrapper h2 {
        font-size: 22px;
    }
}

/* Override per .single-post-thumbnail nelle brand card */
.ai-brand-card-main .single-post-thumbnail {
    flex-shrink: 0 !important;
    width: 282px !important;
    height: 340px !important;
    min-width: 282px !important;
    min-height: 340px !important;
    border-radius: 12px !important;
    overflow: hidden !important;
}

.ai-brand-card-main .single-post-thumbnail img {
    width: 282px !important;
    height: 340px !important;
    min-width: 282px !important;
    min-height: 340px !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    display: block !important;
}

/* Video in brand card */
.ai-brand-card-main .single-post-thumbnail video.brand-video {
    width: 282px !important;
    height: 340px !important;
    min-width: 282px !important;
    min-height: 340px !important;
    object-fit: cover !important;
    object-position: center top !important;
    display: block !important;
}

/* ========== MOBILE STICKY TOC BAR ========== */
/* Mobile TOC bar - hidden on desktop */
.mobile-toc-bar {
    display: none !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: linear-gradient(135deg, #1a1625 0%, #2d1f3d 100%);
    border-top: 2px solid rgba(255, 0, 200, 0.5);
    padding: 12px 15px;
    gap: 10px;
    align-items: center;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.5);
}

.mobile-toc-dropdown {
    flex: 1;
    position: relative;
}

.mobile-toc-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0,0,0,0.4);
    border: 2px solid rgba(0, 242, 255, 0.5);
    border-radius: 8px;
    padding: 12px 16px;
    width: 100%;
    color: #00f2ff;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-toc-toggle:hover,
.mobile-toc-toggle.active {
    background: rgba(0, 242, 255, 0.1);
    border-color: #00f2ff;
}

.toc-icon {
    font-size: 18px;
    color: #ff00c8;
}

.mobile-toc-menu {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: #1a1625;
    border: 2px solid rgba(255, 0, 200, 0.4);
    border-radius: 12px 12px 0 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.mobile-toc-menu.active {
    max-height: 60vh;
    overflow-y: auto;
    opacity: 1;
}

.mobile-toc-item {
    display: block;
    padding: 14px 20px;
    color: #BDC1C6;
    text-decoration: none;
    font-size: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transition: all 0.2s ease;
}

.mobile-toc-item:hover,
.mobile-toc-item:active {
    background: rgba(255, 0, 200, 0.1);
    color: #00f2ff;
}

.mobile-toc-item:last-child {
    border-bottom: none;
}

.mobile-cta-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #9b2d7b 0%, #5a1a4a 100%);
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.mobile-cta-btn:hover {
    background: linear-gradient(135deg, #b83d8b 0%, #7a2a6a 100%);
    transform: scale(1.02);
}

.cta-arrow {
    font-size: 18px;
}

/* ========== MOBILE TABLE HORIZONTAL SCROLL ========== */
@media (max-width: 991px) {
    .mobile-toc-bar {
        display: flex !important;
    }
    
    /* Hide desktop TOC on mobile */
    .table-of-contents-wrapper.desktop-view {
        display: none;
    }
    
    /* Add bottom padding to content for sticky bar */
    .ai-category-page-wrapper {
        padding-bottom: 80px;
    }
    
    /* Horizontal scrollable table */
    .ai-summary-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: #ff00c8 #1a1625;
    }
    
    .ai-summary-table-wrapper::-webkit-scrollbar {
        height: 8px;
    }
    
    .ai-summary-table-wrapper::-webkit-scrollbar-track {
        background: #1a1625;
        border-radius: 4px;
    }
    
    .ai-summary-table-wrapper::-webkit-scrollbar-thumb {
        background: linear-gradient(90deg, #ff00c8, #00f2ff);
        border-radius: 4px;
    }
    
    .ai-summary-table {
        min-width: 800px;
    }
    
    /* Scroll hint indicator */
    .ai-summary-table-wrapper::after {
        content: '← Scroll →';
        display: block;
        text-align: center;
        color: rgba(0, 242, 255, 0.6);
        font-size: 12px;
        padding: 8px;
        font-style: italic;
    }
}

@media (max-width: 576px) {
    .mobile-toc-bar {
        flex-direction: row;
        padding: 10px;
        gap: 8px;
    }
    
    .mobile-toc-toggle {
        padding: 10px 12px;
        font-size: 11px;
    }
    
    .mobile-cta-btn {
        padding: 10px 14px;
        font-size: 11px;
    }
    
    .toc-label {
        display: block;
    }
}

/* ========== NEW CARD LAYOUT: Info Left, Image Right ========== */
.ai-brand-card-top {
    display: flex !important;
    flex-direction: row !important;
    gap: 30px;
    align-items: flex-start;
    padding: 30px;
}

.ai-brand-info-left {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 20px;
    order: 1 !important;
}

.ai-brand-image-right {
    flex-shrink: 0 !important;
    width: 282px !important;
    height: 340px !important;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: #1a1a1a;
    order: 2 !important;
}

.ai-brand-image-right {
    position: relative;
    background: #1a1a1a;
    overflow: hidden;
}

.ai-brand-image-right img,
.ai-brand-image-right video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: auto;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Fallback per immagini mancanti */
.ai-brand-image-right img[src=""],
.ai-brand-image-right img:not([src]),
.ai-brand-image-right:has(img[src=""]) {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d1f3d 100%);
}

.ai-brand-image-right:has(img[src=""])::before {
    content: attr(alt);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #666;
    font-size: 14px;
    text-align: center;
    z-index: 1;
}

.ai-brand-card-bottom {
    margin-top: 0;
    padding: 20px 30px 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-brand-card-bottom .ai-brand-excerpt {
    margin: 0 0 15px 0;
    color: #BDC1C6;
    line-height: 1.7;
}

/* Scroll to top button */
.mobile-scroll-top-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    border: 2px solid rgba(0, 242, 255, 0.5);
    border-radius: 8px;
    padding: 12px 20px;
    color: #00f2ff;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.mobile-scroll-top-btn:hover {
    background: rgba(0, 242, 255, 0.15);
    border-color: #00f2ff;
}

.scroll-arrow {
    font-size: 16px;
}

/* Mobile responsive for new card layout */
@media (max-width: 991px) {
    .ai-brand-card-top {
        flex-direction: column !important;
        padding: 20px;
    }
    
    /* Mobile: Header (title+date) first, then image, then rest */
    .ai-brand-info-left {
        display: contents !important; /* Allow children to be reordered */
    }
    
    .ai-brand-header {
        order: 1 !important; /* Title and date first */
        width: 100%;
    }
    
    .ai-brand-image-right {
        order: 2 !important; /* Image second */
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 3/4;
        max-width: 300px;
        margin: 0 auto 20px auto;
    }
    
    .ai-brand-feedback {
        order: 3 !important;
        width: 100%;
    }
    
    .ai-brand-actions {
        order: 4 !important;
        width: 100%;
    }
    
    .ai-brand-excerpt-wrapper {
        order: 5 !important;
        width: 100%;
    }
    
    .ai-brand-pros-cons {
        order: 6 !important;
        width: 100%;
    }
    
    .ai-brand-card-bottom {
        padding: 20px;
    }
}

/* ========== CARD STYLING FIXES ========== */
/* Brand name bigger and uppercase */
.ai-brand-name {
    font-size: 28px !important;
    text-transform: uppercase !important;
    font-weight: 800 !important;
    letter-spacing: 1px !important;
}

/* Reduce spacing in cards */
.ai-brand-card-top {
    gap: 20px !important;
    padding: 20px !important;
}

.ai-brand-info-left {
    gap: 12px !important;
}

.ai-brand-header {
    gap: 10px !important;
    margin-bottom: 0 !important;
}

.ai-brand-feedback {
    padding: 12px 15px !important;
    margin: 5px 0 !important;
}

.ai-brand-actions {
    gap: 10px !important;
    margin-top: 5px !important;
}

.ai-brand-actions .btn-primary,
.ai-brand-actions .btn-secondary {
    padding: 12px 20px !important;
}

.ai-brand-card-bottom {
    padding: 15px 20px 20px !important;
    margin-top: 0 !important;
}

.ai-brand-pros-cons {
    padding: 15px 20px !important;
    gap: 20px !important;
}

/* ========== RANK NEXT TO TITLE ========== */
.ai-brand-header {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 15px !important;
}

.ai-brand-rank {
    flex-shrink: 0 !important;
}

.ai-brand-title-group {
    flex: 1 !important;
}

/* ========== REDUCE TABLE COLUMN SPACING ========== */
.ai-summary-table th:first-child,
.ai-summary-table td:first-child {
    width: 60px !important;
    padding-left: 15px !important;
    padding-right: 5px !important;
}

.ai-summary-table th:nth-child(2),
.ai-summary-table td:nth-child(2) {
    padding-left: 5px !important;
}

/* ========== TOC ACTIVE STATE (Scroll Spy) - Same as hover effect ========== */
.toc-link.active,
.toc-item-active .toc-link {
    color: #00ffff !important;
    background: rgba(255, 0, 255, 0.1) !important;
    border-left-color: #ff00ff !important;
    transform: translateX(4px) !important;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.5) !important;
    font-weight: 700 !important;
    transition: all 0.3s ease !important;
}

.toc-link.active::before,
.toc-item-active .toc-link::before {
    color: #00ffff !important;
    transform: translateX(2px) !important;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.5) !important;
}

/* ========== RESPONSIVE TABLES - MOBILE SCROLL ========== */
@media (max-width: 768px) {
    /* Summary table scroll wrapper */
    .ai-summary-table-wrapper {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: thin;
        scrollbar-color: #ff00c8 #1a1625;
        margin: 0 -15px;
        padding: 0 15px;
        position: relative;
    }
    
    .ai-summary-table {
        min-width: 700px !important;
        width: max-content !important;
    }
    
    .ai-summary-table th,
    .ai-summary-table td {
        padding: 12px 10px !important;
        font-size: 12px !important;
        white-space: nowrap;
    }
    
    .ai-summary-table .col-rank {
        font-size: 16px !important;
        width: 50px !important;
    }
    
    .ai-summary-table .col-tool {
        font-size: 13px !important;
        min-width: 100px;
    }
    
    .ai-summary-table .col-score {
        font-size: 14px !important;
    }
    
    .ai-summary-table .col-best {
        max-width: 120px !important;
        font-size: 11px !important;
    }
    
    .ai-summary-table .col-pricing {
        font-size: 11px !important;
        white-space: nowrap;
    }
    
    .ai-summary-table .btn-try {
        padding: 8px 16px !important;
        font-size: 11px !important;
    }
    
    /* Scroll hint */
    .ai-summary-table-wrapper::before {
        content: '← Scroll horizontally →';
        display: block;
        text-align: center;
        color: rgba(0, 242, 255, 0.7);
        font-size: 11px;
        padding: 8px 0;
        margin-bottom: 10px;
    }
}

/* ========== PROS/CONS TABLES RESPONSIVE ========== */
@media (max-width: 768px) {
    .ai-brand-pros-cons {
        flex-direction: column !important;
        gap: 15px !important;
    }
    
    .ai-pros-column,
    .ai-cons-column {
        width: 100% !important;
        flex: none !important;
    }
}

/* ========== NEW LAYOUT: Pros/Cons before Excerpt ========== */
.ai-brand-info-left .ai-brand-pros-cons {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-brand-info-left .ai-pros-section,
.ai-brand-info-left .ai-cons-section {
    flex: 1;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.ai-brand-info-left .ai-pros-title {
    color: #00ffa8;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.ai-brand-info-left .ai-cons-title {
    color: #ff4757;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.ai-brand-info-left .ai-pros-list,
.ai-brand-info-left .ai-cons-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ai-brand-info-left .ai-pros-list li {
    color: #ccc;
    font-size: 13px;
    padding: 4px 0;
    padding-left: 18px;
    position: relative;
}

.ai-brand-info-left .ai-pros-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #00ffa8;
}

.ai-brand-info-left .ai-cons-list li {
    color: #ccc;
    font-size: 13px;
    padding: 4px 0;
    padding-left: 18px;
    position: relative;
}

.ai-brand-info-left .ai-cons-list li::before {
    content: '✗';
    position: absolute;
    left: 0;
    color: #ff4757;
}

.ai-brand-excerpt-wrapper {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-brand-excerpt-wrapper .ai-brand-excerpt {
    color: #aaa;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

@media (max-width: 768px) {
    .ai-brand-info-left .ai-brand-pros-cons {
        flex-direction: column;
        gap: 10px;
    }
}
