/* ==========================================
   RandyAI - Industrial Plant Aesthetic Layer
   Wastewater plant vibes. Not generic AI.
   Layers on top of styles.css - no overrides.
   ========================================== */

/* ------------------------------------------
   BLUEPRINT GRID BACKGROUND
   Subtle schematic grid on dark sections
   ------------------------------------------ */
.blueprint-bg {
    position: relative;
}

.blueprint-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(6, 182, 212, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(6, 182, 212, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

.blueprint-bg > * {
    position: relative;
    z-index: 1;
}

/* ------------------------------------------
   PIPE VALVE DIVIDER
   CSS-only pipe cross-section between sections
   ------------------------------------------ */
.pipe-divider {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 3rem auto;
    max-width: 600px;
    height: 24px;
    position: relative;
}

.pipe-divider::before,
.pipe-divider::after {
    content: '';
    flex: 1;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.3), rgba(6, 182, 212, 0.5));
}

.pipe-divider::after {
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.5), rgba(6, 182, 212, 0.3), transparent);
}

.pipe-divider-valve {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(6, 182, 212, 0.5);
    border-radius: 50%;
    background: rgba(6, 182, 212, 0.08);
    flex-shrink: 0;
    position: relative;
    animation: valveSpin 8s linear infinite;
}

.pipe-divider-valve::before,
.pipe-divider-valve::after {
    content: '';
    position: absolute;
    background: rgba(6, 182, 212, 0.5);
    border-radius: 2px;
}

.pipe-divider-valve::before {
    width: 2px;
    height: 10px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.pipe-divider-valve::after {
    width: 10px;
    height: 2px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes valveSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ------------------------------------------
   SECTION PIPE HEADER
   SCADA-panel label before section headings
   ------------------------------------------ */
.plant-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.9rem;
    background: rgba(6, 182, 212, 0.07);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--v2-cyan);
    margin-bottom: 1.25rem;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
}

.plant-label::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--v2-cyan);
    animation: scadaPulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

.plant-label.amber {
    background: rgba(245, 158, 11, 0.07);
    border-color: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.plant-label.amber::before {
    background: #f59e0b;
}

.plant-label.green {
    background: rgba(16, 185, 129, 0.07);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--v2-emerald);
}

.plant-label.green::before {
    background: var(--v2-emerald);
}

@keyframes scadaPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}

/* ------------------------------------------
   FLOW TICKER
   Moving flow line - decorative top of sections
   ------------------------------------------ */
.flow-ticker {
    height: 2px;
    background: transparent;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.flow-ticker::after {
    content: '';
    display: block;
    height: 100%;
    width: 40%;
    background: linear-gradient(90deg, transparent, var(--v2-cyan), var(--v2-emerald), transparent);
    animation: tickerFlow 3s linear infinite;
}

.flow-ticker.amber::after {
    background: linear-gradient(90deg, transparent, #f59e0b, #f97316, transparent);
}

@keyframes tickerFlow {
    from { transform: translateX(-150%); }
    to   { transform: translateX(350%); }
}

/* ------------------------------------------
   ANALOG GAUGE - horizontal bar version
   Styled like a plant pressure gauge readout
   ------------------------------------------ */
.gauge-bar-wrap {
    margin-bottom: 1.25rem;
}

.gauge-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.gauge-bar-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--v2-muted);
    font-family: 'JetBrains Mono', 'Courier New', monospace;
}

.gauge-bar-value {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--v2-white);
    font-family: 'JetBrains Mono', 'Courier New', monospace;
}

.gauge-bar-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.gauge-bar-track::before {
    /* tick marks */
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        90deg,
        transparent,
        transparent calc(25% - 1px),
        rgba(255,255,255,0.08) calc(25% - 1px),
        rgba(255,255,255,0.08) 25%
    );
}

.gauge-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    background: linear-gradient(90deg, var(--v2-cyan), var(--v2-emerald));
}

.gauge-bar-fill.amber {
    background: linear-gradient(90deg, #f59e0b, #f97316);
}

.gauge-bar-fill.violet {
    background: linear-gradient(90deg, var(--v2-violet), var(--v2-cyan));
}

.gauge-bar-fill::after {
    /* animated flow shimmer */
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: gaugeShimmer 2s linear infinite;
}

@keyframes gaugeShimmer {
    from { transform: translateX(-100%); }
    to   { transform: translateX(200%); }
}

/* ------------------------------------------
   SCADA STATUS BADGE
   Inline status chips for live indicators
   ------------------------------------------ */
.scada-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    border: 1px solid;
}

.scada-badge.online {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--v2-emerald);
}

.scada-badge.online::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--v2-emerald);
    animation: scadaPulse 1.5s ease-in-out infinite;
}

.scada-badge.warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: #f59e0b;
}

.scada-badge.warning::before {
    content: '';
    font-size: 0.6rem;
}

/* ------------------------------------------
   PIPE CORNER CONNECTOR
   Decorative corner for card borders
   ------------------------------------------ */
.pipe-card {
    position: relative;
}

.pipe-card::before,
.pipe-card::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border-color: var(--v2-cyan);
    border-style: solid;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.pipe-card::before {
    top: 8px;
    left: 8px;
    border-width: 2px 0 0 2px;
}

.pipe-card::after {
    bottom: 8px;
    right: 8px;
    border-width: 0 2px 2px 0;
}

.pipe-card:hover::before,
.pipe-card:hover::after {
    opacity: 0.9;
}

/* ------------------------------------------
   HMI PANEL NAV ACCENT
   Makes the navbar feel like an HMI panel
   ------------------------------------------ */
