:root {
    --bg-color: #f4f4f4;
    --card-bg: white;
    --text-color: #333;
    --text-secondary: #666;
    --title-color: #0056b3;
    --border-color: #ccc;
    --control-bg: white;
    --overlay-bg: rgba(0,0,0,0.5);
}

body.dark-mode {
    --bg-color: #1a1a1a;
    --card-bg: #2d2d2d;
    --text-color: #e0e0e0;
    --text-secondary: #aaa;
    --title-color: #6fb1fc;
    --border-color: #444;
    --control-bg: #333;
    --overlay-bg: rgba(0,0,0,0.8);
}

body { 
    font-family: sans-serif; 
    line-height: 1.6; 
    max-width: 900px; 
    margin: 20px auto; 
    padding: 0 15px; 
    background: var(--bg-color); 
    color: var(--text-color);
    transition: background 0.3s, color 0.3s;
}

h1 { text-align: center; margin: 0; flex-grow: 1; font-size: 1.5rem; }

.header-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background: var(--card-bg);
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Sidebar / Settings Panel */
.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-bg);
    display: none;
    z-index: 1000;
}

.settings-panel {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100%;
    background: var(--card-bg);
    box-shadow: -2px 0 10px rgba(0,0,0,0.2);
    z-index: 1001;
    transition: right 0.3s ease;
    padding: 20px;
    overflow-y: auto;
}

.settings-panel.open {
    right: 0;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.settings-section {
    margin-bottom: 20px;
}

.settings-section h3 {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.source-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    cursor: pointer;
}

.source-item input {
    cursor: pointer;
}

/* Existing styles */
.controls { 
    background: var(--control-bg); 
    padding: 15px; 
    border-radius: 8px; 
    margin-bottom: 20px; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 10px; 
}

.controls label { font-weight: bold; }
select { 
    padding: 8px; 
    border-radius: 5px; 
    border: 1px solid var(--border-color); 
    background: var(--card-bg);
    color: var(--text-color);
}

.news-item { 
    position: relative;
    background: var(--card-bg); 
    margin-bottom: 15px; 
    padding: 15px; 
    border-radius: 8px; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); 
    border-left: 10px solid #ccc; 
    transition: transform 0.2s, background 0.3s, opacity 0.2s; 
}
.news-item:hover { transform: scale(1.01); }

.close-news {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.5;
    transition: opacity 0.2s, color 0.2s;
    padding: 5px;
    line-height: 1;
    z-index: 5;
}

.news-item:hover .close-news {
    opacity: 1;
}

.close-news:hover {
    color: #cc0000;
}

.source { font-size: 0.8em; color: var(--text-secondary); margin-bottom: 5px; }
.title { font-size: 1.2em; font-weight: bold; text-decoration: none; color: var(--title-color); }
.score { float: right; padding: 5px 10px; border-radius: 15px; font-weight: bold; font-size: 0.9em; margin-right: 25px; }

/* Score colors */
.score-low { background: #ffcccc; color: #cc0000; }
.score-mid { background: #fff3cd; color: #856404; }
.score-high { background: #d4edda; color: #155724; }

body.dark-mode .score-low { background: #4d1a1a; color: #ff9999; }
body.dark-mode .score-mid { background: #4d3d1a; color: #ffcc66; }
body.dark-mode .score-high { background: #1a4d1a; color: #99ff99; }

.description { margin-top: 10px; font-size: 0.95em; opacity: 0.9; }
.date { font-size: 0.8em; color: var(--text-secondary); margin-top: 10px; text-align: right; }
.footer { text-align: center; margin-top: 30px; font-size: 0.8em; color: var(--text-secondary); }

.hidden { display: none !important; }
