﻿/* Sidebar */
.sidebar {
    width: 250px;
    min-width: 250px;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    min-height: 0;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
}

.logo {
    padding: 1.1rem 1.3rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.logo-img {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    object-fit: cover;
}

.logo-text {
    flex: 1;
}

.logo h1 {
    font-size: 1.3rem;
    margin-bottom: 0.15rem;
}

.logo p {
    color: var(--text-secondary);
    font-size: 0.76rem;
}

.nav {
    flex: 1 1 auto;
    padding: 0.35rem 0;
    padding-right: 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: scroll;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
    scrollbar-width: auto;
    scrollbar-color: var(--border) #1e2124;
    border-left: 3px solid transparent;
    box-shadow: inset -1px 0 0 var(--border);
}

.nav::-webkit-scrollbar {
    width: 14px;
}

.nav::-webkit-scrollbar-track {
    background: #1e2124;
    border-left: 1px solid var(--border);
    border-radius: 0;
}

.nav::-webkit-scrollbar-thumb {
    background: var(--border);
    border: 3px solid #1e2124;
    border-radius: 8px;
    min-height: 48px;
}

.nav::-webkit-scrollbar-thumb:hover {
    background: var(--bg-light);
}

.nav::-webkit-scrollbar-thumb:active {
    background: #4f545c;
}

.nav::-webkit-scrollbar-corner {
    background: #1e2124;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.74rem 1.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    white-space: nowrap;
    overflow: hidden;
    font-size: 1rem;
}

.nav-item i {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-item:hover {
    background: var(--bg-light);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--bg-light);
    color: var(--text-primary);
    border-left-color: var(--primary);
}

.nav-item span {
    font-size: 1rem;
}

.nav-separator {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--border) 30%, var(--border) 70%, transparent 100%);
    margin: 0.38rem 1rem;
    opacity: 1;
    border-radius: 1px;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: var(--bg-dark);
    margin-top: auto;
    flex-shrink: 0;
}

.legal-links {
    display: flex;
    gap: 8px;
}

.legal-link {
    flex: 1;
    display: block;
    padding: 8px;
    background: rgba(115, 115, 115, 0.1);
    color: #B9BBBE;
    text-decoration: none;
    border-radius: 6px;
    text-align: center;
    font-size: 0.75rem;
    transition: all 0.3s;
    border: 1px solid rgba(115, 115, 115, 0.3);
}

.legal-link:hover {
    background: rgba(115, 115, 115, 0.2);
    border-color: rgba(115, 115, 115, 0.5);
    transform: translateY(-1px);
}

.server-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--bg-dark);
    border-radius: 10px;
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.server-status:hover {
    border-color: var(--success);
    background: rgba(87, 242, 135, 0.05);
}

.server-status .bot-icon {
    width: 20px;
    height: 20px;
    color: var(--success);
    flex-shrink: 0;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-text {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
}

.logout-btn {
    background: var(--danger);
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success);
    position: relative;
    animation: pulse 2s infinite;
    box-shadow: 0 0 0 0 rgba(87, 242, 135, 0.7);
}

.status-dot::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--success);
    animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.status-dot.red {
    background: var(--danger);
    box-shadow: 0 0 0 0 rgba(237, 66, 69, 0.7);
}

.status-dot.red::before {
    background: var(--danger);
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1;
        box-shadow: 0 0 8px 2px rgba(87, 242, 135, 0.4);
    }
    50% { 
        opacity: 0.8;
        box-shadow: 0 0 12px 4px rgba(87, 242, 135, 0.6);
    }
}

@keyframes ping {
    75%, 100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.header {
    background: var(--bg-dark);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h2 {
    font-size: 1.75rem;
}

.header-title-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.auto-refresh-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    background: rgba(88, 101, 242, 0.15);
    border: 1px solid rgba(88, 101, 242, 0.3);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 500;
    transition: all 0.2s;
    cursor: help;
}

.auto-refresh-badge:hover {
    background: rgba(88, 101, 242, 0.25);
    border-color: var(--primary);
}

.auto-refresh-badge i {
    width: 0.875rem;
    height: 0.875rem;
    animation: spin 3s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.refresh-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--primary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.refresh-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.4);
}

.server-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--bg-light);
    border-radius: 6px;
}

.server-info img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}


.ticker-item {
    font-size: 0.875rem;
    color: #fff;
    font-weight: 500;
}

.ticker-separator {
    color: rgba(255, 255, 255, 0.5);
    font-size: 1rem;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.content {
    flex: 1;
    padding: 2rem;
    padding-bottom: 4rem;
    overflow-y: auto;
    background: var(--bg-darker);
}

/* Pages */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-2px);
}

.card-icon {
    font-size: 2.5rem;
}

.card-value {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.card-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Charts */
.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}

.chart-card h3 {
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.chart-card.full-width {
    grid-column: 1 / -1;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h3 {
    font-size: 1.25rem;
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.filter-btn:hover {
    background: var(--bg-light);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--text-primary);
}

