:root {
    --bg-color: #121212;
    --text-color: #E0E0E0;
    --card-bg-color: #212121;
    --highlight-color: #39FF14;
}

[data-theme="light"] {
    --bg-color: #F0F0F0;
    --text-color: #333333;
    --card-bg-color: #FFFFFF;
    --highlight-color: #008000;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s, color 0.3s;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    border-bottom: 2px solid var(--highlight-color);
}

header h1 {
    font-size: 2em;
    font-weight: 700;
    color: var(--highlight-color);
}

.theme-switch-wrapper {
    display: flex;
    align-items: center;
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--highlight-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

main {
    padding: 20px 40px;
}

.news-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.news-card {
    background-color: var(--card-bg-color);
    border: 1px solid var(--highlight-color);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.news-card:hover {
    transform: translateY(-5px);
}

.news-card h2 {
    font-size: 1.5em;
    margin-top: 0;
    color: var(--highlight-color);
}

.news-card p {
    font-size: 1em;
    line-height: 1.6;
}

.news-card a {
    color: var(--highlight-color);
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
    margin-top: 10px;
}

.news-card a:hover {
    text-decoration: underline;
}

#loading-message {
    font-size: 1.2em;
    text-align: center;
    grid-column: 1 / -1;
}
