/* ==========================================================================
   ZYN HUB - ULTRA PREMIUM DESIGN SYSTEM & THEME
   Aesthetics: Discord x Vercel x GitHub x Linear
   Primary: #8B5CF6 | Secondary: #A855F7 | Accent: #C084FC
   Background: #0B0B12 | Cards: #14141F | Borders: rgba(255,255,255,0.08)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Poppins:wght@400;500;600;700;800&display=swap');

:root {
    --bg-dark: #0B0B12;
    --bg-card: rgba(20, 20, 31, 0.75);
    --bg-card-hover: rgba(26, 26, 42, 0.85);
    --bg-glass: rgba(15, 15, 26, 0.65);
    --primary: #8B5CF6;
    --primary-hover: #7C3AED;
    --primary-glow: rgba(139, 92, 246, 0.35);
    --secondary: #A855F7;
    --accent: #C084FC;
    --accent-light: #E9D5FF;
    --text-main: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(139, 92, 246, 0.3);
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --shadow-subtle: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px -5px rgba(139, 92, 246, 0.25);
    --shadow-glow-strong: 0 0 45px rgba(168, 85, 247, 0.4);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    background-image:
        radial-gradient(circle at 15% 15%, rgba(139, 92, 246, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(168, 85, 247, 0.1) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(11, 11, 18, 0.9) 0%, #0B0B12 100%);
}

/* Ambient Glowing Background Elements */
.ambient-glow {
    position: fixed;
    top: -200px;
    left: -200px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.22) 0%, rgba(0, 0, 0, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(80px);
    animation: floatGlow 14s infinite alternate ease-in-out;
}

.ambient-glow-secondary {
    position: fixed;
    bottom: -250px;
    right: -250px;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.18) 0%, rgba(0, 0, 0, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(90px);
    animation: floatGlow 18s infinite alternate-reverse ease-in-out;
}

@keyframes floatGlow {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(60px, 40px) scale(1.1);
    }

    100% {
        transform: translate(-40px, 80px) scale(0.95);
    }
}

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

::-webkit-scrollbar-track {
    background: rgba(11, 11, 18, 0.8);
}

::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.3);
    border-radius: var(--radius-full);
}

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

/* Glassmorphism Card System */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-subtle);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.glass-card:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
    background: var(--bg-card-hover);
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.04), transparent);
    transition: 0.6s;
    pointer-events: none;
}

.glass-card:hover::before {
    left: 100%;
}

/* Navigation Bar */
.navbar {
    height: 72px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(11, 11, 18, 0.85);
    backdrop-filter: blur(24px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--text-main);
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: -0.5px;
}

.navbar-brand img {
    height: 42px;
    width: auto;
    filter: drop-shadow(0 0 12px var(--primary-glow));
    transition: var(--transition);
}

.navbar-brand:hover img {
    transform: rotate(6deg) scale(1.08);
}

/* Layout Architecture */
.app-container {
    display: flex;
    min-height: calc(100vh - 72px);
    position: relative;
    z-index: 1;
}

/* Sidebar Navigation */
.sidebar {
    width: 270px;
    border-right: 1px solid var(--border-color);
    background: rgba(11, 11, 18, 0.6);
    backdrop-filter: blur(20px);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.sidebar-heading {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    font-weight: 700;
    margin: 16px 12px 6px 12px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid transparent;
}

.sidebar-item:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.05);
    transform: translateX(4px);
}

.sidebar-item.active {
    color: var(--accent-light);
    background: rgba(139, 92, 246, 0.16);
    border-color: rgba(139, 92, 246, 0.35);
    font-weight: 700;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.15);
}

.sidebar-icon {
    font-size: 1.15rem;
}

/* Main Content Area */
.main-content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
    max-width: 1600px;
    margin: 0 auto;
}

/* Metrics & Telemetry Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.metric-card {
    padding: 22px;
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.metric-value {
    font-size: 2.1rem;
    font-weight: 800;
    font-family: 'Poppins', sans-serif;
    color: var(--text-main);
    letter-spacing: -0.5px;
    line-height: 1;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #FFFFFF 0%, var(--accent-light) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.metric-footer {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Buttons Engine */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    text-decoration: none;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #FFFFFF;
    box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary) 100%);
    box-shadow: 0 6px 28px rgba(139, 92, 246, 0.5);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #FCA5A5;
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #FFFFFF;
    transform: translateY(-2px);
}

.btn-success {
    background: rgba(16, 185, 129, 0.15);
    color: #6EE7B7;
    border-color: rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    background: rgba(16, 185, 129, 0.3);
    color: #FFFFFF;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

/* Bot Cards System */
.bot-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.bot-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bot-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.bot-avatar {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
    box-shadow: 0 0 16px var(--primary-glow);
}

.bot-info h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
}

.bot-info span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.status-online {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-offline {
    background: rgba(100, 116, 139, 0.15);
    color: var(--text-muted);
    border: 1px solid rgba(100, 116, 139, 0.3);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
    animation: pulseDot 2s infinite;
}

@keyframes pulseDot {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}

.bot-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    flex-wrap: wrap;
}

/* Tabs Header */
.tabs-header {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.tab-btn {
    padding: 10px 18px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    transition: var(--transition);
    white-space: nowrap;
    border-bottom: 2px solid transparent;
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
    color: var(--accent-light);
    border-bottom-color: var(--primary);
    background: rgba(139, 92, 246, 0.12);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Forms Engine */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: rgba(10, 10, 18, 0.7);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 0.92rem;
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 16px var(--primary-glow);
    background: rgba(15, 15, 26, 0.9);
}

/* Terminal Console Box */
.console-box {
    background: #06060A;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    color: #A7F3D0;
    height: 320px;
    overflow-y: auto;
    line-height: 1.6;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

/* Discord Live Embed Preview Component */
.discord-embed-preview {
    background: #2F3136;
    border-left: 4px solid var(--primary);
    border-radius: 4px;
    padding: 16px;
    max-width: 480px;
    color: #DDC;
    font-size: 0.88rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.discord-embed-title {
    font-weight: 700;
    color: #FFFFFF;
    font-size: 1rem;
    margin-bottom: 6px;
}

.discord-embed-desc {
    color: #DCDDDE;
    line-height: 1.4;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
}

.toast {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: var(--shadow-glow-strong);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInToast 0.3s ease;
}

@keyframes slideInToast {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Modal Windows */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 5, 10, 0.8);
    backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-box {
    width: 100%;
    max-width: 580px;
    background: var(--bg-card);
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-glow-strong);
    transform: scale(0.95);
    transition: var(--transition);
}

.modal-overlay.active .modal-box {
    transform: scale(1);
}

/* Command Palette Shortcut (Ctrl+K) */
.command-kbd {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Responsive Breakpoints */
@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        left: -270px;
        top: 72px;
        height: calc(100vh - 72px);
        z-index: 99;
        transition: var(--transition);
    }

    .sidebar.open {
        left: 0;
    }

    #mobile-sidebar-toggle {
        display: inline-flex !important;
    }

    .main-content {
        padding: 20px;
    }

    .desktop-only {
        display: none !important;
    }
}