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

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
    --accent: #3b82f6;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 20px;
    margin-bottom: 40px;
    box-shadow: 0 10px 40px rgba(37, 99, 235, 0.3);
}

header h1 {
    font-size: 3em;
    margin-bottom: 10px;
    font-weight: 800;
}

.subtitle {
    font-size: 1.2em;
    opacity: 0.9;
    margin-bottom: 20px;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
    font-size: 1.1em;
}

.stats span {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 20px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.loading {
    text-align: center;
    padding: 60px 20px;
    font-size: 1.2em;
    color: var(--text-muted);
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.post-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    animation: fadeIn 0.5s ease;
}

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

.post-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-color: var(--accent);
}

.post-media {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 16px;
}

.post-content {
    font-size: 1.05em;
    line-height: 1.7;
    margin-bottom: 16px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 0.9em;
}

.post-source {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

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

.post-date {
    color: var(--text-muted);
    font-size: 0.85em;
}

.post-type-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    font-size: 0.75em;
    text-transform: uppercase;
    font-weight: 600;
    margin-left: 8px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 40px 0;
}

.pagination button {
    padding: 12px 24px;
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
}

.pagination button:hover:not(:disabled) {
    background: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.pagination button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination button.active {
    background: var(--primary);
    border-color: var(--primary);
}

footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    margin-top: 60px;
}

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

    header h1 {
        font-size: 2em;
    }

    .stats {
        flex-direction: column;
        gap: 10px;
    }
}