* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #131824;
    --bg-tertiary: #1a1f2e;
    --bg-hover: #1f2533;
    --accent-primary: #7c3aed;
    --accent-secondary: #a855f7;
    --accent-gradient: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --text-tertiary: #6b7280;
    --border-color: #1f2937;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* ============ SIDEBAR ============ */
.sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.bot-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bot-icon {
    width: 48px;
    height: 48px;
    background: var(--accent-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: white;
}

.bot-details h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.sidebar-nav {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

.nav-section {
    display: block;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
}

.nav-section:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-group {
    margin-bottom: 24px;
}

.nav-group-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    padding: 0 16px 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 500;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-primary);
    color: var(--text-primary);
}

.nav-icon {
    font-size: 18px;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-bottom: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-gradient);
}

.user-details {
    flex: 1;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.logout-btn {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ============ MAIN CONTENT ============ */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 32px;
    max-width: 1400px;
}

.server-selector {
    margin-bottom: 32px;
}

.guild-dropdown {
    width: 100%;
    max-width: 400px;
    padding: 14px 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.guild-dropdown:hover {
    border-color: var(--accent-primary);
}

.guild-dropdown:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* ============ STATS HEADER ============ */
.stats-header h1 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 24px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-primary);
}

.stat-icon {
    font-size: 32px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(124, 58, 237, 0.1);
    border-radius: 10px;
}

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ============ FEATURES SECTION ============ */
.features-section {
    margin-bottom: 48px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 700;
}

.view-all {
    color: var(--accent-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.view-all:hover {
    color: var(--accent-secondary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.feature-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s;
    cursor: pointer;
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-primary);
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.2);
}

.feature-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.feature-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.feature-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ============ CONTENT PAGES ============ */
.content-page {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.page-header p {
    font-size: 15px;
    color: var(--text-secondary);
}

/* ============ SETTINGS GRID ============ */
.settings-grid,
.integrations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.setting-card,
.integration-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s;
}

.setting-card:hover,
.integration-card:hover {
    border-color: var(--accent-primary);
}

.setting-card h3,
.integration-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.setting-card p,
.integration-card p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.integration-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.integration-icon {
    font-size: 32px;
}

/* ============ BUTTONS ============ */
.btn-primary {
    padding: 10px 20px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

/* ============ TOGGLE SWITCH ============ */
.setting-options {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-switch {
    position: relative;
    width: 48px;
    height: 24px;
    display: inline-block;
}

.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.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background: var(--accent-gradient);
}

input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* ============ COMMANDS TOOLBAR & MESSAGES ============ */
.commands-toolbar {
    margin-bottom: 20px;
}

.commands-search {
    width: 100%;
    max-width: 400px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
}

.commands-search::placeholder {
    color: var(--text-tertiary);
}

.commands-search:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.commands-message {
    padding: 16px;
    color: var(--text-secondary);
    font-size: 14px;
}

.commands-error {
    color: var(--error);
    background: rgba(239, 68, 68, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.commands-empty {
    color: var(--text-secondary);
    padding: 24px;
    font-size: 14px;
}

/* ============ COMMANDS LIST ============ */
.commands-category {
    margin-bottom: 32px;
}

.category-header {
    font-size: 18px;
    font-weight: 700;
    text-transform: capitalize;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.command-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.command-item:hover {
    border-color: var(--accent-primary);
}

.command-info h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.command-info p {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ============ OVERVIEW PAGE ============ */
.overview-greeting {
    margin-bottom: 24px;
}

.overview-hello {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.overview-hello strong {
    color: var(--text-primary);
}

.overview-stats {
    margin-bottom: 32px;
}

.overview-hint {
    font-size: 14px;
    color: var(--text-tertiary);
}

/* ============ COMING SOON / PLACEHOLDER PAGES ============ */
.coming-soon-page .page-header {
    margin-bottom: 24px;
}

.coming-soon-msg {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.6;
    max-width: 560px;
}

.coming-soon-msg code {
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}

/* ============ LOADING ============ */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% {
        color: var(--text-secondary);
        text-shadow: .25em 0 0 var(--text-secondary), .5em 0 0 var(--text-secondary);
    }
    40% {
        color: var(--accent-primary);
        text-shadow: .25em 0 0 var(--text-secondary), .5em 0 0 var(--text-secondary);
    }
    60% {
        text-shadow: .25em 0 0 var(--accent-primary), .5em 0 0 var(--text-secondary);
    }
    80%, 100% {
        text-shadow: .25em 0 0 var(--accent-primary), .5em 0 0 var(--accent-primary);
    }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
    
    .main-content {
        margin-left: 240px;
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }
    
    .main-content {
        margin-left: 0;
        padding: 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}
