﻿/*
 * Epoxy 239 — Brand global styles
 * Loaded by both Top (Blazor Server) and Tdap (Blazor WASM) via:
 *     <link rel="stylesheet" href="_content/E239F.Web.Branding/epoxy239-brand.css" />
 *
 * Layered on top of MudBlazor.min.css. Applies brand color tokens as CSS variables,
 * utility classes for marketing pages, and trades-industry display typography.
 */

:root {
    /* Dark mid-gray theme. Distinctly lighter than slate-black but not cement-light.
       Cards LIFT UP from the canvas (conventional dark-theme depth). */
    --epoxy-black: #33363D;             /* page canvas: dark mid-gray */
    --epoxy-surface: #44474E;           /* cards lifted up (+11 luminance) */
    --epoxy-surface-elevated: #545961;  /* modals/popovers higher (+22) */
    --epoxy-divider-on-dark: #2A2D33;   /* darker, grounded — visible against lifted cards */
    --epoxy-appbar-bg: #2A2D33;         /* sticky header: slightly darker than canvas for depth */
    --epoxy-hover-overlay: rgba(255, 255, 255, 0.06);
    --epoxy-light-bg: #F8F8F8;

    /* Brand accent — red is the only chromatic accent */
    --epoxy-red: #D62828;
    --epoxy-red-deep: #A01717;

    /* Neutrals */
    --epoxy-white: #FFFFFF;
    --epoxy-text-on-dark: #FFFFFF;
    --epoxy-text-secondary-on-dark: #D5D6D9;  /* brightened for cement-bg contrast */
    --epoxy-text-on-light: #1A1D21;           /* dark text for light surfaces */
    --epoxy-gray: #6B7280;
    --epoxy-gray-light: #9CA3AF;

    /* Tier indicators (used by PricingCard) */
    --epoxy-tier-certified: #6B7280;
    --epoxy-tier-select: #D62828;
    --epoxy-tier-premium: #FFFFFF;

    --epoxy-font-display: 'Anton', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --epoxy-font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* -------------------------------------------------------------------------
 * Base
 * ------------------------------------------------------------------------- */

html, body {
    font-family: var(--epoxy-font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

::selection {
    background-color: var(--epoxy-red);
    color: var(--epoxy-black);
}

/* "Space gray" page atmosphere — fine procedural noise (anodized-metal feel) +
   barely-there corner gradients. No stars, no nebulas — just subtle grain and
   light/shadow drift. Total atmosphere stays under 6% opacity. Sections
   (.epoxy-section--*) keep their own bg, so the atmosphere only shows in the
   canvas / chrome zones around content. */
body.epoxy-dark {
    background-color: var(--epoxy-black);
    color: var(--epoxy-text-on-dark);
    background-image:
        radial-gradient(ellipse 50% 40% at 95% 0%, rgba(214, 40, 40, 0.04), transparent 65%),
        radial-gradient(ellipse 60% 50% at 0% 100%, rgba(180, 190, 210, 0.025), transparent 70%),
        url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' seed='5'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .055 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: no-repeat, no-repeat, repeat;
    background-size: 100% 100%, 100% 100%, 220px 220px;
    background-attachment: fixed;
    min-height: 100vh;
}

/* -------------------------------------------------------------------------
 * Display typography
 * Use .epoxy-display on h1/h2 in hero sections for the trades-industry punch.
 * ------------------------------------------------------------------------- */

.epoxy-display {
    font-family: var(--epoxy-font-display);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    line-height: 1.0;
}

.epoxy-display-xl {
    font-family: var(--epoxy-font-display);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.005em;
    line-height: 0.95;
    font-size: clamp(2.25rem, 4vw, 3.5rem);
}

.epoxy-eyebrow {
    font-family: var(--epoxy-font-body);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.75rem;
    color: var(--epoxy-red);
    display: inline-block;
}

.epoxy-eyebrow--gold { color: var(--epoxy-red-deep); }
.epoxy-eyebrow--red { color: var(--epoxy-red); }

/* -------------------------------------------------------------------------
 * Layout primitives
 * ------------------------------------------------------------------------- */

.epoxy-section {
    padding-block: clamp(2rem, 4vw, 3.5rem);
    padding-inline: clamp(1rem, 4vw, 3rem);
}

.epoxy-section--dark {
    /* Deepest section variant — for heroes and high-impact CTAs. Stands out over the cement canvas. */
    background-color: var(--epoxy-surface-elevated);
    color: var(--epoxy-text-on-dark);
}

.epoxy-section--surface {
    /* Mid-depth section — for value props and pricing rows. */
    background-color: var(--epoxy-surface);
    color: var(--epoxy-text-on-dark);
}

.epoxy-section--light {
    background-color: var(--epoxy-light-bg);
    color: #0B0B0B;
}

.epoxy-container {
    max-width: 1200px;
    margin-inline: auto;
}

/* Yellow accent divider — horizontal hairline */
.epoxy-divider-accent {
    width: 64px;
    height: 3px;
    background-color: var(--epoxy-red);
    margin-block: 1rem;
    border: 0;
}

/* Brushstroke bottom border (used in marketing) */
.epoxy-brush-border {
    position: relative;
    padding-bottom: 0.5rem;
}
.epoxy-brush-border::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 56px;
    height: 4px;
    background: linear-gradient(90deg, var(--epoxy-red), var(--epoxy-red-deep));
    border-radius: 2px;
}

/* -------------------------------------------------------------------------
 * Color utilities
 * ------------------------------------------------------------------------- */

.epoxy-text-yellow { color: var(--epoxy-red) !important; }
.epoxy-text-gold { color: var(--epoxy-red-deep) !important; }
.epoxy-text-red { color: var(--epoxy-red) !important; }
.epoxy-text-white { color: var(--epoxy-white) !important; }
.epoxy-text-muted { color: var(--epoxy-text-secondary-on-dark) !important; }

.epoxy-bg-black { background-color: var(--epoxy-black) !important; }
.epoxy-bg-surface { background-color: var(--epoxy-surface) !important; }
.epoxy-bg-yellow { background-color: var(--epoxy-red) !important; }
.epoxy-bg-gold { background-color: var(--epoxy-red-deep) !important; }

/* -------------------------------------------------------------------------
 * Scrollbar — subtle on dark
 * ------------------------------------------------------------------------- */

.epoxy-dark ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
.epoxy-dark ::-webkit-scrollbar-track {
    background: var(--epoxy-black);
}
.epoxy-dark ::-webkit-scrollbar-thumb {
    background: var(--epoxy-divider-on-dark);
    border-radius: 5px;
}
.epoxy-dark ::-webkit-scrollbar-thumb:hover {
    background: var(--epoxy-red-deep);
}

/* -------------------------------------------------------------------------
 * MudBlazor overrides — keep light, only what brand demands
 * ------------------------------------------------------------------------- */

/* AppBar: pull the bottom hairline to brand gold instead of default */
.mud-appbar.mud-appbar-dense.mud-elevation-4,
.mud-appbar {
    border-bottom: 1px solid var(--epoxy-divider-on-dark);
}

/* Buttons: chunkier corners, bolder type — already covered by Typography.Button,
   here we add a subtle gold hover ring on filled-primary CTAs. */
.mud-button-filled.mud-button-filled-primary {
    box-shadow: 0 4px 14px 0 rgba(214, 40, 40, 0.25);
}
.mud-button-filled.mud-button-filled-primary:hover {
    box-shadow: 0 6px 20px 0 rgba(214, 40, 40, 0.4);
}

/* Cards on dark surface: subtle border */
.epoxy-section--dark .mud-paper,
.epoxy-section--surface .mud-paper {
    border: 1px solid var(--epoxy-divider-on-dark);
}

/* Validation messages: red on dark, no Bootstrap dependency */
.validation-message {
    color: var(--epoxy-red);
    font-size: 0.8rem;
    margin: 3px 0 0;
    text-align: start;
    font-weight: 400;
    line-height: 1.66;
    letter-spacing: 0.03333em;
}

.invalid {
    outline: 1px solid var(--epoxy-red);
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--epoxy-red-deep);
}

/* Blazor error UI: brand colors, no template residue */
#blazor-error-ui {
    background: var(--epoxy-red);
    color: var(--epoxy-white);
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
    color: var(--epoxy-white);
}

