﻿/* ==========================================================================
   PRICING TABLE COMPONENT
   Consolidated styles from results.css and bootcamp.css
   ========================================================================== */

.feature-comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 2rem;
    /* Top margin zeroed out, bottom kept for spacing */
    text-align: center;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

/* Flush top for specialized page containers */
.results-container .feature-comparison-table {
    margin-top: 1.25rem;
    /* Small gap for the badge to sit in */
    border-top: none;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

/* Manually apply radius */
.feature-comparison-table thead tr th:first-child {
    border-top-left-radius: 12px;
}

.feature-comparison-table thead tr th:last-child {
    border-top-right-radius: 12px;
}

.feature-comparison-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 12px;
}

.feature-comparison-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 12px;
}

/* Override glass-card padding */
.feature-comparison-table.glass-card {
    padding: 0 !important;
}

/* Cell padding and alignment */
.feature-comparison-table th {
    padding: 1.15rem 1.5rem;
    /* Reduced vertical padding */
    border-bottom: 4px solid rgba(226, 232, 240, 0.6);
    text-align: center;
    position: relative;
    vertical-align: middle;
    transition: background-color 0.4s ease, border-color 0.4s ease, color 0.4s ease;
}

.feature-comparison-table td {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    text-align: center;
    position: relative;
    vertical-align: middle;
    transition: background-color 0.4s ease, border-color 0.4s ease, color 0.4s ease;
}

.feature-comparison-table th *,
.feature-comparison-table td * {
    transition: color 0.4s ease, background-color 0.4s ease, border-color 0.4s ease;
}

/* Exempt buttons from the restricted transition above */
.feature-comparison-table th .tier-btn,
.feature-comparison-table td .tier-btn,
.feature-comparison-table th .cta-button,
.feature-comparison-table td .cta-button {
    transition: all 0.3s ease !important;
}

.feature-comparison-table tr:last-child td {
    border-bottom: none;
}

/* === TYPOGRAPHY HIERARCHY === */

/* 1. Header Row */
.feature-comparison-table th {
    background: rgba(248, 250, 252, 0.8);
    /* Slate 50 */
    font-weight: 700;
    color: var(--text-main);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    width: 25%;
    /* Default for 4 columns */
}

.feature-comparison-table th:first-child {
    width: 25%;
}

/* Column Subheadings (e.g., "Owner-Producer") */
.header-subtext {
    display: block;
    opacity: 0.9;
    margin-top: 0;
    /* Zeroed out to compact height */
    font-size: 1rem !important;
    /* Scaled up */
}

/* 2. Standard Text (Feature Names, Phase Titles) */
.feature-comparison-table td {
    color: var(--text-main);
    font-size: 1rem;
}

/* 3. Detail Text (Subheadings under Features) */
.table-subtext {
    display: block;
    font-size: 0.85rem !important;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 0.25rem;
}

/* 4. Highlight Text (Prices, Seat Counts) - Standardized to 1rem */
.price-stack strong,
.price-accent,
.feature-comparison-table td strong {
    font-size: 1rem !important;
    font-weight: 700 !important;
    /* Bold makes 1rem feel substantial */
    color: var(--text-main) !important;
    line-height: 1.2;
}

.price-stack {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0 !important;
    width: 100%;
}

.feature-comparison-table .price-stack strong {
    color: #7c3aed !important;
    /* Purple */
    margin-bottom: 0.25rem;
}

.price-accent {
    color: #0f172a !important;
    /* Black */
    margin-top: 0;
}

/* Grant Info Trigger Button inside table */
.grant-info-trigger {
    text-align: center;
    width: auto !important;
    font-size: 1rem !important;
    line-height: inherit;
    font-family: inherit;
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    position: relative;
}

