/* NSLDNK Activity Board — Main Styles */

:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: #1a2332;
    --bg-card-hover: #1f2b3d;
    --border-color: #2a3548;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-primary: #3b82f6;
    --accent-secondary: #8b5cf6;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius: 8px;
    --radius-sm: 4px;
    --radius-lg: 12px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --transition: 200ms ease;
}

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

html, body {
    height: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
#sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 240px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px 12px;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-logo {
    padding: 8px 12px 24px;
    display: flex;
    align-items: baseline;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition);
}

.sidebar-link:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-primary);
}

.sidebar-link .icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.sidebar-link .icon svg {
    width: 100%;
    height: 100%;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* Main Content */
#content {
    margin-left: 240px;
    flex: 1;
    padding: 24px 32px;
    overflow-y: auto;
    min-height: 100vh;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

/* Grid Layouts */
.grid {
    display: grid;
    gap: 20px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.grid-auto {
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.page-enter {
    animation: fadeIn 300ms ease;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Fullscreen */
.chart-card:fullscreen {
    background: var(--bg-primary);
    padding: 32px;
}

.chart-card:fullscreen .card-body {
    height: calc(100vh - 120px);
}

/* Responsive */
@media (max-width: 1200px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    #sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition);
    }

    #sidebar.open {
        transform: translateX(0);
    }

    #content {
        margin-left: 0;
        padding: 16px;
    }

    .grid-2, .grid-3, .grid-4, .grid-auto {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow);
    animation: fadeIn 400ms ease;
}

.login-header {
    margin-bottom: 24px;
}

.login-logo {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -1px;
    color: var(--text-primary);
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-left: 8px;
}

.login-desc {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 32px;
    line-height: 1.6;
}

.login-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--accent-danger);
    padding: 10px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 16px;
}

.login-footer {
    margin-top: 32px;
    font-size: 11px;
    color: var(--text-muted);
}

#telegram-widget-container {
    display: flex;
    justify-content: center;
    min-height: 48px;
}

/* Sidebar User Info */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-top: 8px;
}

.sidebar-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}

.sidebar-avatar-placeholder {
    background: var(--accent-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-handle {
    font-size: 11px;
    color: var(--text-muted);
}

/* Utility */
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--accent-success); }
.text-warning { color: var(--accent-warning); }
.text-danger { color: var(--accent-danger); }
.font-mono { font-family: var(--font-mono); }
