:root {
    --global-sidebar-bg: #1e1f22;
    --sidebar-bg: #1e1f22;
    --topic-sidebar-bg: #2b2d31;
    --main-bg: #313338;
    --text-color: #dbdee1;
    --header-height: 48px;

    /* Custom overrides for Bootstrap on dark background */
    --bs-nav-link-color: #00a8fc;
    --bs-nav-link-hover-color: #31befc;
    --bs-link-color: #00a8fc;
    --bs-link-hover-color: #31befc;
}

a {
    color: #00a8fc;
    text-decoration: none;
}

a:hover {
    color: #31befc;
    text-decoration: underline;
}

body, html {
    height: 100%;
    margin: 0;
    overflow: hidden;
    background-color: var(--global-sidebar-bg, #1e1f22);
    color: var(--text-color);
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

.club-sidebar {
    width: 72px;
    background-color: var(--global-sidebar-bg, #1e1f22);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 12px;
    padding-bottom: 12px;
    flex-shrink: 0;
}

.sidebar-spacer {
    flex-grow: 1;
}

.club-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: #313338;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: border-radius 0.2s, background-color 0.2s;
}

.club-icon:hover {
    border-radius: 30%;
    background-color: var(--accent-color, #5865f2);
}

.club-icon i {
    font-size: 24px;
}

.club-icon.active {
    border-radius: 30%;
    background-color: var(--accent-color, #5865f2);
}

.topic-sidebar {
    width: 240px;
    background-color: var(--topic-sidebar-bg);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.club-header {
    height: var(--header-height);
    padding: 0 16px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #1f2023;
}

.topic-list {
    flex-grow: 1;
    padding: 8px;
    overflow-y: auto;
}

.user-info {
    height: 52px;
    background-color: #232428;
    padding: 0 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.main-content {
    flex-grow: 1;
    background-color: var(--main-bg);
    display: flex;
    flex-direction: column;
}

.top-bar {
    height: var(--header-height);
    padding: 0 16px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #1f2023;
    font-weight: bold;
}

.content-area {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .club-sidebar {
        display: none; /* Hide main sidebar on mobile */
    }

    .topic-sidebar {
        position: fixed;
        left: -240px;
        top: 0;
        bottom: 0;
        z-index: 1050;
        transition: left 0.3s ease;
        width: 240px;
    }

    .topic-sidebar.show {
        left: 0;
        display: flex !important;
    }

    .mobile-top-bar {
        height: var(--header-height);
        background-color: var(--topic-sidebar-bg);
        display: flex;
        align-items: center;
        padding: 0 8px;
        border-bottom: 1px solid #1f2023;
        flex-shrink: 0;
    }

    .content-area {
        padding: 10px;
    }

    /* Sidebar Overlay */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1040;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .joined-clubs-mobile::-webkit-scrollbar {
        height: 4px;
    }
    .joined-clubs-mobile::-webkit-scrollbar-thumb {
        background: #4e5058;
        border-radius: 2px;
    }
}

.topic-item {
    padding: 6px 8px;
    margin: 2px 0;
    border-radius: 4px;
    cursor: pointer;
    color: #949ba4;
    display: flex;
    align-items: center;
    gap: 8px;
}

.topic-item:hover {
    background-color: #35373c;
    color: #dbdee1;
}

.topic-item.active {
    background-color: #404249;
    color: white;
}

.topic-item i {
    font-size: 1.2rem;
}

.topic-item a {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #1e1f22;
    border-radius: 4px;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;  
    overflow: hidden;
}

#home-feed-container {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.feed-item {
    transition: transform 0.2s;
}

.feed-item:hover {
    transform: translateY(-2px);
    border-color: var(--accent-color, #5865f2) !important;
}
.race-timer {
    font-size: 5rem;
    font-weight: bold;
    font-family: monospace;
    margin: 20px 0;
    color: #dbdee1;
}

.race-timer.finishing {
    color: #ff4444;
}

.lap-time {
    font-family: monospace;
    font-weight: bold;
}

.position-1 { color: #ffd700; }
.position-2 { color: #c0c0c0; }
.position-3 { color: #cd7f32; }

.countdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    color: white;
    font-size: 15vw;
    font-weight: bold;
}

.countdown-number {
    animation: countdownPulse 1s ease-out infinite;
}

.countdown-go {
    color: #28a745;
    animation: countdownPulse 1s ease-out;
}

@keyframes countdownPulse {
    0% { transform: scale(0.5); opacity: 0; }
    20% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

#raceView {
    display: none;
}

/* Link Preview Embeds */
.link-embed {
    max-width: 500px;
    background-color: #2b2d31;
    border-left: 4px solid #1e1f22;
    border-radius: 4px;
    margin-top: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.link-embed-content {
    padding: 12px;
    display: flex;
    flex-direction: row;
    gap: 12px;
}

.link-embed-text {
    flex: 1;
    min-width: 0;
}

.link-embed-site {
    font-size: 0.75rem;
    color: #dbdee1;
    margin-bottom: 4px;
}

.link-embed-title {
    font-size: 1rem;
    font-weight: 600;
    color: #00a8fc;
    text-decoration: none;
    display: block;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-embed-title:hover {
    color: #31befc;
    text-decoration: underline;
}

.link-embed-description {
    font-size: 0.875rem;
    color: #b5bac1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.link-embed-image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.link-embed-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

@media (max-width: 576px) {
    .link-embed {
        max-width: 100%;
    }
}

.text-muted {
    color: #949ba4 !important;
}

.message-timestamp {
    color: #a3a9b1;
    font-size: 0.75rem;
    margin-left: 8px;
}

.btn-xxs {
    padding: 1px 4px;
    font-size: 0.65rem;
    line-height: 1;
    border-radius: 2px;
}