.blazor-error-boundary {
    background: var(--epoxy-red);
    color: var(--epoxy-white);
    padding: 1rem 1rem 1rem 3.7rem;
}
.blazor-error-boundary::after {
    content: "Ha ocurrido un error inesperado.";
}

/* ============================================================================
   Reusable lead table — used by MisLeads and InstallerDashboard recent-leads.
   Lives in the global brand CSS so both pages share one source of truth.
   ============================================================================ */

.leads-table-wrap {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid var(--epoxy-divider-on-dark);
    background-color: var(--epoxy-surface);
    box-shadow:
        0 0 32px rgba(255, 255, 255, 0.04),
        0 4px 14px rgba(0, 0, 0, 0.25);
}

.leads-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--epoxy-font-body), sans-serif;
    font-size: 0.875rem;
}

.leads-table thead { background-color: rgba(255, 255, 255, 0.04); }

.leads-table th {
    text-align: left;
    font-weight: 700;
    font-size: 0.6875rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--epoxy-text-secondary-on-dark);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--epoxy-divider-on-dark);
}

.leads-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--epoxy-white);
    vertical-align: top;
}

.leads-table tbody tr             { transition: background-color 120ms ease-out; }
.leads-table tbody tr:hover       { background-color: rgba(255, 255, 255, 0.04); }
.leads-table tbody tr:last-child td { border-bottom: 0; }

