/* Guardrails Common Styles - Earthly Lunar */
/* Shared styles used across all guardrails pages */

/* ========================================
   SHARED HERO SECTION (index & list pages)
   ======================================== */
.guardrails-index-hero {
    background: linear-gradient(135deg, #0a0e1a 0%, #1a1f35 50%, #0a0e1a 100%);
    padding: 80px 0 60px;
    position: relative;
    overflow: hidden;
}

.guardrails-index-hero::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 60%;
    height: 80%;
    background: radial-gradient(ellipse, rgba(0, 212, 255, 0.12) 0%, transparent 70%);
    filter: blur(100px);
    pointer-events: none;
}

.guardrails-index-hero::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -10%;
    width: 50%;
    height: 70%;
    background: radial-gradient(ellipse, rgba(0, 255, 136, 0.08) 0%, transparent 70%);
    filter: blur(100px);
    pointer-events: none;
}

.guardrails-index-hero .container {
    max-width: 1016px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 2;
}

/* Integrations page variant - strong amber/gold theme */
.guardrails-index-hero--integrations {
    background: linear-gradient(135deg, #0a0e1a 0%, #1a1510 50%, #0a0e1a 100%);
}

.guardrails-index-hero--integrations::before {
    background: radial-gradient(ellipse, rgba(251, 191, 36, 0.15) 0%, transparent 70%);
}

.guardrails-index-hero--integrations::after {
    background: radial-gradient(ellipse, rgba(251, 191, 36, 0.12) 0%, transparent 70%);
}

.guardrails-index-hero--integrations h1 .gradient-text {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.guardrails-index-hero--integrations .hero-eyebrow {
    color: #fbbf24;
}

.guardrails-index-hero--integrations .hero-subtext strong {
    color: #fbbf24;
}

/* Keep cyan for collector-related content */
.guardrails-index-hero--integrations .highlight-cyan {
    color: var(--el-cyan);
}

/* Amber breadcrumb hover */
.guardrails-index-hero--integrations .breadcrumb a:hover {
    color: #fbbf24;
}

.guardrails-index-hero--integrations .breadcrumb .current {
    color: #fbbf24;
}

.guardrails-index-hero h1 {
    font-size: 56px;
    line-height: 64px;
    font-weight: 700;
    margin: 0 0 20px;
    text-align: left;
}

.guardrails-index-hero h1 .gradient-text {
    background: linear-gradient(135deg, #00d4ff 0%, #00ff88 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Index Header with Icon */
.index-header {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 24px;
}

.index-header-icon {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.index-header-icon .type-icon {
    font-size: 32px;
    font-weight: 700;
}

/* Type-specific index header icons */
.index-header-icon.collector {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2) 0%, rgba(0, 212, 255, 0.1) 100%);
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.index-header-icon.collector .type-icon {
    color: var(--type-collector);
}

.index-header-icon.cataloger {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2) 0%, rgba(251, 191, 36, 0.1) 100%);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.index-header-icon.cataloger .type-icon {
    color: var(--type-cataloger);
}

.index-header-icon.policy {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.2) 0%, rgba(0, 255, 136, 0.1) 100%);
    border: 1px solid rgba(0, 255, 136, 0.3);
}

.index-header-icon.policy .type-icon {
    color: var(--type-policy);
}

.index-header-content h1 {
    margin-bottom: 0;
}

.index-header-content .hero-eyebrow {
    margin-bottom: 8px;
}

/* Hero Text Styles */
.hero-eyebrow {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--el-cyan);
    margin: 0 0 12px;
}

.hero-tagline {
    font-size: 20px;
    line-height: 32px;
    color: var(--text-secondary);
    max-width: 750px;
    margin-bottom: 20px;
}

.hero-subtext {
    font-size: 17px;
    line-height: 28px;
    color: var(--text-muted);
    max-width: 700px;
    margin-bottom: 32px;
}

.hero-subtext strong {
    color: var(--text-primary);
}

.highlight-cyan {
    color: var(--el-cyan);
    font-weight: 600;
}

/* ========================================
   SHARED CONTENT SECTION
   ======================================== */
