* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #1e2124;
    --bg-secondary: #282b30;
    --bg-tertiary: #36393e;
    --text-primary: #ffffff;
    --text-secondary: #b9bbbe;
    --text-muted: #72767d;
    --accent-primary: #5865f2;
    --accent-hover: #4752c4;
    --success: #3ba55d;
    --danger: #ed4245;
    --warning: #faa81a;
}

body {
    font-family: 'Whitney', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

/* Navbar */
.navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.nav-logo img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--text-primary);
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-login {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: #40444b;
}

.btn-login {
    background: var(--accent-primary);
    color: white;
    padding: 10px 20px;
    font-size: 14px;
}

/* Hero Section */
.hero {
    max-width: 1200px;
    margin: 0 auto;
    padding: 120px 24px;
    text-align: center;
}

.hero-content h1 {
    font-size: 56px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -0.5px;
}

.hero-content p {
    font-size: 20px;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 40px;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Dashboard */
.dashboard-body {
    background: var(--bg-primary);
}

.dashboard-container {
    display: flex;
    min-height: calc(100vh - 73px);
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    padding: 24px;
    overflow-y: auto;
}

.sidebar-header h3 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.server-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.server-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    background: var(--bg-tertiary);
    cursor: pointer;
    transition: all 0.2s;
}

.server-item:hover {
    background: #40444b;
}

.server-item.active {
    background: var(--accent-primary);
}

.server-item img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.server-item-info h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.server-item-info p {
    font-size: 12px;
    color: var(--text-muted);
}

.btn-add-server {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 8px;
}

.btn-add-server:hover {
    background: var(--accent-hover);
}

.btn-refresh-servers {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-refresh-servers:hover {
    background: #40444b;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

.server-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.server-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.server-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
}

.server-info h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.server-info p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Time Filter */
.time-filter {
    display: flex;
    gap: 8px;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: 8px;
}

.filter-btn {
    padding: 8px 16px;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--accent-primary);
    color: white;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.members {
    background: rgba(88, 101, 242, 0.1);
    color: var(--accent-primary);
}

.stat-icon.joined {
    background: rgba(59, 165, 93, 0.1);
    color: var(--success);
}

.stat-icon.left {
    background: rgba(237, 66, 69, 0.1);
    color: var(--danger);
}

.stat-icon.messages {
    background: rgba(250, 168, 26, 0.1);
    color: var(--warning);
}

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-period {
    font-size: 12px;
    color: var(--text-muted);
}

/* Chart */
.chart-container {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 24px;
}

.chart-container h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
}

/* Login Prompt */
.login-prompt {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 73px);
    padding: 24px;
}

.login-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 48px;
    text-align: center;
    max-width: 400px;
}

.login-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 24px;
}

.login-card h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
}

.login-card p {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

/* User Info */
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }
    
    .hero-content h1 {
        font-size: 36px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}


/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-logo {
    width: 80px;
    height: 80px;
    animation: spin 2s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Server Selector */
.server-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 16px;
}

.server-selector:hover {
    background: #40444b;
}

.server-selector-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.server-selector-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.server-selector-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.server-selector-info span:last-child {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.server-selector-arrow {
    color: var(--text-muted);
}

/* Server Dropdown */
.server-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-top: 8px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    z-index: 100;
    max-height: 400px;
    overflow-y: auto;
}

.server-dropdown-list {
    padding: 8px;
}

.server-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.server-dropdown-item:hover {
    background: var(--bg-secondary);
}

.server-dropdown-item img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.server-dropdown-item-info {
    display: flex;
    flex-direction: column;
}

.server-dropdown-item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.server-dropdown-item-members {
    font-size: 12px;
    color: var(--text-muted);
}

.btn-add-server-dropdown {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0 0 8px 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-server-dropdown:hover {
    background: var(--accent-hover);
}

.no-servers {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
}

/* Sidebar Navigation */
.sidebar-section {
    position: relative;
    margin-bottom: 24px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    padding: 8px 12px;
    margin-top: 16px;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.sidebar-nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sidebar-nav-item.active {
    background: var(--accent-primary);
    color: white;
}

/* Page Content */
.page-content {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 4px;
}

.page-description {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-tertiary);
    transition: 0.4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--success);
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

/* Plugin Content */
.plugin-content {
    max-width: 800px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-group small {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-select, .form-textarea {
    width: 100%;
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
}

.form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
}

/* Preview Section */
.preview-section {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 24px;
}

.preview-section h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}

.welcome-preview {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    justify-content: center;
}

#welcomeCanvas {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Logout Button */
.btn-logout {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: #40444b;
}


/* Server Action Buttons */
.btn-server-go, .btn-server-setup {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-server-go {
    background: var(--success);
    color: white;
}

.btn-server-go:hover {
    background: #2d8a4d;
}

.btn-server-setup {
    background: var(--accent-primary);
    color: white;
}

.btn-server-setup:hover {
    background: var(--accent-hover);
}
