/* ServiceAlert.ai - Index / Dashboard Page Styles */

/* Category Quick-Filters */
.category-filters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 4px;
    margin-bottom: 16px;
}

.category-filters::-webkit-scrollbar {
    display: none;
}

.category-pill {
    flex-shrink: 0;
    padding: 6px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.category-pill:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.category-pill.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* SEO Intro */
.seo-intro {
    max-width: 800px;
    margin: 0 auto 32px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.7;
}

.seo-intro a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.seo-intro a:hover {
    text-decoration: underline;
}

/* Trending Now Section */
.trending-now {
    margin-bottom: 32px;
}

.trending-now-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.trending-now-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.trending-now-title h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0;
}

.trending-now-subtitle {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--status-major);
    background: rgba(239, 68, 68, 0.1);
    padding: 4px 10px;
    border-radius: 12px;
}

.live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--status-major);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.trending-now-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.trending-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    transition: border-color 0.2s, transform 0.1s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.trending-card:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

.trending-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
}

.trending-card.major::before { background: var(--status-major); }
.trending-card.partial::before { background: var(--status-partial); }
.trending-card.degraded::before { background: var(--status-degraded); }
.trending-card.operational::before { background: var(--status-operational); }

.trending-card-rank {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-tertiary);
    min-width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.trending-card-favicon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    flex-shrink: 0;
}

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

.trending-card-name {
    font-size: 0.9375rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trending-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.trending-card-status {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.trending-card-reports {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.trending-card-spark {
    width: 80px;
    height: 28px;
    flex-shrink: 0;
}

.trending-card-spark svg {
    width: 100%;
    height: 100%;
}

.trending-card-spark .spark-line {
    fill: none;
    stroke: var(--accent);
    stroke-width: 1.5;
    vector-effect: non-scaling-stroke;
}

.trending-card-spark .spark-area {
    fill: var(--accent);
    opacity: 0.1;
}

.trending-card-share {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.trending-card { position: relative; }
.trending-card:hover .trending-card-share { opacity: 1; }
.trending-card-share:hover { background: var(--accent); color: white; }

.trending-now-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.875rem;
    padding: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

/* Live Activity Feed */
.live-feed {
    margin-bottom: 32px;
}

.live-feed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.live-feed-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0;
}

.live-feed-title svg {
    color: var(--accent);
}

.live-feed-updated {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.live-feed-list {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    max-height: 400px;
    overflow-y: auto;
}

.feed-event {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.feed-event:last-child {
    border-bottom: none;
}

.feed-event:hover {
    background: var(--bg-tertiary);
}

.feed-event.new {
    animation: feedSlideIn 0.4s ease-out;
}

@keyframes feedSlideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.feed-event-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feed-event-icon.status-change-down {
    background: rgba(239, 68, 68, 0.15);
    color: var(--status-major);
}

.feed-event-icon.status-change-up {
    background: rgba(16, 185, 129, 0.15);
    color: var(--status-operational);
}

.feed-event-icon.report-spike {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent);
}

.feed-event-body {
    flex: 1;
    min-width: 0;
}

.feed-event-text {
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--text-primary);
}

.feed-event-text strong {
    font-weight: 600;
}

.feed-event-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.live-feed-empty {
    padding: 32px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

/* Section Header & Filters */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header .section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 0;
}

.section-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.filter-tabs {
    display: flex;
    gap: 8px;
}

.service-search {
    position: relative;
    width: 220px;
}

.service-search input {
    width: 100%;
    padding: 8px 36px 8px 14px;
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.service-search input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

.service-search input::placeholder {
    color: var(--text-tertiary);
}

.service-search .search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
}

.filter-tab {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-tab:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.filter-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* Hero / Page Header */
.page-header {
    text-align: center;
    padding: 32px 0 20px;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
    color: var(--text-primary);
    line-height: 1.1;
}

.brand-name {
    font-weight: 700;
}


.subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

.hero-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
}

.hero-cta-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: var(--accent);
    color: #000;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-decoration: none;
}

.hero-cta-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.hero-cta-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 14px 24px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.hero-cta-secondary:hover {
    color: var(--text-primary);
    border-color: var(--accent);
    background: var(--accent-subtle);
}

.hero-trust {
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--text-tertiary);
    text-align: center;
}

/* Social Proof Stats Bar */
.social-proof {
    display: flex;
    align-items: stretch;
    justify-content: center;
    margin: 20px auto 32px;
    max-width: 540px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-secondary);
    overflow: hidden;
}

.social-proof-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 14px 12px;
}

.social-proof-stat + .social-proof-divider + .social-proof-stat,
.social-proof-stat:not(:first-child) {
    border-left: none;
}