/* Compact Line Spacing for Multi-line Cells (Manager +) */
.dynamic-license-text,
table.feature-comparison-table td.dynamic-license-text {
    line-height: 0.9 !important;
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

/* 5. Icons (Checkmarks, Crosses, Diamonds) */
.check-cell,
.cross-cell,
.icon-check, .lucide-check,
.icon-cross, .lucide-x,
.icon-diamond {
    text-align: center;
    font-size: 1rem !important;
    /* Unified uniform size */
    line-height: 1;
}

.icon-check, .lucide-check,
.feature-comparison-table .lucide-check {
    color: #16a34a;
    width: 1.25rem;
    height: 1.25rem;
    display: inline-block;
    vertical-align: middle;
}

.icon-cross, .lucide-x {
    color: #cbd5e1;
    width: 1.25rem;
    height: 1.25rem;
    display: inline-block;
    vertical-align: middle;
}

.icon-diamond {
    color: #eab308;
    font-weight: 800;
}

/* Tier-specific Icon Overrides */
.highlight-column .icon-diamond {
    color: #16a34a !important;
    /* Green for Tier 2 */
}

/* === COLUMN HIGHLIGHTS === */

/* Left Aligned Content if needed */
.pricing-table td:first-child,
.pricing-table th:first-child {
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
}

/* Tier 1 Box (Violet) */
table.feature-comparison-table tbody td.tier1-col,
table.feature-comparison-table thead th.tier1-col {
    background-color: #f5f3ff !important;
    border-bottom-color: #ddd6fe !important;
    font-weight: 700;
    color: var(--text-main);
}

table.feature-comparison-table thead th.tier1-col {
    background-color: #ede9fe !important;
    color: #6d28d9 !important;
    border-bottom: 4px solid #ddd6fe !important;
}

/* Seat Count Color Overrides */
.feature-comparison-table td.tier1-col.check-cell {
    color: #0f172a !important;
    font-weight: 700 !important;
}

.feature-comparison-table td.dynamic-license-text,
.feature-comparison-table td.dynamic-license-text span {
    color: #0f172a !important;
    font-weight: 700 !important;
}

/* Tier 2 Box (Green) */
table.feature-comparison-table tbody td.highlight-column,
table.feature-comparison-table thead th.highlight-column,
.highlight-column {
    background-color: #f0fdf4 !important;
    border-bottom-color: #bbf7d0 !important;
    font-weight: 700;
    color: var(--text-main);
}

table.feature-comparison-table thead th.highlight-column {
    background-color: rgba(220, 252, 231, 0.8) !important;
    color: #14532d !important;
    border-bottom: 4px solid #bbf7d0 !important;
}

.feature-comparison-table td.highlight-column strong {
    color: #16a34a !important;
}

/* Tier 3 Box (Dark Mode Slate/Yellow) */
table.feature-comparison-table th.tier3-col {
    background-color: #1e293b !important;
    color: #eab308 !important;
    border-bottom: 4px solid #eab308 !important;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5) !important;
    border-left: 1px solid transparent !important;
}

table.feature-comparison-table td.tier3-col {
    position: relative;
    padding: 0 !important;
    vertical-align: top !important;
    background-color: #1e293b !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-left: 1px solid transparent !important;
}

table.feature-comparison-table th.tier3-col .header-subtext {
    color: #eab308 !important;
}

.tier3-content-wrapper {
    padding: 0 1.5rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

table.feature-comparison-table td.tier3-price-cell {
    text-align: center;
    font-size: 1rem !important;
    /* Unified explicitly to 1rem */
    color: #eab308 !important;
    vertical-align: middle !important;
    display: table-cell !important;
    padding: 1.5rem !important;
}

table.feature-comparison-table td.tier3-price-cell strong {
    color: #eab308 !important;
    font-size: 1rem !important;
}

/* Tier 3 Timelines & Badges */
.tier3-t2-badge {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.08), rgba(255, 255, 255, 0.03));
    border: none;
    border-top: 2px solid rgba(234, 179, 8, 0.6);
    border-radius: 0 0 8px 8px;
    padding: 0.85rem 1rem;
    color: #e2e8f0;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    width: 100%;
    max-width: 280px;
    letter-spacing: 0.03em;
}

.tier3-t2-badge .icon-check, .tier3-t2-badge .lucide-check {
    color: #eab308;
    font-size: 1rem !important;
}

.tier3-timeline {
    position: relative;
    padding-left: 1.5rem;
    padding-top: 0;
    padding-bottom: 0;
    margin: auto 0;
    text-align: left;
    width: 100%;
    max-width: 280px;
}