.guardrails-index-content {
    padding: 80px 0;
    background: linear-gradient(180deg, #0a0e1a 0%, #0f1419 100%);
}

.guardrails-index-content .container {
    max-width: 1016px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ========================================
   BREADCRUMB
   ======================================== */
.breadcrumb {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb a:hover {
    color: var(--el-cyan);
}

.breadcrumb .separator {
    margin: 0 8px;
    color: var(--text-muted);
}

.breadcrumb .current {
    color: var(--text-primary);
}

/* ========================================
   TYPE BADGES (pill-shaped with icons)
   ======================================== */
.type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px 5px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.25) 0%, rgba(0, 212, 255, 0.15) 100%);
    color: var(--el-cyan);
    border: none;
}

.type-badge::before {
    font-size: 14px;
    line-height: 1;
}

.type-badge.collector::before {
    content: '↓';
    font-weight: 900;
}

.type-badge.policy::before {
    content: '✓';
    font-weight: 900;
}

.type-badge.cataloger::before {
    content: '⇄';
    font-weight: 900;
}

/* Inline icon (used in hero) - suppress ::before when present */
.type-badge .badge-icon {
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
}

.type-badge:has(.badge-icon)::before {
    display: none;
}

/* Type-specific badge colors */
.type-badge.collector {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2) 0%, rgba(0, 212, 255, 0.1) 100%);
    color: var(--type-collector);
}

.type-badge.policy {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.2) 0%, rgba(0, 255, 136, 0.1) 100%);
    color: var(--type-policy);
}

.type-badge.cataloger {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2) 0%, rgba(251, 191, 36, 0.1) 100%);
    color: var(--type-cataloger);
}

/* ========================================
   STATUS / MATURITY BADGES
   ======================================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
    letter-spacing: 0.3px;
    cursor: help;
}

.status-badge svg {
    flex-shrink: 0;
}

.status-badge.status-stable {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.status-badge.status-beta {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.status-badge.status-experimental {
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.25);
}

.status-badge.status-deprecated {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

/* ========================================
   CSS-ONLY TOOLTIPS (for badges)
   ======================================== */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::before,
[data-tooltip]::after {
    position: absolute;
    left: 50%;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.2s ease,
        visibility 0.2s ease,
        transform 0.2s ease;
    pointer-events: none;
    z-index: 100;
}

/* Tooltip bubble */
[data-tooltip]::after {
    content: attr(data-tooltip);
    bottom: calc(100% + 8px);
    transform: translateX(-50%) translateY(4px);
    background: linear-gradient(135deg, #1a2332 0%, #0f1621 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
    color: var(--text-secondary);
    white-space: normal;
    text-align: left;
    text-transform: none;
    letter-spacing: normal;
    width: max-content;
    max-width: 280px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Tooltip arrow */
[data-tooltip]::before {
    content: '';
    bottom: calc(100% + 2px);
    transform: translateX(-50%) translateY(4px);
    border: 6px solid transparent;
    border-top-color: #1a2332;
}

/* Show on hover */
[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Position variants for edge cases */
[data-tooltip-position='left']::after {
    left: 0;
    transform: translateX(0) translateY(4px);
}
[data-tooltip-position='left']:hover::after {
    transform: translateX(0) translateY(0);
}
[data-tooltip-position='left']::before {
    left: 16px;
}

[data-tooltip-position='right']::after {
    left: auto;
    right: 0;
    transform: translateX(0) translateY(4px);
}
[data-tooltip-position='right']:hover::after {
    transform: translateX(0) translateY(0);
}
[data-tooltip-position='right']::before {
    left: auto;
    right: 16px;
    transform: translateX(0) translateY(4px);
}
[data-tooltip-position='right']:hover::before {
    transform: translateX(0) translateY(0);
}

/* ========================================
   HOOK BADGES (when collectors run)
   ======================================== */
.hook-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px 4px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.hook-badge::before {
    font-size: 11px;
    line-height: 1;
}

.hook-badge.hook-code::before {
    content: '●';
    font-size: 8px;
}

.hook-badge.hook-cron::before {
    content: '⏱';
}

.hook-badge[class*='hook-ci-']::before {
    content: '▶';
    font-size: 8px;
}

/* ========================================
   CATEGORY BADGES
   ======================================== */
.category-badge {
    display: inline-block;
    padding: 4px 10px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    transition:
        border-color 0.2s ease,
        color 0.2s ease,
        background-color 0.2s ease;
}

a.category-badge:hover {
    border-color: var(--cyan);
    color: var(--cyan);
    background: rgba(0, 255, 255, 0.05);
}

/* ========================================
   HERO CTAs
   ======================================== */
.hero-ctas {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-ctas .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.hero-ctas .btn-primary {
    background: linear-gradient(135deg, #00d4ff 0%, #00ff88 100%);
    color: #0a0e1a;
}

.hero-ctas .btn-primary:hover {
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.4);
    transform: translateY(-2px);
}

.hero-ctas .btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-ctas .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
}

/* ========================================
   COUNT BADGES
   ======================================== */
.count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    background: rgba(0, 212, 255, 0.15);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--el-cyan);
}

.count-badge-secondary {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-secondary);
}