.social-proof-number {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.social-proof-label {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
    text-align: center;
}

.social-proof-divider {
    width: 1px;
    flex-shrink: 0;
    background: var(--border-color);
}

/* Status Summary Roll-up */
.status-summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.summary-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 4px 12px;
    background: var(--bg-secondary);
    border-radius: 20px;
    border: 1px solid var(--border-color);
}
.summary-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.summary-pill.major { color: var(--status-major); border-color: rgba(239, 68, 68, 0.3); }
.summary-pill.partial { color: var(--status-partial); border-color: rgba(249, 115, 22, 0.3); }
.summary-pill.degraded { color: var(--status-degraded); border-color: rgba(245, 158, 11, 0.3); }

.last-updated {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 30px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

/* Service Cards */
.service-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.service-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px var(--shadow-color);
    border-color: var(--accent);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--status-unknown);
    transition: background 0.3s;
}

.service-card.operational::before {
    background: var(--status-operational);
}

.service-card.degraded::before {
    background: var(--status-degraded);
}

.service-card.partial::before {
    background: var(--status-partial);
}

.service-card.major::before {
    background: var(--status-major);
}

.service-card.maintenance::before {
    background: var(--status-maintenance);
}

.report-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent);
    white-space: nowrap;
}

.report-badge.active {
    background: rgba(239, 68, 68, 0.12);
    color: var(--status-major);
    animation: badgePulse 3s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.service-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.service-name {
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 4px;
    color: var(--text-primary);
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 8px;
}

.service-favicon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    flex-shrink: 0;
}

.service-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-badge.operational {
    background: rgba(76, 175, 80, 0.15);
    color: var(--status-operational);
}

.status-badge.degraded {
    background: rgba(245, 158, 11, 0.15);
    color: var(--status-degraded);
}

.status-badge.partial {
    background: rgba(249, 115, 22, 0.15);
    color: var(--status-partial);
}

.status-badge.major {
    background: rgba(239, 68, 68, 0.15);
    color: var(--status-major);
}

.status-badge.maintenance {
    background: rgba(59, 130, 246, 0.15);
    color: var(--status-maintenance);
}

.status-badge.unknown {
    background: rgba(107, 114, 128, 0.15);
    color: var(--status-unknown);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--status-unknown);
}

.operational .status-indicator {
    background: var(--status-operational);
    box-shadow: 0 0 6px var(--status-operational);
}

.degraded .status-indicator {
    background: var(--status-degraded);
    box-shadow: 0 0 6px var(--status-degraded);
}

.partial .status-indicator {
    background: var(--status-partial);
    box-shadow: 0 0 6px var(--status-partial);
}

.major .status-indicator {
    background: var(--status-major);
    box-shadow: 0 0 6px var(--status-major);
}

.maintenance .status-indicator {
    background: var(--status-maintenance);
    box-shadow: 0 0 6px var(--status-maintenance);
}

.activity-indicator {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.activity-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse 2s infinite;
}

.service-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 16px;
    transition: color 0.2s;
}

.service-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.service-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* History Chart (line graph + report bars) */
.history-chart {
    position: relative;
    height: 50px;
    margin-top: 16px;
    background: linear-gradient(to bottom,
        rgba(239, 68, 68, 0.1) 0%,
        rgba(245, 158, 11, 0.1) 33%,
        rgba(16, 185, 129, 0.1) 66%,
        rgba(16, 185, 129, 0.05) 100%);
    border-radius: 6px;
    overflow: hidden;
}

.history-chart svg {
    width: 100%;
    height: 100%;
}

.history-line {
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Report volume bars overlaid on line graph */
.report-bar {
    fill: var(--accent);
    opacity: 0.35;
}

.report-bar.medium {
    fill: var(--status-degraded);
    opacity: 0.5;
}

.report-bar.high {
    fill: var(--status-major);
    opacity: 0.55;
}

.history-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
}

/* Legend */
.legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-top: 40px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin: 32px 0;
    padding: 16px;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--bg-tertiary);
    border-color: var(--accent);
    color: var(--text-primary);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.pagination-info strong {
    color: var(--text-primary);
}

/* Responsive - Page Specific */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    .trending-now-grid {
        grid-template-columns: 1fr;
    }

    .trending-now-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .trending-card-spark {
        display: none;
    }

    .live-feed-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .social-proof {
        max-width: 100%;
    }

    .social-proof-stat {
        padding: 12px 8px;
    }

    .social-proof-number {
        font-size: 1.15rem;
    }

    .social-proof-label {
        font-size: 0.625rem;
    }

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

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .section-header-left {
        width: 100%;
        flex-wrap: wrap;
        gap: 12px;
    }

    .filter-tabs {
        width: 100%;
        justify-content: space-between;
    }

    .filter-tab {
        flex: 1;
        text-align: center;
    }

    .service-search {
        width: 100%;
    }

    .category-filters {
        margin-bottom: 12px;
    }

    .category-pill {
        padding: 5px 12px;
        font-size: 0.75rem;
    }
}
