327 lines
6.7 KiB
CSS
327 lines
6.7 KiB
CSS
:root {
|
|
--bg: #f6f8fb;
|
|
--card: #fff;
|
|
--text: #0f172a;
|
|
--muted: #6b7280;
|
|
--accent: #2563eb;
|
|
--border: #e5e7eb;
|
|
--hover: #f3f4f6;
|
|
--shadow: 0 4px 12px rgba(16, 24, 40, 0.06);
|
|
--radius: 8px;
|
|
--mono: "JetBrains Mono", monospace;
|
|
}
|
|
|
|
/* Dark mode variables */
|
|
html.dark {
|
|
--bg: #0f172a;
|
|
--card: #1e293b;
|
|
--text: #f1f5f9;
|
|
--muted: #94a3b8;
|
|
--accent: #3b82f6;
|
|
--border: #334155;
|
|
--hover: #334155;
|
|
--shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
|
|
}
|
|
* {
|
|
box-sizing: border-box;
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
html,
|
|
body {
|
|
height: 100%;
|
|
}
|
|
body {
|
|
font-family: Inter, sans-serif;
|
|
background: var(--bg);
|
|
color: var(--text);
|
|
padding: 16px;
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
transition:
|
|
background-color 0.3s ease,
|
|
color 0.3s ease;
|
|
}
|
|
.wrap {
|
|
width: 100%;
|
|
max-width: 1100px;
|
|
}
|
|
header {
|
|
margin-bottom: 14px;
|
|
}
|
|
.header-content {
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
position: relative;
|
|
}
|
|
header h1 {
|
|
text-align: center;
|
|
font-size: 1.6rem;
|
|
color: var(--text);
|
|
}
|
|
header p {
|
|
color: var(--muted);
|
|
font-size: 0.9rem;
|
|
}
|
|
.dark-mode-toggle {
|
|
position: absolute;
|
|
right: 0;
|
|
background: none;
|
|
border: 1px solid var(--border);
|
|
border-radius: var(--radius);
|
|
padding: 6px 10px;
|
|
cursor: pointer;
|
|
color: var(--text);
|
|
font-size: 1.2rem;
|
|
transition: all 0.3s ease;
|
|
}
|
|
.dark-mode-toggle:hover {
|
|
background: var(--hover);
|
|
transform: scale(1.05);
|
|
}
|
|
html.dark .dark-mode-icon::before {
|
|
content: "☀︎️";
|
|
}
|
|
html:not(.dark) .dark-mode-icon::before {
|
|
content: "⏾";
|
|
}
|
|
.dark-mode-icon {
|
|
display: inline-block;
|
|
}
|
|
.dark-mode-icon::before {
|
|
font-size: 1em;
|
|
}
|
|
.content {
|
|
display: grid;
|
|
grid-template-columns: 1fr 1fr;
|
|
gap: 12px;
|
|
}
|
|
.content.single-column {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
.card {
|
|
background: var(--card);
|
|
border-radius: var(--radius);
|
|
box-shadow: var(--shadow);
|
|
padding: 12px;
|
|
}
|
|
/* Search/filter controls */
|
|
.search-controls {
|
|
margin-bottom: 12px;
|
|
display: flex;
|
|
gap: 8px;
|
|
}
|
|
.search-input {
|
|
flex: 1;
|
|
padding: 6px 10px;
|
|
border: 1px solid var(--border);
|
|
border-radius: 4px;
|
|
font-size: 0.9rem;
|
|
background: var(--card);
|
|
color: var(--text);
|
|
transition: border-color 0.3s ease;
|
|
}
|
|
.search-input:focus {
|
|
outline: none;
|
|
border-color: var(--accent);
|
|
}
|
|
.filter-select {
|
|
padding: 6px 8px;
|
|
border: 1px solid var(--border);
|
|
border-radius: 4px;
|
|
font-size: 0.9rem;
|
|
background: var(--card);
|
|
color: var(--text);
|
|
transition: border-color 0.3s ease;
|
|
}
|
|
.filter-select:focus {
|
|
outline: none;
|
|
border-color: var(--accent);
|
|
}
|
|
/* Problems list */
|
|
.problems-list .problem-item {
|
|
padding: 8px;
|
|
border-bottom: 1px solid var(--border);
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
transition: background-color 0.3s ease;
|
|
}
|
|
.problem-item:hover {
|
|
background: var(--hover);
|
|
}
|
|
.problem-item:last-child {
|
|
border-bottom: none;
|
|
}
|
|
.problem-item a {
|
|
text-decoration: none;
|
|
color: var(--accent);
|
|
font-weight: 600;
|
|
transition: color 0.3s ease;
|
|
}
|
|
.problem-item a:hover {
|
|
text-decoration: underline;
|
|
}
|
|
/* Difficulty badge */
|
|
.difficulty {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
padding: 0.25em 0.6em;
|
|
border-radius: 10px;
|
|
font-size: 0.85em;
|
|
font-weight: bold;
|
|
text-transform: uppercase;
|
|
color: white;
|
|
white-space: nowrap;
|
|
}
|
|
.difficulty[data-difficulty="easy"] {
|
|
background-color: #4caf50; /* Green */
|
|
}
|
|
.difficulty[data-difficulty="medium"] {
|
|
background-color: #ffc107; /* Amber */
|
|
color: #333;
|
|
}
|
|
.difficulty[data-difficulty="hard"] {
|
|
background-color: #f44336; /* Red */
|
|
}
|
|
/* Leaderboard */
|
|
.leaderboard-head {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
margin-bottom: 6px;
|
|
}
|
|
.leaderboard-controls {
|
|
display: flex;
|
|
gap: 8px;
|
|
margin-bottom: 12px;
|
|
}
|
|
.leaderboard-table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
font-size: 0.9rem;
|
|
}
|
|
.leaderboard-table th,
|
|
.leaderboard-table td {
|
|
padding: 6px 8px;
|
|
border-bottom: 1px solid var(--border);
|
|
text-align: left;
|
|
}
|
|
.leaderboard-table th {
|
|
background: var(--hover);
|
|
font-weight: 600;
|
|
color: var(--muted);
|
|
}
|
|
.leaderboard-table tr:hover {
|
|
background: var(--hover);
|
|
}
|
|
/* Sort indicators */
|
|
.sortable {
|
|
cursor: pointer;
|
|
position: relative;
|
|
padding-right: 16px;
|
|
}
|
|
.sortable::after {
|
|
content: "↕";
|
|
position: absolute;
|
|
right: 4px;
|
|
top: 50%;
|
|
transform: translateY(-50%);
|
|
font-size: 0.8em;
|
|
opacity: 0.5;
|
|
}
|
|
.sort-asc::after {
|
|
content: "↑";
|
|
opacity: 1;
|
|
}
|
|
.sort-desc::after {
|
|
content: "↓";
|
|
opacity: 1;
|
|
}
|
|
/* Toggle button */
|
|
.btn {
|
|
border: none;
|
|
background: transparent;
|
|
cursor: pointer;
|
|
color: var(--accent);
|
|
font-size: 0.85rem;
|
|
padding: 4px 6px;
|
|
border-radius: 4px;
|
|
}
|
|
.btn:hover {
|
|
background: rgba(37, 99, 235, 0.08);
|
|
}
|
|
.btn.active {
|
|
background: rgba(37, 99, 235, 0.15);
|
|
}
|
|
@media (max-width: 800px) {
|
|
.content {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
.leaderboard-controls {
|
|
flex-direction: column;
|
|
}
|
|
}
|
|
|
|
/* Leaderboard horizontal collapse */
|
|
#leaderboardSection {
|
|
transition:
|
|
max-width 0.35s ease,
|
|
opacity 0.25s ease;
|
|
overflow: hidden;
|
|
max-width: 100%;
|
|
}
|
|
|
|
#leaderboardSection.hidden {
|
|
max-width: 0;
|
|
opacity: 0;
|
|
pointer-events: none;
|
|
}
|
|
|
|
#leaderboardSection.visible {
|
|
max-width: 100%; /* take full available space in grid column */
|
|
opacity: 1;
|
|
}
|
|
#rankingExplanation {
|
|
transition: all 0.35s ease;
|
|
}
|
|
|
|
/* Pagination Controls */
|
|
.pagination-controls {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
margin-top: 12px;
|
|
padding-top: 12px;
|
|
border-top: 1px solid var(--border);
|
|
}
|
|
.pagination-btn {
|
|
background: var(--card);
|
|
border: 1px solid var(--border);
|
|
border-radius: 4px;
|
|
padding: 6px 12px;
|
|
cursor: pointer;
|
|
color: var(--text);
|
|
font-size: 0.9rem;
|
|
transition: all 0.3s ease;
|
|
}
|
|
.pagination-btn:hover:not(:disabled) {
|
|
background: var(--hover);
|
|
border-color: var(--accent);
|
|
}
|
|
.pagination-btn:disabled {
|
|
opacity: 0.5;
|
|
cursor: not-allowed;
|
|
}
|
|
.pagination-info {
|
|
color: var(--muted);
|
|
font-size: 0.9rem;
|
|
}
|
|
|
|
/* Hide pagination when not needed */
|
|
.pagination-controls.hidden {
|
|
display: none;
|
|
}
|