/* Dark Mode Theme */
body.dark-mode {
    --background-color: #121212;
    --text-color: #f4f4f4;
    --header-background: #1e1e1e;
    --footer-background: #1e1e1e;
    --card-background: #2e2e2e;
    --link-color: #ffcc00;
    --card-hover-shadow: rgba(255, 255, 255, 0.2);
}

/* General Styles */
body {
    font-family: Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    transition: background-color 0.5s, color 0.5s;
}

header {
    background-color: var(--header-background);
    padding: 20px;
    text-align: center;
}

h1, h2, h3, h4 {
    color: #ffffff;
    margin: 0;
}

nav ul {
    list-style: none;
    padding: 0;
    text-align: center;
}

nav ul li {
    display: inline;
    margin: 0 15px;
}

nav ul li a {
    color: var(--link-color);
    text-decoration: none;
}

main {
    padding: 20px;
}

footer {
    background-color: var(--footer-background);
    color: var(--text-color);
    text-align: center;
    padding: 10px;
    font-size: 0.9em;
    margin-top: 40px;
}

/* Problem and Mod Cards */
.problem-list, .mod-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
}

.problem-card, .mod-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: var(--card-background);
    border: 1px solid var(--card-hover-shadow);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    position: relative;
}

.problem-card:hover, .mod-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px var(--card-hover-shadow);
}

.problem-card img, .mod-card img {
    width: 100%;
    max-width: 150px;
    margin: 0 auto 15px;
    border-radius: 5px;
    transition: transform 0.3s;
}

.problem-card:hover img, .mod-card:hover img {
    transform: scale(1.05);
}

.problem-card h3, .mod-card h3 {
    font-size: 1.25rem;
    margin-bottom: 10px;
    line-height: 1.3;
}

.problem-card p, .mod-card p {
    flex-grow: 1;
    font-size: 14px;
    line-height: 1.5;
    overflow-wrap: break-word;
    white-space: normal;
    max-height: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Buttons */
.more-info-btn, .download-btn, button#theme-toggle {
    background-color: var(--link-color);
    color: #000;
    padding: 10px 15px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    display: inline-block;
    margin-top: 10px;
    cursor: pointer;
    text-align: center;
}

.more-info-btn:hover, .download-btn:hover, button#theme-toggle:hover {
    background-color: #ffd700;
    opacity: 0.9;
}

/* Search Bar */
.search-bar {
    margin: 50px auto;
    width: 100%;
    text-align: center;
}

#modSearch {
    width: 30%;
    padding: 12px 16px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 25px;
    outline: none;
    transition: box-shadow 0.3s, border-color 0.3s;
    box-sizing: border-box;
}

#modSearch:focus {
    border-color: #007acc;
    box-shadow: 0 0 8px rgba(0, 122, 204, 0.5);
}

/* Admin Panel */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table th, table td {
    padding: 10px;
    text-align: left;
    border: 1px solid #ccc;
}

table th {
    background-color: #007acc;
    color: white;
}

/* Forms */
form {
    margin: 0 auto;
    width: 300px;
    padding: 45px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f4f4f4;
}

input[type="text"], input[type="password"], input[type="submit"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-bottom: 10px;
}

input[type="submit"] {
    background-color: #007acc;
    color: white;
    cursor: pointer;
}

input[type="submit"]:hover {
    background-color: #005f99;
}

/* Links */
a {
    color: var(--link-color);
    text-decoration: none;
}

a:hover {
    color: #ffffff;
    text-decoration: underline;
}

