:root {
    --bs-bg-opacity: 1;
    --bs-body-bg: #0d1117;
    --bs-body-color: #f0f6fc;
}

body {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
}

.navbar-brand {
    font-weight: bold;
    color: #58a6ff !important;
}

.card {
    background-color: #161b22;
    border: 1px solid #30363d;
}

.btn-primary {
    background-color: #238636;
    border-color: #238636;
}

.btn-primary:hover {
    background-color: #2ea043;
    border-color: #2ea043;
}

.btn-outline-primary {
    color: #58a6ff;
    border-color: #58a6ff;
}

.btn-outline-primary:hover {
    background-color: #58a6ff;
    border-color: #58a6ff;
    color: #0d1117;
}

.btn-danger {
    background-color: #da3633;
    border-color: #da3633;
}

.btn-danger:hover {
    background-color: #f85149;
    border-color: #f85149;
}

.form-control {
    background-color: #0d1117;
    border-color: #30363d;
    color: #f0f6fc;
}

.form-control:focus {
    background-color: #0d1117;
    border-color: #58a6ff;
    color: #f0f6fc;
    box-shadow: 0 0 0 0.25rem rgba(88, 166, 255, 0.25);
}

.form-select {
    background-color: #0d1117;
    border-color: #30363d;
    color: #f0f6fc;
}

.form-select:focus {
    background-color: #0d1117;
    border-color: #58a6ff;
    color: #f0f6fc;
    box-shadow: 0 0 0 0.25rem rgba(88, 166, 255, 0.25);
}

.alert-info {
    background-color: #0c2d6b;
    border-color: #1f6feb;
    color: #79c0ff;
}

.alert-success {
    background-color: #0f2817;
    border-color: #238636;
    color: #7ee787;
}

.alert-danger {
    background-color: #490202;
    border-color: #da3633;
    color: #ffa198;
}

.list-group-item {
    background-color: #21262d;
    border-color: #30363d;
    color: #f0f6fc;
}

.list-group-item:hover {
    background-color: #30363d;
}

.badge {
    background-color: #21262d !important;
    color: #f0f6fc !important;
}

.text-muted {
    color: #8b949e !important;
}

.message-content {
    background-color: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.message-meta {
    font-size: 0.875rem;
    color: #8b949e;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.limbo-message {
    border-left: 4px solid #da3633;
    opacity: 0.7;
}

.forum-item {
    cursor: pointer;
    transition: all 0.2s ease;
    color: #f0f6fc;
}

.forum-item:hover {
    transform: translateX(4px);
    color: #f0f6fc;
}

.forum-item.text-decoration-none:hover {
    text-decoration: none !important;
}

.loading {
    text-align: center;
    color: #8b949e;
    padding: 2rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(45deg, #238636, #58a6ff);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.875rem;
}

.dropdown-menu {
    background-color: #161b22;
    border-color: #30363d;
}

.dropdown-item {
    color: #f0f6fc;
}

.dropdown-item:hover {
    background-color: #21262d;
    color: #f0f6fc;
}

.nav-tabs .nav-link {
    color: #8b949e;
    border-color: transparent;
}

.nav-tabs .nav-link.active {
    color: #f0f6fc;
    background-color: #21262d;
    border-color: #30363d #30363d #21262d;
}

.toast {
    background-color: #161b22;
    border: 1px solid #30363d;
}

.toast-body {
    color: #f0f6fc;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 1s linear infinite;
}

.page {
    animation: fadeIn 0.3s ease-in-out;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-content {
    animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.btn {
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.card {
    transition: all 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.navbar {
    backdrop-filter: blur(10px);
    z-index: 1020;
    position: relative;
}

.modal-content {
    border: 1px solid #30363d;
    background-color: #161b22;
}

.form-control:focus {
    transform: translateY(-1px);
}

.list-group-item.forum-item:hover {
    border-color: #58a6ff;
}

.user-avatar:hover {
    transform: scale(1.1);
}

.text-primary {
    color: #58a6ff !important;
}

/* Markdown content styling */
.message-text blockquote {
    border-left: 4px solid #58a6ff;
    margin: 10px 0;
    padding-left: 15px;
    color: #8b949e;
    font-style: italic;
}

.message-text pre {
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 12px;
    overflow-x: auto;
    margin: 10px 0;
}

.message-text code {
    background-color: #21262d;
    border-radius: 3px;
    padding: 2px 6px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    color: #f0f6fc;
    font-size: 0.9em;
}

.message-text pre code {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    font-size: 0.85em;
}

.message-text hr {
    border: none;
    border-top: 1px solid #30363d;
    margin: 15px 0;
}

.message-text strong {
    font-weight: bold;
    color: #f0f6fc;
}

.message-text em {
    font-style: italic;
    color: #f0f6fc;
}

.message-text del {
    text-decoration: line-through;
    color: #8b949e;
}

.message-text mark {
    background-color: #ffd33d;
    color: #24292f;
    padding: 2px 4px;
    border-radius: 3px;
}

.message-text h1, .message-text h2, .message-text h3, 
.message-text h4, .message-text h5, .message-text h6 {
    color: #f0f6fc;
    margin: 15px 0 10px 0;
    font-weight: bold;
}

.message-text h1 { font-size: 1.5em; border-bottom: 1px solid #30363d; padding-bottom: 5px; }
.message-text h2 { font-size: 1.3em; }
.message-text h3 { font-size: 1.2em; }
.message-text h4 { font-size: 1.1em; }
.message-text h5 { font-size: 1em; }
.message-text h6 { font-size: 0.9em; color: #8b949e; }

.message-text ul, .message-text ol {
    margin: 10px 0;
    padding-left: 20px;
}

.message-text ul {
    list-style-type: disc;
}

.message-text ol {
    list-style-type: decimal;
}

.message-text li {
    margin: 5px 0;
    color: #f0f6fc;
}

.message-text ul li::marker,
.message-text ol li::marker {
    color: #58a6ff;
}

/* Wiki link styling */
.message-text .wiki-link {
    color: #58a6ff;
    text-decoration: none;
    cursor: pointer;
    border-bottom: 1px dotted #58a6ff;
    padding: 1px 2px;
    border-radius: 2px;
    transition: background-color 0.2s ease;
}

.message-text .wiki-link:hover {
    background-color: rgba(88, 166, 255, 0.1);
    text-decoration: underline;
}