/* GameWatch - Custom styles */

/* Navigation active link */
nav a.active {
    font-weight: bold;
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* Status badges */
.badge-active {
    color: #22c55e;
    font-weight: 600;
    font-size: 0.85em;
}

.badge-paused {
    color: #f59e0b;
    font-weight: 600;
    font-size: 0.85em;
}

.badge-error {
    color: #ef4444;
    font-weight: 600;
    font-size: 0.85em;
    cursor: help;
}

/* Source type badges */
.badge-rss {
    color: #06b6d4;
    font-weight: 600;
    font-size: 0.85em;
}

.badge-scraping {
    color: #a855f7;
    font-weight: 600;
    font-size: 0.85em;
}

/* Source tag in articles */
.source-tag {
    background: var(--pico-primary-background);
    color: var(--pico-primary-inverse);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
}

/* Article cards */
.article-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.article-card {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 0;
    transition: opacity 0.2s;
}

.article-card.article-read {
    opacity: 0.6;
}

.article-card:hover {
    opacity: 1;
}

.article-image {
    flex-shrink: 0;
    width: 120px;
    height: 80px;
    overflow: hidden;
    border-radius: 8px;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.article-body h4 {
    margin: 0.25rem 0;
    font-size: 1rem;
    line-height: 1.3;
}

.article-body h4 a {
    text-decoration: none;
}

.article-body h4 a:hover {
    text-decoration: underline;
}

.article-summary {
    font-size: 0.85rem;
    opacity: 0.8;
    margin: 0.25rem 0;
    line-height: 1.4;
}

.article-actions {
    display: flex;
    gap: 0.5rem;
}

/* Small buttons */
button.small,
.small {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Bookmarked state */
.bookmarked {
    border-color: #f59e0b !important;
    color: #f59e0b !important;
}

/* Action buttons in source table */
.action-buttons {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

/* Stats cards */
.grid article {
    text-align: center;
}

.grid article h2 {
    margin: 0;
    font-size: 2rem;
}

/* Chart containers */
canvas {
    max-height: 300px;
}

/* Responsive */
@media (max-width: 768px) {
    .article-card {
        flex-direction: column;
    }

    .article-image {
        width: 100%;
        height: 150px;
    }

    .action-buttons {
        flex-direction: column;
    }
}

/* Source favicon icons */
.source-name-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.source-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border-radius: 3px;
}

.source-icon-small {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    border-radius: 2px;
    vertical-align: middle;
}

/* Trending Topics */
.time-range-selector {
    display: flex;
    gap: 0.25rem;
}

.time-range-selector button {
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    margin-bottom: 0;
}

.time-range-selector button.active-range {
    background: var(--pico-primary-background);
    color: var(--pico-primary-inverse);
    border-color: var(--pico-primary-background);
}

.trending-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.trending-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    cursor: pointer;
    background: transparent;
    border: 1px solid var(--pico-muted-border-color);
    color: var(--pico-color);
    margin-bottom: 0;
    transition: all 0.15s;
    width: auto;
}

.trending-chip:hover {
    border-color: var(--pico-primary);
    color: var(--pico-primary);
}

.trending-chip.chip-expanded {
    background: var(--pico-primary-background);
    color: var(--pico-primary-inverse);
    border-color: var(--pico-primary-background);
}

.chip-count {
    background: var(--pico-primary);
    color: var(--pico-primary-inverse);
    border-radius: 50%;
    min-width: 1.5em;
    height: 1.5em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.chip-expanded .chip-count {
    background: var(--pico-primary-inverse);
    color: var(--pico-primary-background);
}

.trending-article-list {
    padding: 0.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    animation: fadeIn 0.2s ease-in;
}

.trending-article-item {
    padding: 0.4rem 0.75rem;
    border-left: 3px solid var(--pico-primary);
    font-size: 0.9rem;
}

.trending-article-item a {
    text-decoration: none;
}

.trending-article-item a:hover {
    text-decoration: underline;
}

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

/* Table responsive */
figure {
    overflow-x: auto;
}
