:root {
    --bg-color: #0f1115;
    --card-bg: #1c1e24;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --accent: #e0245e; /* Truth Social pink-ish red? Or maybe stick to neutral/blue. Let's use a vibrant blue/purple. Trump -> maybe Red? Let's use a nice Purple/Blue gradient for header */
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --border-color: #2f3336;
    --font-stack: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-stack);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

header {
    margin-bottom: 40px;
    text-align: center;
    padding: 40px 0;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--accent-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.telegram-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-secondary); /* Text color */
    transition: all 0.2s ease;
    padding: 4px 8px;
    border-radius: 8px;
}

.telegram-link:hover {
    color: #24A1DE;
    background: rgba(36, 161, 222, 0.05);
}

.telegram-link span {
    font-weight: 500;
    font-size: 0.95rem;
}

.telegram-link img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.telegram-link:hover img {
    border-color: #24A1DE; 
}

.post-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: fadeIn 0.5s ease-out forwards;
    opacity: 0;
}

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

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.post-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.author-avatar {
    width: 48px; 
    height: 48px;
    border-radius: 50%;
    background: #333;
    margin-right: 12px;
    object-fit: cover;
}

.post-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.post-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    width: 100%; /* Ensure full width for alignment */
}

.meta-divider {
    color: var(--border-color);
}

.source-link {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-decoration: none !important;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    margin-left: auto; /* Push to right */
    cursor: pointer;
}

.translate-btn {
    margin-top: 8px;
    cursor: pointer;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding: 2px 0; /* Remove horizontal padding for plain text look or keep small */
    padding-right: 8px;
    border-radius: 4px;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.translate-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.translation-result {
    margin-top: 10px;
    padding: 10px;
    background: rgba(99, 102, 241, 0.05);
    border-left: 3px solid #6366f1;
    border-radius: 4px;
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.5;
    animation: fadeIn 0.3s ease;
}

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

.source-link:hover {
    background: rgba(99, 102, 241, 0.1);
    color: #818cf8;
    border-color: rgba(99, 102, 241, 0.3);
}

#filter-btn {
    position: fixed;
    bottom: 30px;
    /* Desktop Calculation: Center + Half Container + Gap */
    /* Container max-width: 680px -> Half: 340px */
    left: calc(50% + 360px); 
    /* Remove previous right: 30px strategy for desktop */
    width: 56px;
    height: 56px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 100;
    color: var(--text-secondary);
    font-size: 1.2rem;
}

#filter-btn:hover {
    transform: scale(1.1);
    color: var(--text-primary);
    border-color: #6366f1;
}

#filter-btn.active {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.5);
}

@media (max-width: 900px) {
    #filter-btn {
        left: auto;
        right: 20px;
        bottom: 20px;
    }
}

/* Lightbox */
#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

#lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.media-container img {
    cursor: zoom-in; /* Indicate clickable */
}

.post-content {
    font-size: 1rem;
    margin-bottom: 16px;
    word-wrap: break-word;
}

.post-content a {
    color: #4da6ff;
    text-decoration: none;
}

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

.media-container {
    margin-top: 16px;
    border-radius: 12px;
    overflow: hidden;
    /* Removed background: #000 to avoid black bars */
}

.media-container img, .media-container video {
    width: 100%;
    display: block;
    max-height: 450px; /* Reduced from 600px for smaller footprint */
    object-fit: cover; /* Fill the area, crop if necessary (no black bars) */
    background: #2f3336; /* Slight placeholder color while loading */
}

.reblog-header {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-message {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-weight: 500;
}

.hidden {
    display: none;
}

/* Loading Spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    border-top-color: #6366f1;
    animation: spin 1s ease-in-out infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
