/* Tidings Labs - Styles --bg-primary: #0a0a0f; */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f3f4f6;
    --bg-card: #f3f4f6;
    --accent: #6366f1;
    --accent-light: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.3);
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --text-primary: #374151;
    --text-secondary: #374151;
    --text-muted: #6b7280;
    --border: rgba(0, 0, 0, 0.1);
    --navbar-bg: #40B7FF;
    --navbar-text: #1f2937;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    background: linear-gradient(180deg, #40B7FF 0%, #88D2FF 100%);
    border-bottom: 1px solid var(--border);
}

.navbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 8px 24px;
    display: flex;
    align-items: center;
    gap: 45px;
    height: 56px;
}

.nav-logo {
    display: flex;
    align-items: center;
    height: 40px;
    line-height: 40px;
}

.nav-logo img {
    height: 40px;
    width: auto;
    display: block;
}

.nav-links {
    display: flex;
    gap: 24px;
}

.nav-links a {
    color: var(--navbar-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--bg-primary);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 100px 24px 48px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    font-size: 53px;
    font-weight: 800;
    background: linear-gradient(90deg, #0033FF 0%, #FF00D4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.text-expl {
    margin-top: 20px;
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 300 bold;
    word-wrap: break-word;
    line-height: 1.8;
    max-width: 100%;
}

/* Input section */
.input-section {
    background: var(--bg-card);
    border-radius: 22px;
    padding: 28px;
    margin-bottom: 32px;
    border: 1px solid var(--border);
}

.input-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.input-label svg {
    width: 20px;
    height: 20px;
    color: var(--accent);
}

.input-row {
    display: flex;
    gap: 12px;
}

.url-input {
    flex: 1;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 20px;
    padding: 16px 20px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s;
}

.url-input::placeholder {
    color: var(--text-muted);
}

.url-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.extract-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: white;
    border: none;
    padding: 16px 28px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.extract-btn:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--accent-glow);
}

.extract-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.extract-btn svg {
    width: 18px;
    height: 18px;
}

.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.hint-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    flex-wrap: wrap;
    gap: 12px;
}

.hint {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

.hint code {
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--accent-light);
}

/* Status messages */
.confidence-warning {
    display: none;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 9px;
}

.confidence-warning.visible {
    display: block;
}

.status {
    margin-top: 16px;
    padding: 14px 18px;
    border-radius: 20px;
    font-size: 14px;
    display: none;
}

.status.loading {
    display: flex;
    width: fit-content;
    align-items: center;
    gap: 10px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: var(--accent-light);
}

.status.success {
    display: block;
    width: fit-content;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.status.error {
    display: block;
    width: fit-content;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--error);
}

/* Stats bar */
.stats-bar {
    display: none;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.stats-bar.visible {
    display: flex;
}

.stat {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.stat-value.cached {
    color: var(--accent-light);
}

.stat-value.high {
    color: var(--success);
}

.stat-value.medium {
    color: var(--warning);
}

.stat-value.low {
    color: var(--error);
}

/* Article card */
.article-card {
    background: var(--bg-card);
    border-radius: 22px;
    padding: 32px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.meta-item {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: 22px;
    border: 3px solid var(--accent);
}

.meta-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.meta-value {
    font-size: 14px;
    color: var(--text-primary);
    word-break: break-word;
}

.news-type-badge {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.article-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    line-height: 1.3;
}

.article-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    font-style: italic;
    padding-left: 16px;
    border-left: 3px solid var(--accent);
    margin-bottom: 24px;
}

.article-body {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 24px;
}

.body-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-light);
    margin-bottom: 16px;
}

.body-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--accent), transparent);
}

.article-text {
    font-size: 15px;
    color: var(--text-secondary);
    white-space: pre-line;
    line-height: 1.8;
}

.article-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    justify-content: flex-start;
}

.copy-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--accent);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #25D366;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.share-btn:hover {
    background: #128C7E;
}

.copy-btn:hover {
    background: var(--accent-light);
}

.copy-btn.copied {
    background: var(--success);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 20px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
}

footer a {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;

}

/* Cache indicator */
.cache-indicator {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.15);
    padding: 12px 18px;
    border-radius: 20px;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--success);
}

/* Recent Articles Cards */
.recent-section {
    margin-bottom: 36px;
}

.recent-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.recent-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border), transparent);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.article-card-small {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.article-card-small:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 16px var(--accent-glow);
    transform: translateY(-2px);
}

.card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    flex-wrap: wrap;
}

.card-badge {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
}

.card-location {
    font-size: 11px;
    color: var(--text-muted);
}

.card-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    display: inline-block;
    animation: pulse 2s infinite;
}

.card-stable-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-light);
    display: inline-block;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* Responsive */
@media (max-width: 640px) {
    body {
        padding-top: 70px;
    }

    .container {
        padding: 24px 16px;
    }

    h1 {
        font-size: 28px;
    }

    .input-row {
        flex-direction: column;
    }

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

    .article-card,
    .input-section {
        padding: 20px;
    }

    .meta-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hint-row {
        flex-direction: column;
        align-items: flex-start;
    }

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