.tier3-timeline::before {
    content: '';
    position: absolute;
    left: 0;
    width: 2px;
    top: 0.85rem;
    bottom: 0;
    background-color: rgba(234, 179, 8, 0.5);
    -webkit-mask-image: linear-gradient(to bottom, black 0%, black 80%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 0%, black 80%, transparent 100%);
}

.tier3-phase {
    position: relative;
    padding-bottom: 2rem;
}

.tier3-phase:last-of-type {
    padding-bottom: 2rem;
}

.tier3-phase::before {
    content: '';
    position: absolute;
    /* Center the 12px dot exactly over the 2px border: padding (1.5rem) + half dot (6px) - half border (1px) = 1.5rem + 5px */
    left: calc(-1.5rem - 5px);
    top: 0.85rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #eab308;
    box-shadow: 0 0 12px rgba(234, 179, 8, 0.9);
    border: none;
}

.tier3-phase h4 {
    color: #f8fafc;
    font-size: 1rem !important;
    /* Standardized to 1rem */
    font-weight: 600;
    margin: 0 0 0.35rem 0;
    line-height: 1.3;
}

.tier3-phase p {
    color: #94a3b8;
    font-size: 0.85rem !important;
    margin: 0;
    line-height: 1.5;
}

.tier3-availability-card {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.08), rgba(255, 255, 255, 0.03));
    border: none;
    border-bottom: 2px solid rgba(234, 179, 8, 0.6);
    border-radius: 8px 8px 0 0;
    padding: 0.85rem 1rem;
    margin-top: auto;
    margin-bottom: 0;
    position: relative;
    text-align: center;
    max-width: 280px;
    width: 100%;
}

.tier3-availability-card strong {
    color: #eab308;
    font-size: 0.85rem !important;
    /* detail text */
    display: block;
}

/* Exceptions for Action Rows */
.pricing-table tr.action-row td,
table.feature-comparison-table tr.action-row td {
    height: 100%;
    /* Make cell grab available height */
    padding: 2rem 1.5rem !important;
    vertical-align: middle;
    text-align: center;
}

/* Ensure buttons stretch to fill their container and equalise heights */
.pricing-table tr.action-row .tier-btn,
table.feature-comparison-table tr.action-row .tier-btn {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    width: 100%;
    max-width: 216px;
    /* Stop the button from swallowing the entire column on wide screens! */
    margin: 0 auto;
    /* Center within td */
    /* Base minimum height */
}

/* Tooltip container fix */
.price-tooltip-container {
    position: relative;
    cursor: help;
    display: inline-block;
}

.price-tooltip-container::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: #1e293b;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: normal;
    text-align: center;
    width: 200px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
    z-index: 100;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    line-height: 1.4;
}

.price-tooltip-container::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    border: 5px solid transparent;
    border-top-color: #1e293b;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 100;
}

