body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: #f0f2f5; color: #050505; margin: 0; padding: 20px; }
.header-container { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.title-area { display: flex; align-items: center; gap: 15px; }
.title-area img { width: 60px; height: auto; border-radius: 50%; }

/* --- SOURCE LINKS --- */
.source-links { font-size: 1.1em; margin-bottom: 20px; color: #65676b; }
.source-links a { color: #1877f2; text-decoration: none; font-weight: 500; }
.source-links a:hover { text-decoration: underline; }

/* Solid, non-vibrating generic menu */
.filter-form { background: #fff; padding: 15px; margin-bottom: 25px; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; position: relative; z-index: 100; }
.filter-form input[type="text"], .filter-form select { padding: 8px 12px; border: 1px solid #ccc; border-radius: 6px; font-size: 0.9em; flex: 1; min-width: 150px; }
.filter-form button { background: #1877f2; color: #fff; border: none; padding: 8px 16px; border-radius: 6px; cursor: pointer; font-weight: bold; }
.btn-secondary { background: #e4e6eb !important; color: #050505 !important; }
.btn-secondary:hover { background: #d8dadf !important; }

/* Grid System */
.news-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }

/* --- PREMIUM 1-COLUMN CARD (DEFAULT) --- */
.card { background: #fff; border-radius: 30px; padding: 30px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); display: flex; flex-direction: column; border: 10px solid transparent; margin-top: 20px; transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s; }
/* --- ALTERNATING CARD BORDERS --- */
.card:nth-child(odd) {
    border-color: red; /* A nice, readable Green */
}
.card:nth-child(even) {
    border-color: yellow; /* A warm, readable Yellow/Gold */
}

.card:hover { transform: translateY(-4px); box-shadow: 0 12px 25px rgba(0,0,0,0.1); }
.card.selected { border-color: #1877f2; background: #f0f7ff; }

.meta { font-size: 1.7em; color: #65676b; display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.checkbox-wrapper { display: flex; align-items: center; gap: 8px; }
.item-checkbox { transform: scale(1.5); cursor: pointer; margin: 0; }

.card h2 { font-size: 2.2em; margin: 0 0 15px 0; line-height: 1.3; font-weight: 800; }
.card h2 a { color: #050505; text-decoration: none; }
.card h2 a:hover { text-decoration: underline; color: #1877f2; }

.location-tag { display: inline-block; font-size: 1.7em; color: #1877f2; margin-bottom: 15px; font-weight: bold; }
.badge { background: #e7f3ff; color: #1877f2; padding: 5px 12px; border-radius: 12px; font-size: 0.6em; font-weight: bold; vertical-align: middle; }

.snippet-toggle { background: #f0f2f5; border: none; padding: 15px; border-radius: 8px; cursor: pointer; font-size: 1.5em; font-weight: bold; margin-top: auto; color: #050505; width: 100%; text-align: left; transition: background 0.2s; }
.snippet-toggle:hover { background: #e4e6eb; }
.snippet-content { display: none; margin-top: 15px; padding-left: 15px; border-left: 4px solid #1877f2; font-size: 1.8em; line-height: 1.6; color: #333; }
.tag-container { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.tag { background: #e4e6eb; color: #050505; padding: 6px 12px; border-radius: 6px; font-size: 0.7em; font-weight: 500; }

.pagination { text-align: center; margin-top: 30px; padding: 20px 0; }
.btn-page { background: #fff; padding: 10px 20px; border-radius: 6px; text-decoration: none; color: #1877f2; font-weight: bold; box-shadow: 0 1px 2px rgba(0,0,0,0.1); margin: 0 5px; }
.page-info { margin: 0 15px; font-weight: bold; color: #65676b; }

#fab-analyze { position: fixed; bottom: 30px; right: 30px; background: #1877f2; color: white; border: none; border-radius: 30px; padding: 15px 25px; font-size: 1.1em; font-weight: bold; box-shadow: 0 4px 12px rgba(0,0,0,0.3); cursor: pointer; display: none; z-index: 1000; transition: transform 0.2s; }
#fab-analyze:hover { transform: scale(1.05); }

/* Modals */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); display: none; justify-content: center; align-items: center; z-index: 2000; }
.modal-content { background: white; padding: 25px; border-radius: 12px; width: 90%; max-width: 600px; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #ddd; padding-bottom: 10px; margin-bottom: 20px; }
.close-btn { background: none; border: none; font-size: 1.5em; cursor: pointer; color: #666; }

.tabs { display: flex; gap: 10px; margin-bottom: 20px; }
.tab-btn { flex: 1; padding: 10px; background: #f0f2f5; border: none; border-radius: 6px; cursor: pointer; font-weight: bold; }
.tab-btn.active { background: #1877f2; color: white; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

.export-box { width: 100%; height: 200px; padding: 15px; border: 1px solid #ccc; border-radius: 6px; font-family: monospace; font-size: 0.9em; resize: vertical; box-sizing: border-box; margin-bottom: 15px; }
.copy-btn { width: 100%; background: #4caf50; color: white; border: none; padding: 12px; border-radius: 6px; font-weight: bold; cursor: pointer; font-size: 1em; }
.copy-btn:hover { background: #45a049; }

.ai-links { display: flex; gap: 10px; margin-top: 15px; }
.ai-btn { flex: 1; text-align: center; text-decoration: none; padding: 10px; border-radius: 6px; font-weight: bold; color: white; }
.btn-gemini { background: #1a73e8; }
.btn-chatgpt { background: #10a37f; }
.btn-claude { background: #d97757; }

/* Toast */
#pref-toast { visibility: hidden; min-width: 250px; background-color: #333; color: #fff; text-align: center; border-radius: 6px; padding: 16px; position: fixed; z-index: 1000; left: 50%; bottom: 30px; font-size: 17px; transform: translateX(-50%); opacity: 0; transition: opacity 0.3s; }
#pref-toast.show { visibility: visible; opacity: 1; }

/* --- DARK MODE OVERRIDES --- */
[data-theme="dark"] body { background: #18191a; color: #e4e6eb; }
[data-theme="dark"] .header-container,
[data-theme="dark"] .filter-form,
[data-theme="dark"] .card,
[data-theme="dark"] .modal-content { background: #242526; box-shadow: 0 1px 2px rgba(255,255,255,0.05); border-color: #3a3b3c; }
[data-theme="dark"] input[type="text"], 
[data-theme="dark"] select,
[data-theme="dark"] textarea.export-box { background: #3a3b3c; color: #e4e6eb; border-color: #4e4f50; }
[data-theme="dark"] .btn-secondary { background: #3a3b3c !important; color: #e4e6eb !important; }
[data-theme="dark"] .btn-secondary:hover { background: #4e4f50 !important; }
[data-theme="dark"] h2 a { color: #e4e6eb; }
[data-theme="dark"] .card { border-color: #3a3b3c; }
[data-theme="dark"] .card.selected { border-color: #4facfe; background: #2b3a4a; }
[data-theme="dark"] .meta, 
[data-theme="dark"] .tag,
[data-theme="dark"] .tab-btn { color: #b0b3b8; }
[data-theme="dark"] .tag,
[data-theme="dark"] .snippet-toggle,
[data-theme="dark"] .tab-btn { background: #3a3b3c; color: #e4e6eb; }
[data-theme="dark"] .badge { background: rgba(24, 119, 242, 0.2); color: #4facfe; }
[data-theme="dark"] .snippet-content { background: #1c1e21; border-left-color: #4facfe; color: #e4e6eb; }
[data-theme="dark"] .modal-header { border-bottom-color: #3a3b3c; }
[data-theme="dark"] .close-btn { color: #e4e6eb; }
[data-theme="dark"] .source-links { color: #b0b3b8; }
[data-theme="dark"] .source-links a { color: #4facfe; }
[data-theme="dark"] .feed-btn { background: #3a3b3c; color: #e4e6eb; border-color: #4e4f50; }

/* --- DENSITY CONTROLS (COLUMN VIEWS) --- */
.news-grid.grid-2-col { grid-template-columns: repeat(2, 1fr); }
.news-grid.grid-3-col { grid-template-columns: repeat(3, 1fr); }

/* Revert to compact styling for 2 and 3 columns */
.news-grid.grid-2-col .card, 
.news-grid.grid-3-col .card { padding: 15px; border-radius: 12px; transform: none; box-shadow: 0 1px 2px rgba(0,0,0,0.1); border-color: transparent; }
.news-grid.grid-2-col .card:hover, 
.news-grid.grid-3-col .card:hover { transform: none; box-shadow: 0 4px 8px rgba(0,0,0,0.1); }

.news-grid.grid-2-col .card h2, 
.news-grid.grid-3-col .card h2 { font-size: 1.1em; line-height: 1.4; margin-bottom: 10px; font-weight: 700; }
.news-grid.grid-2-col .meta, 
.news-grid.grid-3-col .meta { font-size: 0.85em; margin-bottom: 10px; }
.news-grid.grid-2-col .location-tag, 
.news-grid.grid-3-col .location-tag { font-size: 0.85em; margin-bottom: 10px; }
.news-grid.grid-2-col .badge, 
.news-grid.grid-3-col .badge { font-size: 0.85em; padding: 3px 8px; }

.news-grid.grid-2-col .snippet-toggle, 
.news-grid.grid-3-col .snippet-toggle { font-size: 0.9em; padding: 8px; }
.news-grid.grid-2-col .snippet-content, 
.news-grid.grid-3-col .snippet-content { font-size: 0.9em; padding-left: 10px; border-left-width: 3px; margin-top: 10px; }
.news-grid.grid-2-col .tag, 
.news-grid.grid-3-col .tag { font-size: 0.8em; padding: 4px 8px; }

/* --- SMART FILTERS BAR --- */
#feed-buttons-container { display: flex; gap: 10px; flex: 1; overflow-x: auto; padding-bottom: 5px; }
.feed-btn { background: #e4e6eb; color: #050505; border: 1px solid #ccc; padding: 8px 16px; border-radius: 20px; cursor: pointer; font-weight: 500; white-space: nowrap; }
.feed-btn:hover { background: #1877f2; color: #fff; border-color: #1877f2; }

/* --- MOBILE RESPONSIVENESS & FONT SCALING --- */
@media (max-width: 768px) {
    /* Increase base font size by ~20% */
    body { font-size: 14px; }
    
    .filter-form input[type="text"], 
    .filter-form select, 
    .filter-form button { font-size: 0.9em; padding: 12px 16px; }
    
    .filter-form { padding: 10px; top: 0; border-radius: 0 0 12px 12px; }
    
    .news-grid, .news-grid.grid-2-col, .news-grid.grid-3-col {
        display: grid;
        grid-template-columns: 1fr !important; /* Forces 1 single column */
        gap: 15px; /* Adds a little breathing room between stacked cards */
    }
}