/* SLED Professional v5.0 - Arcane Theme */
:root {
    /* Colors */
    --bg-deep: #030305;
    --bg-surface: #0a0a10;
    --bg-panel: #12121a;

    --primary: #7c3aed;
    --primary-glow: rgba(124, 58, 237, 0.5);
    --primary-dim: rgba(124, 58, 237, 0.1);

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    --text-main: #ffffff;
    --text-muted: #a1a1aa;

    /* Dimensions */
    --header-height: 64px;
    --orb-size: 140px;
}

* {
    box-sizing: border-box;
    outline: none;
}

body {
    margin: 0;
    padding: 0;
    background: var(--bg-deep);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    height: 100vh;
    overflow: hidden;
}

/* UTILS */
.hidden {
    display: none !important;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: 0.2s;
}

.btn-icon:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

/* APP LAYOUT */
.sled-app {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

/* HEADER */
.app-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: rgba(10, 10, 16, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    color: var(--primary);
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.brand-name {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.5px;
}

.brand-version {
    font-size: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text-muted);
}

.status-group {
    display: flex;
    gap: 24px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 20px;
    transition: 0.2s;
}

.status-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
    box-shadow: 0 0 8px var(--danger);
    transition: 0.3s;
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.status-label {
    font-size: 13px;
    color: var(--text-muted);
}

.status-icon {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 16px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding-right: 16px;
}

.user-name {
    font-size: 13px;
    font-weight: 500;
}

.user-avatar {
    width: 28px;
    height: 28px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}

/* MAIN STAGE */
.app-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
}

.stage-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    width: 100%;
    max-width: 600px;
    padding: 20px;
    z-index: 10;
}

/* ORB BUTTON */
.orb-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.orb-button {
    width: var(--orb-size);
    height: var(--orb-size);
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--bg-panel), #000);
    position: relative;
    cursor: pointer;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 20px 50px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.orb-button:active {
    transform: scale(0.96);
}

.orb-inner {
    position: absolute;
    inset: 4px;
    background: linear-gradient(135deg, #2a2a35, #15151a);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.orb-glow {
    position: absolute;
    inset: -20px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    opacity: 0.3;
    z-index: 0;
    animation: pulse 3s infinite alternate;
}

.orb-ripple {
    position: absolute;
    inset: 0;
    border: 2px solid var(--primary);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
}

/* Orb States */
.orb-button.processing .orb-inner {
    border: 2px solid var(--primary);
}

.orb-button.processing .orb-icon {
    animation: spin 1s linear infinite;
}

.orb-button.success .orb-inner {
    background: linear-gradient(135deg, var(--success), #059669);
}

.orb-button.success .orb-glow {
    background: radial-gradient(circle, var(--success) 0%, transparent 70%);
    opacity: 0.6;
}

.orb-button.firing .orb-ripple {
    animation: ripple 0.6s ease-out;
}

@keyframes pulse {
    0% {
        opacity: 0.2;
        transform: scale(0.9);
    }

    100% {
        opacity: 0.5;
        transform: scale(1.1);
    }
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes ripple {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(1.6);
    }
}

.orb-icon {
    width: 48px;
    height: 48px;
    color: #fff;
}

.orb-info {
    text-align: center;
}

.orb-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.orb-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

/* FEED PANEL */
.feed-panel {
    width: 100%;
    background: rgba(18, 18, 26, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    height: 250px;
}

.feed-header {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.feed-header h3 {
    margin: 0;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.badge {
    font-size: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.feed-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Feed Items */
.feed-item {
    display: flex;
    gap: 12px;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    animation: slideIn 0.3s ease;
}

.feed-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.feed-item.welcome {
    color: var(--text-muted);
    font-style: italic;
}

.feed-item.error {
    border-left: 2px solid var(--danger);
    background: rgba(239, 68, 68, 0.05);
}

.feed-item.success {
    border-left: 2px solid var(--success);
    background: rgba(16, 185, 129, 0.05);
}

.item-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.item-icon svg {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
}

.item-content {
    flex: 1;
}

.item-title {
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
}

.item-desc {
    margin: 0;
    line-height: 1.4;
    color: var(--text-muted);
    white-space: pre-wrap;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* FOOTER NAV */
.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    padding-bottom: 20px;
    pointer-events: none;
    /* Let clicks pass through to hidden panels unless hitting buttons */
    z-index: 200;
}

.footer-tabs {
    background: rgba(15, 15, 20, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 6px;
    display: flex;
    gap: 8px;
    pointer-events: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.nav-tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 10px 20px;
    border-radius: 24px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}

.nav-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
    background: var(--primary);
    color: #fff;
}

.nav-tab svg {
    width: 16px;
    height: 16px;
}

/* SLIDE PANELS */
.panel-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
    z-index: 100;
}

.panel-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.slide-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50vh;
    background: var(--bg-surface);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px 20px 0 0;
    z-index: 101;
    transform: translateY(100%);
    transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.slide-panel.active {
    transform: translateY(0);
}

.panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Panel Specifics */
.console-view {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.log-entry {
    margin-bottom: 4px;
}

.log-entry.error {
    color: #f87171;
}

.log-entry.success {
    color: #4ade80;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    color: var(--text-muted);
}

.tool-category h4 {
    margin: 0 0 8px 0;
    font-size: 12px;
    color: var(--primary);
    text-transform: uppercase;
}

.tool-category {
    margin-bottom: 16px;
}

/* MODAL */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: 0.2s;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    width: 400px;
    background: var(--bg-panel);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 24px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
}

.btn-close-modal {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-main);
    font-size: 18px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close-modal:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.btn-close-panel {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-main);
    font-size: 16px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close-panel:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    margin-bottom: 6px;
    color: var(--text-muted);
}

.form-group input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 6px;
    color: #fff;
}

.btn-primary.full {
    width: 100%;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 8px;
    font-weight: 600;
}

/* TOAST */
#toast-area {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-panel);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideLeft 0.3s;
}

.toast.success {
    border-left: 3px solid var(--success);
}

.toast.error {
    border-left: 3px solid var(--danger);
}

@keyframes slideLeft {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}