.price-tooltip-container:hover::after,
.price-tooltip-container:hover::before,
.price-tooltip-container:focus-visible::after,
.price-tooltip-container:focus-visible::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* === MOBILE OPTIMIZATIONS === */
@media (max-width: 768px) {
    .pricing-wrapper {
        margin: 0;
        padding: 0;
        width: 100%;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.5rem;
    }

    .table-scroll-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -1rem;
        padding: 0 !important;
        padding-top: 40px !important;
        /* Create space for the absolutely positioned badge */
        width: auto;
        min-width: 100%;
    }

    .feature-comparison-table {
        min-width: 800px !important;
        /* Force scroll on mobile to keep structure */
        width: 100%;
        border-radius: 8px;
        table-layout: auto;
    }

    .feature-comparison-table th:first-child,
    .feature-comparison-table td:first-child {
        position: static;
        box-shadow: none;
        border-right: none;
        width: 26%;
        text-align: center !important;
        padding-left: 0.5rem !important;
        overflow: visible;
        font-weight: 700 !important;
        color: var(--text-main);
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal !important;
        font-size: 0.85rem !important;
        /* Shrink feature text slightly on mobile */
    }

    .feature-comparison-table th:nth-child(2),
    .feature-comparison-table td:nth-child(2),
    .feature-comparison-table th:nth-child(3),
    .feature-comparison-table td:nth-child(3) {
        width: 20%;
        overflow: visible;
        text-align: center !important;
        padding: 0.5rem 0.25rem !important;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* Assign Double Width to Tier 3 on Mobile */
    .feature-comparison-table th:nth-child(4),
    .feature-comparison-table td:nth-child(4) {
        width: 34%;
        overflow: visible;
        text-align: center !important;
        padding: 0.5rem 0.25rem !important;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    table.feature-comparison-table th,
    table.feature-comparison-table td {
        padding: 0.75rem 0.5rem !important;
        vertical-align: middle !important;
        line-height: 1.25 !important;
    }

    .table-subtext {
        font-size: 0.85rem !important;
    }

    table.feature-comparison-table th,
    .feature-comparison-table th:first-child {
        font-weight: 800 !important;
        vertical-align: bottom;
        padding-bottom: 0.75rem !important;
        font-size: 0.75rem !important;
        /* Shrink standard header text slightly */
    }

    /* Shrink Subheaders ("Owner-Producer") */
    .feature-comparison-table th .header-subtext {
        font-size: 0.8rem !important;
        margin-top: 4px;
    }

    /* Shrink Prices & Strong Texts */
    .price-stack strong,
    .price-accent,
    .feature-comparison-table td strong,
    table.feature-comparison-table td.tier3-price-cell strong {
        font-size: 0.85rem !important;
    }

    /* Aesthetic Enhancements - Striping (Only on Feature Labels) */
    table.feature-comparison-table tr:nth-child(even) td:first-child {
        background-color: rgba(248, 250, 252, 0.5) !important;
        /* Slate 50 tint */
    }

    /* Force Tier 3 Background to Bottom Row on Mobile */
    table.feature-comparison-table td.tier3-col,
    table.feature-comparison-table tr.action-row td.tier3-col {
        background: rgba(15, 23, 42, 0.95) !important;
    }

    .feature-comparison-table td:nth-child(n+2) {
        text-align: center !important;
        display: table-cell !important;
    }

    .feature-comparison-table .cta-button,
    .feature-comparison-table .tier-btn {
        padding: 0.5rem 0.25rem !important;
        margin: 0 auto !important;
        /* Ensure margin rules stay firm */
        font-size: 0.85rem !important;
        /* Standard detail text */
        width: 100% !important;
        max-width: 160px !important;
        /* Cap width heavily on phones */
        white-space: normal;
        line-height: 1.1;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* --- Tooltip Styles --- */
.table-tooltip-trigger {
    position: relative;
    cursor: help;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.table-tooltip-trigger::after {
    content: attr(data-table-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: #1e293b;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: pre-line;
    /* Allow newlines from &#10; */
    text-align: center;
    /* Center lines */
    width: 140px;
    /* Force 2-line display on desktop like mobile */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
    z-index: 100;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    line-height: 1.4;
}

.table-tooltip-trigger::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    border: 5px solid transparent;
    border-top-color: #1e293b;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 100;
}

.table-tooltip-trigger:hover::after,
.table-tooltip-trigger:hover::before,
.table-tooltip-trigger:focus-visible::after,
.table-tooltip-trigger:focus-visible::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.info-icon-small {
    font-size: 0.85rem;
    opacity: 0.6;
    margin-left: 4px;
}


.dotted-underline {
    text-decoration: underline dotted;
    text-decoration-color: currentColor;
    /* Respects the color of the column (Green or Grey) */
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    cursor: help;
}

.icon-star {
    color: #eab308;
    /* Yellow 500 */
    font-size: 1.25rem;
    /* Slightly larger than check */
    line-height: 1;
    display: inline-block;
}


.icon-diamond {
    color: #16a34a;
    /* Green 600 - Matches check marks */
    font-size: 1.1rem;
    line-height: 1;
    display: inline-block;
    vertical-align: middle;
}


.info-icon-svg {
    width: 1rem;
    height: 1rem;
    opacity: 0.6;
    margin-left: 4px;
    vertical-align: middle;
    transform: translateY(2px);
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: opacity 0.2s;
}

.table-tooltip-trigger:hover .info-icon-svg,
.table-tooltip-trigger:focus-visible .info-icon-svg {
    opacity: 1;
    color: var(--primary-color);
}

