:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --border-color: #30363d;
    --accent-red: #f85149;
    --accent-yellow: #d29922;
    --accent-green: #3fb950;
    --accent-blue: #58a6ff;
    --accent-orange: #f0883e;
    --twitter-blue: #1d9bf0;
    --telegram-blue: #0088cc;
}

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

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

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Hero Banner */
.hero-banner {
    position: relative;
    width: 100%;
    height: 400px;
    background-image: url('/1500x500.jpeg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(13, 17, 23, 0.4) 0%, rgba(13, 17, 23, 0.85) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
    max-width: 900px;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
}

.hero-subtitle {
    color: var(--text-primary);
    font-size: 1.25rem;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8);
}

.iran-flag {
    background: linear-gradient(180deg, #2ecc71 0%, #2ecc71 42%, #ffffff 42%, #ffffff 66%, #ff3838 66%, #ff3838 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(2px 2px 8px rgba(0, 0, 0, 0.8)) brightness(1.2);
}

/* Header - kept for backwards compatibility */
header {
    padding: 2rem 0;
    text-align: center;
}

header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.lion-sun-flag {
    vertical-align: middle;
    margin-left: 0.5rem;
    margin-bottom: 0.15rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

.last-updated {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Main Content */
main {
    padding: 1.5rem 0;
}

.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.source-note {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.source-note a {
    color: var(--accent-blue);
    text-decoration: none;
}

.source-note a:hover {
    text-decoration: underline;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-item {
    background: var(--bg-tertiary);
    border-radius: 6px;
    padding: 1.25rem;
    text-align: center;
}

.stat-item.loading {
    opacity: 0.5;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-red);
    margin-bottom: 0.25rem;
}

.stat-number.injuries {
    color: var(--accent-yellow);
}

.stat-number.arrests {
    color: var(--accent-orange);
}

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

.stat-source {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.stat-source a {
    color: var(--text-muted);
    text-decoration: underline;
}

.stat-source a:hover {
    color: var(--text-secondary);
}

/* Internet status number styling */
.stat-number.internet {
    font-size: 2rem;
    text-decoration: none;
    display: block;
}


.stat-number.internet.severe {
    color: var(--accent-red);
}

.stat-number.internet.partial {
    color: var(--accent-yellow);
}

.stat-number.internet.normal {
    color: var(--accent-green);
}

.sources {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.sources a {
    color: var(--text-muted);
    text-decoration: underline;
}

.loading-placeholder {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

.post {
    background: var(--bg-tertiary);
    border-radius: 6px;
    padding: 1rem;
    border-left: 3px solid var(--border-color);
}

.post.telegram {
    border-left-color: var(--telegram-blue);
}

.post-content {
    font-size: 0.9375rem;
    line-height: 1.5;
    margin-bottom: 0.75rem;
    white-space: pre-wrap;
    word-break: break-word;
    text-align: start;
}

.post-content a {
    color: var(--accent-blue);
    text-decoration: none;
}

.post-content a:hover {
    text-decoration: underline;
}

.post-media {
    margin-bottom: 0.75rem;
}

.post-media img {
    max-width: 100%;
    border-radius: 6px;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.post-time {
    color: var(--text-muted);
}

.post-link {
    color: var(--accent-blue);
    text-decoration: none;
}

.post-link:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

footer p {
    margin-bottom: 0.5rem;
}

footer p:last-child {
    margin-bottom: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-banner {
        height: 350px;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }
}

@media (max-width: 600px) {
    .hero-banner {
        height: 300px;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

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

    .stat-number {
        font-size: 1.75rem;
    }
}

/* Error state */
.error-message {
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid var(--accent-red);
    border-radius: 6px;
    padding: 1rem;
    color: var(--accent-red);
    text-align: center;
}

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

/* Twitter Accounts Grid */
.twitter-accounts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.twitter-account {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
    border-left: 3px solid var(--twitter-blue);
    text-decoration: none;
    transition: all 0.2s;
}

.twitter-account:hover {
    background: var(--bg-primary);
    transform: translateY(-2px);
}

.twitter-account .account-name {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.twitter-account .account-handle {
    color: var(--twitter-blue);
    font-size: 0.8rem;
}

@media (max-width: 600px) {
    .twitter-accounts {
        grid-template-columns: 1fr;
    }
}

/* Telegram Grid Layout */
.telegram-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.telegram-grid:last-child {
    margin-bottom: 0;
}

.telegram-channel {
    background: var(--bg-tertiary);
    border-radius: 6px;
    border-left: 3px solid var(--telegram-blue);
    overflow: hidden;
}

.channel-title {
    padding: 0.75rem 1rem;
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.channel-title a {
    color: var(--telegram-blue);
    text-decoration: none;
}

.channel-title a:hover {
    text-decoration: underline;
}

.telegram-posts {
    padding: 0.75rem;
    max-height: 500px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.telegram-posts .post {
    margin: 0;
    border-left: none;
    background: var(--bg-secondary);
}

.telegram-posts .post-content {
    font-size: 0.85rem;
    line-height: 1.5;
}

.telegram-posts .loading-placeholder,
.telegram-posts .empty-state,
.telegram-posts .error-message {
    padding: 1rem;
    text-align: center;
}

@media (max-width: 600px) {
    .telegram-grid {
        grid-template-columns: 1fr;
    }

    .telegram-posts {
        max-height: 400px;
    }
}