.leads-table__name {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.leads-table__sub {
    color: var(--epoxy-text-secondary-on-dark);
    font-size: 0.8125rem;
    margin-top: 0.2rem;
}

.leads-table__project { font-weight: 500; }

.leads-row--callback        { background-color: rgba(214, 40, 40, 0.06); }
.leads-row--callback:hover  { background-color: rgba(214, 40, 40, 0.10) !important; }

.callback-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background-color: rgba(214, 40, 40, 0.15);
    color: var(--epoxy-red);
    border: 1px solid var(--epoxy-red);
    font-weight: 700;
    font-size: 0.6875rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    box-shadow: 0 0 12px rgba(214, 40, 40, 0.25);
}

.callback-badge .mud-icon-root {
    font-size: 14px !important;
    width: 14px;
    height: 14px;
    color: inherit;
}

/* Lifecycle status pill — color-only outline, semantic per status. */
.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    font-family: var(--epoxy-font-body), sans-serif;
    font-weight: 700;
    font-size: 0.6875rem;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    border: 1px solid currentColor;
    background-color: rgba(255, 255, 255, 0.05);
}
.status-pill--new          { color: #D62828; }
.status-pill--qualifying   { color: #FFB545; }
.status-pill--unassigned   { color: #5A5D60; }
.status-pill--assigned     { color: #4A86FF; }
.status-pill--contacted    { color: #4A86FF; }
.status-pill--quoted       { color: #9CA3AF; }
.status-pill--won          { color: #3DCB6C; }
.status-pill--lost         { color: #5A5D60; }
.status-pill--cancelled    { color: #5A5D60; }

/* ============================================================================
   Right-side details drawer — shared by Owner Mapa, installer Mis Condados,
   and the public Top home (Index) county selection. Mirrors the side-panel
   format used in preview/county-map.html.
   ============================================================================ */

.zone-drawer__inner {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.25rem;
    height: 100%;
    overflow-y: auto;
}

.zone-drawer__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}

.zone-drawer__title {
    font-family: var(--epoxy-font-display), sans-serif;
    font-size: 1.5rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin: 0.25rem 0 0;
    color: var(--epoxy-white);
}

.zone-drawer__section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.zone-drawer__section-title {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--epoxy-text-secondary-on-dark);
    margin: 0;
}

.zone-drawer__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.zone-drawer__hint {
    font-size: 0.9rem;
    color: var(--epoxy-text-secondary-on-dark);
    margin: 0;
    line-height: 1.45;
}

.zone-drawer__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.zone-drawer__pill {
    font-family: var(--epoxy-font-body), sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    border: 1px solid currentColor;
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--epoxy-text-secondary-on-dark);
}

.zone-drawer__pill--mine {
    color: var(--epoxy-white);
    background: var(--epoxy-red);
    border-color: var(--epoxy-red);
    box-shadow: 0 0 12px rgba(214, 40, 40, 0.45);
}

.zone-drawer__pill--claimed {
    color: #FFB545;
    border-color: #FFB545;
}

.zone-drawer__pill--open {
    color: #3DCB6C;
    border-color: #3DCB6C;
}

.zone-drawer__pill--ghost {
    color: var(--epoxy-text-secondary-on-dark);
    background: transparent;
}

.zone-drawer__actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--epoxy-divider-on-dark);
}

.tier-row {
    display: grid;
    grid-template-columns: 14px 1fr auto;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.7rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--epoxy-divider-on-dark);
    border-radius: 8px;
}

.tier-row + .tier-row { margin-top: 0.4rem; }

.tier-row .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--epoxy-red);
    box-shadow: 0 0 8px rgba(214, 40, 40, 0.55);
}

.tier-row .dot--certified { background: #9CA3AF; box-shadow: none; }
.tier-row .dot--premium   { background: var(--epoxy-red); }

.tier-row .tname {
    font-family: var(--epoxy-font-body), sans-serif;
    font-weight: 600;
    color: var(--epoxy-white);
    letter-spacing: 0.04em;
}

.tier-row .tprice {
    font-family: var(--epoxy-font-display), sans-serif;
    color: var(--epoxy-white);
    font-size: 1.05rem;
}

/* ============================================================================
   Custom right-side drawer (replaces MudDrawer to avoid the MudLayout-parent
   requirement and the related invisible-render bug). Pure CSS slide-in.
   ============================================================================ */

.zone-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(380px, 92vw);
    background: var(--epoxy-background, #1c1e22);
    color: var(--epoxy-white);
    border-left: 1px solid var(--epoxy-divider-on-dark);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
    transform: translateX(100%);
    transition: transform 240ms ease-out;
    z-index: 1300;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.zone-drawer--open {
    transform: translateX(0);
}

.zone-drawer__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1290;
    animation: zone-drawer-fade-in 200ms ease-out;
}

@keyframes zone-drawer-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
