/* ==========================================================================
   TRUSTBOON — DESKTOP UI/UX UPGRADE STYLESHEET
   Scope: All rules are STRICTLY scoped to @media (min-width: 769px)
   Mobile: ZERO changes. Mobile styles in customerhub.css are untouched.
   ========================================================================== */

/* ── 1. DESKTOP CONTENT WIDTH CONTROL ──────────────────────────────────────
   The existing CSS sets max-w-7xl to `max-width: none` on desktop,
   causing content to stretch edge-to-edge. We restore a sensible max-width.
   -------------------------------------------------------------------------- */
@media (min-width: 769px) {

    /* Restore max-w-7xl to 80rem (1280px) */
    .max-w-7xl {
        max-width: 80rem !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* ── 2. DESKTOP BODY & PAGE BACKGROUND ───────────────────────────────── */
    html:not(.dark) body {
        background: linear-gradient(145deg, #e0f2fe 0%, #dbeafe 40%, #e0f2fe 80%, #f0f9ff 100%) !important;
        background-attachment: fixed !important;
    }

    /* ── 3. DESKTOP HEADER REFINEMENT ────────────────────────────────────── */
    .site-header {
        height: 4.5rem !important;
        border-bottom: 1px solid rgba(186, 230, 253, 0.6) !important;
        box-shadow: 0 1px 0 rgba(14, 165, 233, 0.06), 0 4px 20px rgba(15, 23, 42, 0.04) !important;
    }

    html:not(.dark) .site-header {
        background: rgba(255, 255, 255, 0.97) !important;
    }

    .site-header .max-w-7xl > .flex {
        height: 4.5rem !important;
    }

    /* Nav links: tighter, cleaner spacing */
    .site-desktop-nav a,
    .site-desktop-nav button {
        font-size: 0.875rem !important;
        font-weight: 600 !important;
        letter-spacing: -0.01em;
        padding: 0.5rem 0.875rem !important;
        border-radius: 0.625rem !important;
        transition: all 0.15s ease !important;
        white-space: nowrap;
    }

    .site-desktop-nav a:hover,
    .site-desktop-nav button:hover {
        background-color: rgba(224, 242, 254, 0.7) !important;
    }

    html.dark .site-desktop-nav a:hover,
    html.dark .site-desktop-nav button:hover {
        background-color: rgba(30, 41, 59, 0.8) !important;
    }

    /* ── 4. HERO SECTION DESKTOP ─────────────────────────────────────────── */
    .home-hero {
        padding-top: 4rem !important;
        padding-bottom: 5rem !important;
    }

    html:not(.dark) .home-hero {
        background: linear-gradient(165deg, #f0f9ff 0%, #e0f2fe 35%, #f8fafc 70%, #ffffff 100%) !important;
    }

    /* ── 5. CARD REFINEMENTS ─────────────────────────────────────────────── */
    /* Replace heavy 2px blue border on generic white cards with subtle treatment */
    html:not(.dark) .bg-white.rounded-3xl,
    html:not(.dark) .bg-white.rounded-2xl {
        border: 1px solid rgba(186, 230, 253, 0.5) !important;
        box-shadow: 0 4px 24px -2px rgba(14, 165, 233, 0.08), 0 2px 8px -2px rgba(15, 23, 42, 0.04) !important;
    }

    /* Preserve strong border on specific premium components */
    html:not(.dark) .dashboard-metric-card,
    html:not(.dark) .dashboard-panel,
    html:not(.dark) .premium-profile-hero,
    html:not(.dark) .premium-profile-panel,
    html:not(.dark) .featured-profile-card,
    html:not(.dark) .home-growth-card {
        border: 1px solid rgba(125, 211, 252, 0.6) !important;
        box-shadow: 0 8px 28px -4px rgba(14, 165, 233, 0.1), 0 2px 8px -2px rgba(15, 23, 42, 0.04) !important;
    }

    html:not(.dark) .dashboard-metric-card:hover,
    html:not(.dark) .featured-profile-card:hover {
        border-color: rgba(56, 189, 248, 0.8) !important;
        box-shadow: 0 16px 40px -4px rgba(2, 132, 199, 0.14), 0 4px 12px -2px rgba(15, 23, 42, 0.06) !important;
    }

    /* ── 6. PROFILE CARDS ────────────────────────────────────────────────── */
    .featured-profile-card {
        border-radius: 1.25rem !important;
        transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
                    box-shadow 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
                    border-color 0.22s ease !important;
    }

    .featured-profile-card:hover {
        transform: translateY(-5px) !important;
    }

    /* ── 7. SECTION HEADING HIERARCHY ────────────────────────────────────── */
    h2.text-3xl,
    h2.text-4xl {
        letter-spacing: -0.025em;
    }

    h3.text-xl,
    h3.text-2xl {
        letter-spacing: -0.015em;
    }

    /* ── 8. FOOTER DESKTOP LAYOUT ────────────────────────────────────────── */
    .site-footer {
        padding-top: 4rem !important;
        padding-bottom: 2.5rem !important;
    }

    html:not(.dark) .site-footer {
        background: linear-gradient(180deg, #e0f2fe 0%, #dbeafe 100%) !important;
        border-top: 1px solid rgba(125, 211, 252, 0.5) !important;
    }

    .site-footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1fr !important;
        gap: 3rem 2rem !important;
    }

    /* ── 9. DASHBOARD SIDEBAR ─────────────────────────────────────────────── */
    .dashboard-sidebar {
        width: 15rem !important;
        min-width: 15rem !important;
        background: linear-gradient(180deg, #0d1117 0%, #0f172a 60%, #0c1626 100%) !important;
        border-right: 1px solid rgba(30, 41, 59, 0.8) !important;
    }

    .dash-nav-active {
        border-radius: 0.75rem !important;
    }

    /* ── 10. DASHBOARD TOPBAR ─────────────────────────────────────────────── */
    .dashboard-topbar {
        height: 3.75rem !important;
        padding: 0 1.5rem !important;
    }

    /* ── 11. TABLE REFINEMENTS ───────────────────────────────────────────── */
    table {
        border-collapse: separate !important;
        border-spacing: 0 !important;
    }

    table thead th {
        font-size: 0.6875rem !important;
        font-weight: 800 !important;
        letter-spacing: 0.06em !important;
        text-transform: uppercase !important;
        padding: 0.75rem 1.25rem !important;
    }

    table tbody td {
        padding: 0.875rem 1.25rem !important;
        font-size: 0.875rem !important;
        vertical-align: middle !important;
    }

    table tbody tr {
        transition: background-color 0.12s ease !important;
    }

    /* ── 12. FORM INPUTS ──────────────────────────────────────────────────── */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    input[type="search"],
    select,
    textarea {
        border-radius: 0.75rem !important;
        padding: 0.625rem 0.875rem !important;
        font-size: 0.875rem !important;
        line-height: 1.5 !important;
        transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
    }

    /* ── 13. DESKTOP MICRO-INTERACTIONS ──────────────────────────────────── */
    a {
        transition: color 0.12s ease, opacity 0.12s ease;
    }

    button.p-2:hover,
    button.p-2\.5:hover {
        transform: translateY(-1px) !important;
    }

    /* ── 14. DROPDOWN MENUS ───────────────────────────────────────────────── */
    html:not(.dark) .absolute.rounded-2xl,
    html:not(.dark) .absolute.rounded-3xl {
        box-shadow: 0 20px 48px -8px rgba(15, 23, 42, 0.14), 0 8px 16px -4px rgba(15, 23, 42, 0.06) !important;
        border: 1px solid rgba(226, 232, 240, 0.8) !important;
    }

    html.dark .absolute.rounded-2xl,
    html.dark .absolute.rounded-3xl {
        box-shadow: 0 20px 48px rgba(0, 0, 0, 0.4) !important;
        border-color: rgba(51, 65, 85, 0.9) !important;
    }

    /* ── 15. PROFILE PAGE ─────────────────────────────────────────────────── */
    .premium-profile-hero {
        border-radius: 1.5rem !important;
    }

    .premium-profile-panel {
        border-radius: 1.25rem !important;
    }

    /* ── 16. LEADS TABLE ──────────────────────────────────────────────────── */
    .dashboard-leads-table {
        border-radius: 1rem !important;
        overflow: hidden !important;
    }

    /* ── 17. CONVERSATION UI ──────────────────────────────────────────────── */
    .conversation-shell {
        border-radius: 1.25rem !important;
        min-height: 32rem !important;
    }

    /* ── 18. ADMIN PANEL ──────────────────────────────────────────────────── */
    .admin-sidebar {
        width: 15rem !important;
        min-width: 15rem !important;
    }

    /* ── 19. FOCUS RINGS ──────────────────────────────────────────────────── */
    button:focus-visible,
    a:focus-visible {
        outline: 2px solid rgba(2, 132, 199, 0.7) !important;
        outline-offset: 2px !important;
        box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
    }

    /* ── 20. DESKTOP ACTIVE NAV INDICATOR ───────────────────────────────── */
    .site-desktop-nav a[class*="text-brand-600"] {
        position: relative;
    }

    .site-desktop-nav a[class*="text-brand-600"]::after {
        content: '';
        position: absolute;
        bottom: -4px;
        left: 50%;
        transform: translateX(-50%);
        width: 55%;
        height: 2px;
        background: #0284c7;
        border-radius: 2px;
        opacity: 0.8;
    }

    /* ── 21. MOBILE-SPECIFIC ELEMENTS: ENFORCE HIDDEN ON DESKTOP ─────────── */
    .mobile-bottom-nav,
    .mobile-profile-sticky-cta,
    .mobile-app-header {
        display: none !important;
    }

    /* ── 22. DASHBOARD STICKY SIDEBAR OFFSET ─────────────────────────────── */
    .desktop-sticky-sidebar {
        top: 5.5rem !important;
    }

    /* ── 23. SCROLLBAR REFINEMENT ────────────────────────────────────────── */
    ::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }

    ::-webkit-scrollbar-track {
        background: transparent;
    }

    ::-webkit-scrollbar-thumb {
        background: rgba(186, 230, 253, 0.7);
        border-radius: 999px;
    }

    ::-webkit-scrollbar-thumb:hover {
        background: rgba(125, 211, 252, 0.9);
    }

    html.dark ::-webkit-scrollbar-thumb {
        background: rgba(30, 41, 59, 0.9);
    }

    html.dark ::-webkit-scrollbar-thumb:hover {
        background: rgba(51, 65, 85, 1);
    }

    /* ── 24. CARD GRID SPACING ────────────────────────────────────────────── */
    .grid.gap-4 {
        gap: 1.25rem !important;
    }

    .grid.gap-6 {
        gap: 1.5rem !important;
    }

    /* ── 25. SEARCH HOME BOX ──────────────────────────────────────────────── */
    .home-hero .bg-white {
        box-shadow: 0 8px 30px -4px rgba(14, 165, 233, 0.12), 0 2px 8px -2px rgba(15, 23, 42, 0.05) !important;
    }

    /* ── 26. CATEGORY CHIPS HOVER ─────────────────────────────────────────── */
    .home-hero .flex.flex-wrap a:hover {
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.12) !important;
    }

    /* ── 27. STAT NUMBERS POLISH ──────────────────────────────────────────── */
    .dashboard-metric-card .text-3xl,
    .dashboard-metric-card .text-4xl {
        letter-spacing: -0.035em !important;
        font-weight: 900 !important;
    }

    /* ── 28. PARAGRAPH READABILITY ────────────────────────────────────────── */
    p {
        line-height: 1.65;
    }

    /* ── 29. DASHBOARD HOME METRIC CARD PADDING ───────────────────────────── */
    .dashboard-home .dashboard-metric-card {
        padding: 1.5rem !important;
        border-radius: 1.25rem !important;
    }

    /* ── 30. SECTION PADDING REFINEMENT ──────────────────────────────────── */
    .home-growth-section {
        padding-top: 5rem !important;
        padding-bottom: 5rem !important;
    }
}

/* ==========================================================================
   BREAKPOINT-SPECIFIC DESKTOP RULES
   ========================================================================== */

/* 1024px — Small Laptop */
@media (min-width: 1024px) {
    .site-header .max-w-7xl {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }
}

/* 1280px — Standard Laptop */
@media (min-width: 1280px) {
    .site-header .max-w-7xl {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }

    .site-footer-grid {
        gap: 3.5rem 2.5rem !important;
    }
}

/* 1440px — Desktop Monitor */
@media (min-width: 1440px) {
    .dashboard-sidebar {
        width: 16rem !important;
        min-width: 16rem !important;
    }
}

/* 1920px — Large Display */
@media (min-width: 1920px) {
    .max-w-7xl {
        max-width: 90rem !important;
    }
}
