/* ==========================================================================
   COMPARISON PAGE FIXES
   Fixes for tooltips, button alignment, and table improvements
   ========================================================================== */

/* Fix for Deep Research tooltips z-index */
.comparison-table tbody tr:first-child .metric-rating[data-tooltip]::after {
    z-index: 1000 !important;
}

.metric-rating[data-tooltip] {
    position: relative;
}

.metric-rating[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(44, 38, 37, 0.95);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    white-space: nowrap;
    max-width: 250px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.metric-rating[data-tooltip]:hover::after,
.metric-rating[data-tooltip]:focus::after {
    opacity: 1;
    visibility: visible;
    bottom: calc(100% + 5px);
}

/* Ensure first row tooltips appear above */
.comparison-table tbody tr:first-child .metric-rating[data-tooltip]::after {
    bottom: auto;
    top: calc(100% + 10px);
}

.comparison-table tbody tr:first-child .metric-rating[data-tooltip]:hover::after {
    bottom: auto;
    top: calc(100% + 5px);
}

/* Fix button alignment - ensure all CTAs are same height */
.product-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    height: 100%;
    text-align: center;
}

.product-card .btn-cta {
    margin-top: auto !important;
    align-self: stretch;
    width: 100%;
}

.product-header {
    vertical-align: top;
}

.product-header .product-card {
    min-height: 320px;
}

/* Corporate table improvements */
.table-scroll-container {
    position: relative;
    overflow: hidden;
}

.table-scroll-indicator {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(to left, white 0%, rgba(255,255,255,0) 100%);
    width: 60px;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
}

.table-scroll-indicator::after {
    content: '→';
    font-size: 24px;
    color: var(--warmth-primary);
    animation: slideHint 2s ease-in-out infinite;
}

@keyframes slideHint {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(5px); }
}

.comparison-table-wrapper {
    position: relative;
}

.comparison-table-wrapper.scrollable::after {
    content: 'Przesuń tabelę →';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--warmth-primary);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    pointer-events: none;
    animation: fadeInOut 3s ease-in-out;
    z-index: 100;
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

/* Better mobile handling for corporate table */
@media (max-width: 1024px) {
    .comparison-table-wrapper {
        margin: 0 -1rem;
        padding: 0 1rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .comparison-table {
        min-width: 900px;
    }

    .comparison-table-wrapper::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 20px;
        background: linear-gradient(to right, white, transparent);
        pointer-events: none;
        z-index: 10;
    }

    .comparison-table-wrapper::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 20px;
        background: linear-gradient(to left, white, transparent);
        pointer-events: none;
        z-index: 10;
    }
}

/* Ensure equal spacing for product cards */
.comparison-table thead th.product-header {
    width: 11.11%; /* 100% / 9 columns */
}

.comparison-table thead th.feature-name {
    width: 11.11%;
    text-align: center;
}

.comparison-table thead .sticky-column {
    text-align: center;
    padding-left: 0;
    padding-right: 0;
}

/* Badges are now properly positioned in comparison-table.css */

/* ==========================================================================
   OVERRIDE OLD FILTERS STYLES
   ========================================================================== */

/* Hide old filters-inline if it still exists */
.filters-inline:not(.comparison-toolbar-unified) {
    display: none !important;
}

/* ==========================================================================
   FAQ SINGLE COLUMN LAYOUT
   ========================================================================== */

/* Force single column for FAQ on comparison page */
.faq-section .faq-grid,
.faq-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 1.2rem !important;
    max-width: 800px !important;
    margin: 0 auto !important;
}

/* Responsive adjustments */
@media (min-width: 769px) {
    .faq-section .faq-grid,
    .faq-grid {
        grid-template-columns: 1fr !important;
    }
}
