:root {
    --bg-color: #f4f4f9;
    --text-color: #333333;
    --container-bg: #ffffff;
    --border-color: #dddddd;
    --accent-color: #007bff;
    --accent-hover: #0056b3;
    --slider-bg: #ccc;
}

body.dark-mode {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --container-bg: #1e1e1e;
    --border-color: #333333;
    --accent-color: #bb86fc;
    --accent-hover: #9b5de5;
    --slider-bg: #555;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem;
    min-height: 100vh;
}

.layout-wrapper {
    display: flex;
    gap: 2rem;
    max-width: 1200px;
    width: 100%;
    align-items: flex-start;
}

@media (max-width: 900px) {
    .layout-wrapper {
        flex-direction: column;
        align-items: center;
    }
}

.container {
    background-color: var(--container-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    width: 100%;
    transition: background-color 0.3s, box-shadow 0.3s;
}

body.dark-mode .container {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

h1 {
    font-size: 1.35rem;
    white-space: nowrap;
}

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

#theme-label {
    margin-left: 10px;
    font-size: 0.9rem;
}

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

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--slider-bg);
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

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

input:focus + .slider {
    box-shadow: 0 0 1px var(--accent-color);
}

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

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

.control-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

input[type="number"], input[type="range"] {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 0.25rem;
}

input[type="number"] {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-color);
    color: var(--text-color);
}

input[type="range"] {
    -webkit-appearance: none;
    background: transparent;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    margin-top: -6px;
}

input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: var(--slider-bg);
    border-radius: 2px;
}

.description {
    font-size: 0.8rem;
    color: #888;
}

button {
    width: 100%;
    padding: 1rem;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 1rem;
}

button:hover {
    background-color: var(--accent-hover);
}

footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.8rem;
    color: #888;
}

.timeline-container {
    background-color: var(--container-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    flex-grow: 1;
    width: 100%;
    max-width: 600px;
    transition: background-color 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    max-height: 80vh;
}

body.dark-mode .timeline-container {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
}

.timeline-container h2 {
    font-size: 1.35rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.timeline-list {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-right: 0.5rem;
}

.timeline-list::-webkit-scrollbar {
    width: 8px;
}
.timeline-list::-webkit-scrollbar-thumb {
    background: var(--slider-bg);
    border-radius: 4px;
}

.timeline-item {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    font-size: 1.1rem;
}

.timeline-meta {
    font-size: 0.85rem;
    color: #888;
}

.timeline-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    background-color: var(--container-bg);
    border: 1px solid var(--border-color);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.timeline-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.vote-group {
    display: flex;
    gap: 0.5rem;
}

.vote-btn {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0;
    width: auto;
}

.vote-btn:hover {
    background-color: var(--bg-color);
}

.vote-btn.active-good {
    background-color: rgba(40, 167, 69, 0.2);
    border-color: #28a745;
}
.vote-btn.active-bad {
    background-color: rgba(220, 53, 69, 0.2);
    border-color: #dc3545;
}

.dl-btn {
    margin-top: 0;
    width: auto;
    padding: 0.4rem 1.2rem;
    font-size: 0.9rem;
}