/* ========================================
   SECTION HEADER WITH COUNTS
   ======================================== */
.section-header-with-counts {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.section-header-with-counts h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    text-align: left;
}

.counts-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.count-label {
    font-size: 13px;
    color: var(--text-muted);
}

.count-separator {
    color: var(--text-muted);
    opacity: 0.5;
    margin: 0 4px;
}

.counts-group-small {
    gap: 4px;
}

.counts-group-small .count-badge {
    font-size: 11px;
    padding: 2px 8px;
    min-width: 22px;
}

.counts-group-small .count-label {
    font-size: 11px;
}

.counts-group-small .count-separator {
    margin: 0 2px;
}

/* ========================================
   GUARDRAILS GRID (shared card layout)
   ======================================== */
.guardrails-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.guardrail-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 20px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.guardrail-card:hover {
    background: rgba(0, 212, 255, 0.05);
    border-color: rgba(0, 212, 255, 0.2);
    transform: translateX(4px);
}

/* Animation states for filtering */
.guardrail-card.filtering-out {
    opacity: 0;
    transform: scale(0.97);
}

.guardrail-card.filtering-in {
    opacity: 0;
    transform: scale(0.97);
}

.guardrail-card.filtered-out {
    display: none;
}

.guardrail-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.guardrail-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0) invert(1) opacity(0.85);
}

.guardrail-icon-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.2);
}

.guardrail-icon-placeholder .placeholder-symbol {
    font-size: 20px;
    color: var(--el-cyan);
    opacity: 0.8;
}

.guardrail-info {
    flex: 1;
    min-width: 0;
}

.guardrail-info h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.guardrail-info p {
    font-size: 12px;
    line-height: 18px;
    color: var(--text-secondary);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.guardrail-card-more {
    background: transparent;
    border-style: dashed;
    border-color: rgba(0, 212, 255, 0.3);
}

.guardrail-card-more:hover {
    background: rgba(0, 212, 255, 0.05);
    border-color: var(--el-cyan);
}

.more-count {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(0, 212, 255, 0.2);
    font-size: 16px;
    font-weight: 600;
    color: var(--el-cyan);
}

.guardrail-card-more .guardrail-info h4 {
    color: var(--el-cyan);
}

.guardrail-card-more .guardrail-info p {
    color: var(--text-muted);
    overflow: hidden;
}

/* Card metadata row */
.guardrail-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.guardrail-meta .sub-count {
    font-size: 11px;
    color: var(--text-muted);
}

/* ========================================
   INLINE CODE
   ======================================== */
code.inline-code {
    font-family: var(--font-mono);
    background: var(--bg-main);
    padding: 1px 3px;
    border-radius: 3px;
    font-size: 13px;
    color: var(--el-cyan);
    border: 1px solid rgba(0, 212, 255, 0.2);
}

/* ========================================
   RESPONSIVE - Common
   ======================================== */
@media (max-width: 1100px) {
    .guardrails-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .guardrails-index-hero {
        padding: 60px 0 40px;
    }

    .guardrails-index-hero h1 {
        font-size: 36px;
        line-height: 44px;
    }

    .hero-tagline {
        font-size: 17px;
        line-height: 27px;
    }

    .hero-subtext {
        font-size: 15px;
        line-height: 25px;
    }

    .index-header {
        flex-direction: column;
        gap: 16px;
    }

    .index-header-icon {
        width: 56px;
        height: 56px;
    }

    .guardrails-index-content {
        padding: 60px 0;
    }

    .hero-ctas {
        flex-direction: column;
    }

    .hero-ctas .btn {
        width: 100%;
        justify-content: center;
    }

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