.navbar {
    border-bottom: 1px solid rgba(6, 182, 212, 0.08);
}

.navbar::after {
    content: '';
    display: block;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(6, 182, 212, 0.15) 20%,
        rgba(16, 185, 129, 0.2) 50%,
        rgba(6, 182, 212, 0.15) 80%,
        transparent 100%
    );
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

/* ------------------------------------------
   SECTION HEADER WITH PIPE ACCENT
   Heading style that reads like panel labels
   ------------------------------------------ */
.section-title-plant {
    position: relative;
    padding-left: 1.25rem;
}

.section-title-plant::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.2em;
    bottom: 0.2em;
    width: 4px;
    border-radius: 2px;
    background: linear-gradient(to bottom, var(--v2-cyan), var(--v2-emerald));
}

/* ------------------------------------------
   BLOG POST CARDS - plant overhaul
   ------------------------------------------ */
.blog-post-card {
    background: var(--v2-card-bg);
    backdrop-filter: var(--v2-blur);
    border: var(--v2-border);
    border-radius: 20px;
    overflow: hidden;
    transition: var(--v2-transition);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    position: relative;
}

.blog-post-card:hover {
    transform: translateY(-5px);
    border-color: rgba(6, 182, 212, 0.25);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.blog-post-card .flow-ticker {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
}

.blog-post-card-header {
    padding: 2rem 2rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.blog-post-emoji {
    font-size: 2rem;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: var(--v2-border);
    border-radius: 12px;
    flex-shrink: 0;
}

.blog-post-meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.blog-post-category {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--v2-cyan);
    font-family: 'JetBrains Mono', 'Courier New', monospace;
}

.blog-post-date {
    font-size: 0.7rem;
    color: var(--v2-muted);
}

.blog-post-card-body {
    padding: 1.5rem 2rem 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-post-card-body h3 {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--v2-white);
    margin-bottom: 0.75rem;
    line-height: 1.35;
}

.blog-post-card-body p {
    font-size: 0.9rem;
    color: var(--v2-muted);
    line-height: 1.6;
    flex: 1;
    margin-bottom: 1.5rem;
}

.blog-post-read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--v2-cyan);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-decoration: none;
    transition: gap 0.2s ease;
}

.blog-post-card:hover .blog-post-read-more {
    gap: 0.7rem;
}

/* blog grid */
.blog-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* ------------------------------------------
   ARTICLE / BLOG POST PAGE STYLES
   ------------------------------------------ */
.article-header {
    padding: 8rem 0 3rem;
    text-align: center;
}

.article-meta-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.article-body {
    max-width: 760px;
    margin: 0 auto;
    padding: 2rem 0 5rem;
}

.article-body h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--v2-white);
    margin: 2.5rem 0 1rem;
    padding-left: 1rem;
    border-left: 3px solid var(--v2-cyan);
}

.article-body h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--v2-white);
    margin: 1.75rem 0 0.75rem;
}

.article-body p {
    color: #cbd5e1;
    line-height: 1.85;
    margin-bottom: 1.25rem;
    font-size: 1.05rem;
}

.article-body ul,
.article-body ol {
    color: #cbd5e1;
    line-height: 1.85;
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
    font-size: 1.05rem;
}

.article-body li {
    margin-bottom: 0.4rem;
}

.article-body strong {
    color: var(--v2-white);
    font-weight: 700;
}

.article-callout {
    background: rgba(6, 182, 212, 0.06);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-left: 4px solid var(--v2-cyan);
    border-radius: 0 12px 12px 0;
    padding: 1.25rem 1.5rem;
    margin: 1.75rem 0;
}

.article-callout p {
    margin: 0;
    color: #e2e8f0 !important;
}

.article-callout.amber {
    background: rgba(245, 158, 11, 0.06);
    border-color: rgba(245, 158, 11, 0.2);
    border-left-color: #f59e0b;
}

.article-callout.green {
    background: rgba(16, 185, 129, 0.06);
    border-color: rgba(16, 185, 129, 0.2);
    border-left-color: var(--v2-emerald);
}

/* Formula box */
.formula-box {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    margin: 1.5rem 0;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    text-align: center;
}

.formula-box .formula-title {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--v2-muted);
    margin-bottom: 0.75rem;
}

.formula-box .formula-text {
    font-size: 1.15rem;
    color: var(--v2-cyan);
    font-weight: 700;
}

/* Author bio box */
.author-bio {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    padding: 1.75rem;
    background: rgba(255, 255, 255, 0.02);
    border: var(--v2-border);
    border-radius: 16px;
    margin-top: 3rem;
}

.author-bio-avatar {
    font-size: 2.5rem;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(74, 155, 127, 0.15);
    border-radius: 50%;
    flex-shrink: 0;
}

.author-bio-name {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--v2-white);
    margin-bottom: 0.2rem;
}

.author-bio-title {
    font-size: 0.75rem;
    color: var(--v2-cyan);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.author-bio-text {
    font-size: 0.85rem;
    color: var(--v2-muted);
    line-height: 1.6;
    margin: 0;
}

/* Ask Randy CTA in articles */
.article-randy-cta {
    background: linear-gradient(135deg, rgba(74, 155, 127, 0.1), rgba(6, 182, 212, 0.05));
    border: 1px solid rgba(74, 155, 127, 0.2);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    margin: 2.5rem 0;
}

.article-randy-cta h4 {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.article-randy-cta p {
    font-size: 0.9rem;
    color: var(--v2-muted);
    margin-bottom: 1rem;
}
