/* --- Global / Reset --- */
body {
    background-color: #0b0b0b;
    /* Changed from #050510 to match firm-header-card */
    color: #e0e0e0;
    font-family: 'Outfit', sans-serif;
    margin: 0;
    box-sizing: border-box;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

.details-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-top: 120px;
    /* Increased to account for fixed navbar overlap */
    padding-bottom: 80px;
}

/* --- Firm Header Card (Image 1 Style) --- */
.firm-header-card {
    background: #0b0b0b;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    gap: 40px;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

/* Left Group: Logo + Stats */
.firm-header-content {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.firm-identity {
    display: flex;
    align-items: center;
    gap: 20px;
}

.firm-logo-xl {
    width: 100px;
    height: 100px;
    background: transparent;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    /* Ensure image corners clip */
}

.firm-logo-xl img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Fill the box completely */
}

.identity-text h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0 0 5px 0;
    color: #fff;
}

.firm-meta {
    font-size: 0.9rem;
    color: #ff3366;
}

.firm-stats-grid {
    display: flex;
    gap: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-right: 20px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item:last-child {
    border-right: none;
}

.stat-item .label {
    font-size: 0.8rem;
    color: #888;
}

.stat-item .value {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

/* Right Group: Actions + Ratings */
.firm-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 20px;
    flex: 1;
    min-width: 300px;
}

/* Action Buttons */
.firm-actions {
    display: flex;
    gap: 12px;
}

.btn-action {
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* "Leave a Review" - Outline purple */
.btn-review {
    background: transparent;
    border: 1px solid rgba(168, 85, 247, 0.6);
    color: #e0e0e0;
}

.btn-review:hover {
    background: rgba(168, 85, 247, 0.1);
    border-color: #a855f7;
    color: #fff;
}

/* "Buy" - Gradient Purple/Pink */
.btn-buy {
    background: linear-gradient(90deg, #a855f7 0%, #d946ef 100%);
    border: none;
    color: #fff;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4);
}

.btn-buy:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.6);
}

/* Rating Box (Revised alignment) */
.firm-rating-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: right;
    /* Align text to right to match button stack */
    width: 100%;
    align-items: flex-end;
    /* Align bars to right */
}

.rating-big {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1;
    color: #fff;
}

.stars {
    color: #a855f7;
    font-size: 1.2rem;
}

.total-reviews {
    font-size: 0.8rem;
    color: #ff3366;
    margin-bottom: 10px;
}

.rating-bars {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    max-width: 300px;
    /* Keep bars contained */
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.75rem;
    color: #ccc;
    flex-direction: row-reverse;
    /* Flip text/star so numbers are on right if desired closer to edge, or keep row */
    /* Let's keep existing row structure but ensure it looks good right aligned */
    flex-direction: row;
    justify-content: flex-end;
}

.star-num {
    width: 20px;
}

.track {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.fill {
    height: 100%;
    background: #a855f7;
    /* Purple */
    border-radius: 2px;
}

.count {
    width: 30px;
    text-align: right;
    color: #888;
}


/* --- Split Offers Section (Image 0 Style) --- */
.offers-sticky-wrapper {
    position: sticky;
    top: 80px;
    /* Right below the fixed navbar */
    z-index: 101;
    /* Above table header, but below navbar dropdowns if any */
    background: var(--bg-dark);
    /* Ensure it covers content behind it */
    padding: 10px 0;
}

.offers-split-container {
    display: flex;
    gap: 20px;
    margin-bottom: 0px;
    width: 100%;
}

/* 1. Promo Box (Left) */
.promo-box {
    width: 200px;
    min-width: 200px;
    background: linear-gradient(145deg, #1f1025 0%, #0b0b0b 100%);
    border: 1px solid #a855f7;
    /* Purple border */
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    /* Stack icon and text vertically to save horizontal space and allow bigger text */
    align-items: center;
    justify-content: center;
    gap: 8px;
    /* Reduced gap */
    padding: 10px;
    /* Reduced padding */
    height: 100px;
    /* Fixed height for consistent strip size */
    position: relative;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.15);
}

.promo-icon {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    /* Tear drop shape in image, simplified to circle or custom */
    border-radius: 50% 50% 50% 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transform: rotate(-45deg);
}

.promo-icon i {
    transform: rotate(45deg);
}

.promo-text {
    font-size: 1.25rem;
    /* Reduced from 2rem to accommodate longer text */
    font-weight: 800;
    color: #fff;
    text-align: center;
    line-height: 1.1;
    word-break: break-word;
    /* Ensure it wraps if very long */
}

/* 2. Coupon Bar (Right) */
.coupon-bar {
    flex: 1;
    background: #0b0b0b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    height: 100px;
    /* Matched height with .promo-box */
}

.bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tiny-logo {
    width: 36px;
    height: 36px;
    border-radius: 6px;
}

.tiny-info {
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
    color: #fff;
}

.tiny-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: #a855f7;
}

.bar-middle {
    font-size: 1rem;
    color: #ccc;
    font-weight: 500;
}

.code-pill {
    background: rgba(40, 10, 60, 0.4);
    border: 1px solid #7c3aed;
    border-radius: 50px;
    padding: 8px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.code-pill:hover {
    background: rgba(124, 58, 237, 0.2);
}

.code-label {
    font-size: 0.8rem;
    color: #d8b4fe;
    text-transform: uppercase;
}

.code-val {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

.code-pill i {
    color: #d8b4fe;
    font-size: 0.9rem;
}


/* --- Content / Sidebar --- */
.content-grid {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 40px;
}

.sidebar {
    align-self: start;
    position: sticky;
    top: 180px;
    /* Adjusted to sit below sticky specific offers header */
}

/* Revert Sidebar to simple list if needed, or keep previous style. 
   Keeping simple list for now as per "original" preference, but with better spacing. */
.sidebar nav {
    display: flex;
    flex-direction: column;
    border-left: 2px solid #222;
}

.sidebar a {
    padding: 12px 20px;
    /* Reduced from 30px to 20px for better alignment */
    color: #666;
    text-decoration: none;
    transition: 0.2s;
}

.sidebar a:hover,
.sidebar a.active {
    color: #fff;
    border-left: 2px solid #d946ef;
    margin-left: -2px;
}

/* Sections */
.section-title,
h3 {
    color: #fff;
    font-size: 1.5rem;
    margin-top: 60px;
    /* Space between sections */
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    /* Increased gap */
}

.overview-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.overview-label {
    color: #888;
    font-size: 0.9rem;
    font-weight: 500;
}

.overview-value {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pill-tag {
    background: #1a1a1a;
    border: 1px solid #333;
    padding: 8px 16px;
    border-radius: 50px;
    color: #ddd;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}

/* Sidebar should also be lower if everything is sticky */
.sidebar {
    top: 220px !important;
}

/* --- Firm Rules Section Spacing --- */
.rules-block {
    margin-bottom: 35px;
}

.rules-block h5 {
    color: #fff;
    font-size: 1.15rem;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 16px;
    padding-left: 12px;
    border-left: 3px solid #d946ef;
    /* Purple accent */
    line-height: 1.2;
}

.rules-block ul {
    list-style: none;
    /* Custom bullets */
    padding-left: 5px;
    margin: 0;
}

.rules-block ul li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 12px;
    line-height: 1.7;
    /* Improved readability */
    color: #e0e0e0;
    font-size: 1rem;
}

.rules-block ul li::before {
    content: "•";
    position: absolute;
    left: 6px;
    color: #d946ef;
    /* Purple bullet */
    font-size: 1.2em;
    line-height: 1;
    top: 2px;
}

.pill-tag:hover {
    border-color: #666;
    background: #252525;
}

.pill-tag[data-platform="Sierra Chart"] {
    background: #252525 url('../assets/platform-sierra-chart.png') no-repeat 10px center;
    background-size: 20px;
    padding-left: 36px;
    border-color: #fca311;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.table-asset-pill {
    background: #1a1a1a;
    border: 1px solid #333;
    padding: 4px 10px;
    border-radius: 50px;
    color: #ddd;
    font-size: 0.8rem;
    display: inline-block;
    white-space: nowrap;
}

.table-asset-pill:hover {
    border-color: #666;
    background: #252525;
}

/* Table */
.details-table {
    width: 100%;
    border-collapse: collapse;
}

.details-table td,
.details-table th {
    padding: 16px 0;
    border-bottom: 1px solid #222;
    text-align: left;
    color: #fff;
}

.details-table th {
    color: #888;
}

/* Underlines */
.val-underline {
    display: inline-block;
    padding-bottom: 4px;
    border-bottom: 2px solid;
}

.val-red {
    border-color: #ef4444;
}

.val-green {
    border-color: #4ade80;
}


@media (max-width: 900px) {
    .offers-split-container {
        flex-direction: column;
    }

    .promo-box {
        width: 100%;
        height: 80px;
    }

    .firm-header-card {
        flex-direction: column;
    }

    .firm-stats-grid {
        flex-wrap: wrap;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }
}

/* --- Firm Details Tabs (New) --- */
.firm-tabs-nav {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
    padding-bottom: 0px;
    overflow-x: auto;
}

.firm-tab {
    background: #1a1a1a;
    border: 1px solid #333;
    color: #aaa;
    padding: 12px 28px;
    border-radius: 100px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.firm-tab:hover {
    background: #252525;
    color: #fff;
    border-color: #666;
}

.firm-tab.active {
    background: #fff;
    color: #000;
    border-color: #fff;
    font-weight: 700;
}

.firm-tab .tab-badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 20px;
    background: #333;
    color: #ddd;
    font-weight: 600;
}

.firm-tab.active .tab-badge {
    background: #000;
    color: #fff;
}

.tab-badge.new {
    background: #d946ef;
    color: #fff;
}

.firm-tab.active .tab-badge.new {
    background: #d946ef;
    color: #fff;
}

.mt-20 {
    margin-top: 20px;
}

.challenges-table-container {
    background: #0b0b0b;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow-x: auto;
    padding: 0;
}

.btn-buy-sm {
    background: linear-gradient(90deg, #a855f7 0%, #d946ef 100%);
    border: none;
    color: #fff;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.btn-buy-sm:hover {
    opacity: 0.9;
}

/* Ensure table header sits below the sticky offers bar */
.comparison-table th {
    top: 0 !important;
    /* Adjusted to 0 because overflow-x on container breaks sticky-to-viewport. 
       210px was pushing headers down inside the container. */
    background: #0a0a19;
    z-index: 100;
}

/* Sidebar should also be lower if everything is sticky */
.sidebar {
    top: 220px !important;
}

/* --- Review Proof Gallery --- */
.review-proof-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.proof-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 120px;
}

.proof-thumb {
    width: 120px;
    height: 80px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.proof-thumb:hover {
    border-color: #a855f7;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.2);
}

.proof-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.proof-thumb i {
    font-size: 1.5rem;
    color: #4b5563;
}

.proof-label {
    font-size: 0.7rem;
    color: #94a3b8;
    text-align: center;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}