/* GamePanel - Modern Dark Theme */

/* ========================================
   Theme Variables
   ======================================== */
:root {
    /* Background colors */
    --gp-bg-primary: #09090b;
    --gp-bg-secondary: #0f0f11;
    --gp-bg-elevated: #18181b;
    --gp-bg-hover: #1c1c1f;

    /* Border */
    --gp-border: #27272a;
    --gp-border-subtle: #1f1f23;

    /* Text */
    --gp-text-primary: #fafafa;
    --gp-text-secondary: #a1a1aa;
    --gp-text-muted: #52525b;

    /* Accent colors */
    --gp-accent: #3b82f6;
    --gp-accent-hover: #2563eb;
    --gp-accent-glow: rgba(59, 130, 246, 0.15);
    --gp-success: #22c55e;
    --gp-success-glow: rgba(34, 197, 94, 0.2);
    --gp-warning: #f59e0b;
    --gp-warning-glow: rgba(245, 158, 11, 0.2);
    --gp-danger: #ef4444;
    --gp-danger-glow: rgba(239, 68, 68, 0.2);

    /* Transitions */
    --gp-transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --gp-transition-normal: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --gp-transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Sizing */
    --gp-sidebar-width: 60px;
    --gp-radius: 10px;
    --gp-radius-sm: 6px;
    --gp-radius-lg: 12px;
}

/* ========================================
   Global Styles
   ======================================== */
* {
    box-sizing: border-box;
}

body {
    background: var(--gp-bg-primary);
    color: var(--gp-text-primary);
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
        sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   Tabler Overrides
   ======================================== */
body.theme-dark {
    --tblr-body-bg: var(--gp-bg-primary);
    --tblr-bg-surface: var(--gp-bg-secondary);
    --tblr-border-color: var(--gp-border);
    --tblr-card-bg: var(--gp-bg-secondary);
    --tblr-body-color: var(--gp-text-primary);
    --tblr-secondary: var(--gp-text-secondary);
    --tblr-primary: var(--gp-accent);
    --tblr-success: var(--gp-success);
    --tblr-warning: var(--gp-warning);
    --tblr-danger: var(--gp-danger);
}

/* ========================================
   Layout
   ======================================== */
.gp-layout {
    display: flex;
    min-height: 100vh;
    background: var(--gp-bg-primary);
}

/* ========================================
   Sidebar
   ======================================== */
.gp-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--gp-sidebar-width);
    background: var(--gp-bg-secondary);
    border-right: 1px solid var(--gp-border);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.gp-sidebar::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(
        180deg,
        transparent 0%,
        var(--gp-border) 20%,
        var(--gp-border) 80%,
        transparent 100%
    );
}

.gp-sidebar-logo {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.gp-sidebar-logo::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 12px;
    right: 12px;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--gp-border),
        transparent
    );
}

.gp-sidebar-logo a {
    color: var(--gp-accent);
    font-size: 1.5rem;
    transition: all var(--gp-transition-fast);
    filter: drop-shadow(0 0 8px var(--gp-accent-glow));
}

.gp-sidebar-logo a:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 12px var(--gp-accent));
}

.gp-sidebar-nav {
    flex: 1;
    padding: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gp-sidebar-item {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    margin: 0 10px;
    border-radius: var(--gp-radius-sm);
    color: var(--gp-text-muted);
    text-decoration: none;
    transition: all var(--gp-transition-fast);
    position: relative;
}

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

.gp-sidebar-item.active {
    background: var(--gp-accent-glow);
    color: var(--gp-accent);
}

.gp-sidebar-item.active::before {
    content: "";
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--gp-accent);
    border-radius: 0 3px 3px 0;
    box-shadow: 0 0 12px var(--gp-accent);
}

.gp-sidebar-item i {
    font-size: 1.25rem;
}

/* Tooltip */
.gp-sidebar-item[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 16px);
    top: 50%;
    transform: translateY(-50%) scale(0.95);
    background: var(--gp-bg-elevated);
    color: var(--gp-text-primary);
    padding: 8px 12px;
    border-radius: var(--gp-radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all var(--gp-transition-fast);
    border: 1px solid var(--gp-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.gp-sidebar-item:hover[data-tooltip]::after {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

/* ========================================
   Main Content
   ======================================== */
.gp-main {
    flex: 1;
    margin-left: var(--gp-sidebar-width);
    min-height: 100vh;
}

.gp-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 48px;
}

/* Wider content area for server pages */
.gp-content:has(.gp-server-page) {
    max-width: 1400px;
}

/* ========================================
   Server Context Header
   ======================================== */
.gp-server-header {
    background: var(--gp-bg-secondary);
    border-bottom: 1px solid var(--gp-border);
    padding: 0 48px;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
    background: rgba(15, 15, 17, 0.85);
}

.gp-server-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.gp-server-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.gp-back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gp-text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    padding: 6px 12px;
    margin: -6px -12px;
    border-radius: var(--gp-radius-sm);
    transition: all var(--gp-transition-fast);
}

.gp-back-btn:hover {
    color: var(--gp-text-primary);
    background: var(--gp-bg-hover);
}

.gp-server-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gp-text-primary);
    margin: 0;
    letter-spacing: -0.01em;
}

.gp-server-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gp-server-tabs {
    display: flex;
    gap: 2px;
    padding: 12px 0;
}

.gp-server-tab {
    padding: 8px 14px;
    color: var(--gp-text-muted);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: var(--gp-radius-sm);
    transition: all var(--gp-transition-fast);
}

.gp-server-tab:hover {
    color: var(--gp-text-primary);
    background: var(--gp-bg-hover);
}

.gp-server-tab.active {
    color: var(--gp-text-primary);
    background: var(--gp-bg-elevated);
}

/* ========================================
   Page Header
   ======================================== */
.gp-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.gp-page-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--gp-text-primary);
    margin: 0;
    letter-spacing: -0.02em;
}

/* ========================================
   Server List
   ======================================== */
.gp-server-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gp-server-row {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    background: var(--gp-bg-secondary);
    border: 1px solid var(--gp-border-subtle);
    border-radius: var(--gp-radius);
    cursor: pointer;
    transition: all var(--gp-transition-fast);
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.gp-server-row::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent,
        var(--gp-bg-hover),
        transparent
    );
    opacity: 0;
    transition: opacity var(--gp-transition-fast);
}

.gp-server-row:hover {
    border-color: var(--gp-border);
    transform: translateY(-2px);
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.25),
        0 0 0 1px var(--gp-border);
}

.gp-server-row:hover::before {
    opacity: 1;
}

.gp-server-row:active {
    transform: translateY(0);
    transition: transform 50ms ease;
}

.gp-server-row .drag-handle {
    opacity: 0;
    margin-right: 14px;
    color: var(--gp-text-muted);
    cursor: grab;
    transition: all var(--gp-transition-fast);
    position: relative;
    z-index: 1;
}

.gp-server-row:hover .drag-handle {
    opacity: 1;
}

.gp-server-row .drag-handle:active {
    cursor: grabbing;
    color: var(--gp-text-primary);
}

.gp-server-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 16px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.gp-server-status.running {
    background: var(--gp-success);
    box-shadow:
        0 0 12px var(--gp-success-glow),
        0 0 4px var(--gp-success);
}

.gp-server-status.starting,
.gp-server-status.stopping {
    background: var(--gp-warning);
    box-shadow: 0 0 12px var(--gp-warning-glow);
    animation: pulse-glow 2s ease-in-out infinite;
}

.gp-server-status.offline {
    background: var(--gp-text-muted);
}

@keyframes pulse-glow {
    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 12px var(--gp-warning-glow);
    }
    50% {
        opacity: 0.6;
        box-shadow: 0 0 6px var(--gp-warning-glow);
    }
}

.gp-server-info {
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.gp-server-info-name {
    font-weight: 500;
    color: var(--gp-text-primary);
    margin-bottom: 3px;
    letter-spacing: -0.01em;
}

.gp-server-info-meta {
    font-size: 0.8125rem;
    color: var(--gp-text-muted);
}

.gp-server-arrow {
    color: var(--gp-text-muted);
    opacity: 0;
    transform: translateX(-8px);
    transition: all var(--gp-transition-fast);
    position: relative;
    z-index: 1;
}

.gp-server-row:hover .gp-server-arrow {
    opacity: 1;
    transform: translateX(0);
    color: var(--gp-text-secondary);
}

/* Dragging states */
.gp-server-row.dragging {
    opacity: 0.6;
    transform: scale(0.98) rotate(1deg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.gp-server-row.drag-over {
    border-color: var(--gp-accent);
    box-shadow:
        0 0 0 2px var(--gp-accent-glow),
        0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ========================================
   Empty State
   ======================================== */
.gp-empty {
    text-align: center;
    padding: 80px 40px;
    background: var(--gp-bg-secondary);
    border: 1px solid var(--gp-border-subtle);
    border-radius: var(--gp-radius-lg);
    position: relative;
    overflow: hidden;
}

.gp-empty::before {
    content: "";
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 300px;
    background: radial-gradient(
        circle,
        var(--gp-accent-glow) 0%,
        transparent 60%
    );
    opacity: 0.4;
    pointer-events: none;
    animation: empty-glow 4s ease-in-out infinite;
}

@keyframes empty-glow {
    0%,
    100% {
        opacity: 0.4;
        transform: translateX(-50%) scale(1);
    }
    50% {
        opacity: 0.6;
        transform: translateX(-50%) scale(1.1);
    }
}

.gp-empty-icon {
    font-size: 3.5rem;
    color: var(--gp-text-muted);
    margin-bottom: 20px;
    position: relative;
    animation: empty-icon-float 3s ease-in-out infinite;
}

@keyframes empty-icon-float {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

.gp-empty-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gp-text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.gp-empty-text {
    color: var(--gp-text-secondary);
    margin-bottom: 28px;
    font-size: 0.9375rem;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* ========================================
   Buttons
   ======================================== */
.gp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--gp-radius-sm);
    border: none;
    cursor: pointer;
    transition: all var(--gp-transition-fast);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.gp-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.1) 0%,
        transparent 50%
    );
    opacity: 0;
    transition: opacity var(--gp-transition-fast);
}

.gp-btn:hover::before {
    opacity: 1;
}

.gp-btn-primary {
    background: var(--gp-accent);
    color: white;
    box-shadow: 0 2px 8px var(--gp-accent-glow);
}

.gp-btn-primary:hover {
    background: var(--gp-accent-hover);
    color: white;
    box-shadow: 0 4px 16px var(--gp-accent-glow);
    transform: translateY(-1px);
}

.gp-btn-primary:active {
    transform: translateY(0);
}

.gp-btn-secondary {
    background: var(--gp-bg-elevated);
    color: var(--gp-text-primary);
    border: 1px solid var(--gp-border);
}

.gp-btn-secondary:hover {
    background: var(--gp-bg-hover);
    border-color: var(--gp-text-muted);
}

.gp-btn-success {
    background: var(--gp-success);
    color: white;
    box-shadow: 0 2px 8px var(--gp-success-glow);
}

.gp-btn-success:hover {
    background: #16a34a;
    box-shadow: 0 4px 16px var(--gp-success-glow);
    transform: translateY(-1px);
}

.gp-btn-danger {
    background: var(--gp-danger);
    color: white;
    box-shadow: 0 2px 8px var(--gp-danger-glow);
}

.gp-btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 4px 16px var(--gp-danger-glow);
    transform: translateY(-1px);
}

.gp-btn-warning {
    background: var(--gp-warning);
    color: white;
    box-shadow: 0 2px 8px var(--gp-warning-glow);
}

.gp-btn-warning:hover {
    background: #d97706;
    box-shadow: 0 4px 16px var(--gp-warning-glow);
    transform: translateY(-1px);
}

.gp-btn-sm {
    padding: 7px 14px;
    font-size: 0.8125rem;
}

.gp-btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
}

.gp-btn-icon.gp-btn-sm {
    width: 32px;
    height: 32px;
}

.gp-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ========================================
   Status Badge
   ======================================== */
.gp-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    text-transform: capitalize;
}

.gp-status-running {
    background: var(--gp-success-glow);
    color: var(--gp-success);
    box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.2);
}

.gp-status-starting,
.gp-status-stopping {
    background: var(--gp-warning-glow);
    color: var(--gp-warning);
    box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.2);
}

.gp-status-offline {
    background: var(--gp-bg-elevated);
    color: var(--gp-text-muted);
    box-shadow: inset 0 0 0 1px var(--gp-border);
}

.gp-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.gp-status-running .gp-status-dot {
    box-shadow: 0 0 6px currentColor;
}

.gp-status-starting .gp-status-dot,
.gp-status-stopping .gp-status-dot {
    animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

/* ========================================
   Console Page Layout
   ======================================== */
.gp-console-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 16px;
}

.gp-console-page-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gp-text-primary);
}

.gp-console-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.gp-console-status-dot.connected {
    background: var(--gp-success);
    box-shadow: 0 0 8px var(--gp-success-glow);
    animation: console-pulse 2s ease-in-out infinite;
}

.gp-console-status-dot.disconnected {
    background: var(--gp-text-muted);
}

.gp-console-power-buttons {
    display: flex;
    gap: 8px;
}

.gp-console-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 16px;
    height: calc(100vh - 260px);
    min-height: 500px;
}

/* Console page marker - width controlled by parent .gp-content:has(.gp-console-page) */
.gp-console-page {
    width: 100%;
}

/* Console (HTML-based) */
.gp-console {
    background: #0a0a0c;
    border: 1px solid var(--gp-border);
    border-radius: var(--gp-radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.gp-console-output {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    font-family: "SF Mono", "Fira Code", "Monaco", "Inconsolata", monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #e4e4e7;
    background: #0a0a0c;
}

.gp-console-line {
    white-space: pre-wrap;
    word-break: break-all;
    padding: 2px 0;
    margin: 0 -20px;
    padding-left: 20px;
    padding-right: 20px;
    transition: background var(--gp-transition-fast);
}

.gp-console-line:hover {
    background: rgba(255, 255, 255, 0.03);
}

.gp-console-timestamp {
    color: #52525b;
    margin-right: 12px;
    font-size: 0.75rem;
    user-select: none;
}

.gp-console-error {
    color: var(--gp-danger);
}

.gp-console-input {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #111113;
    border-top: 1px solid var(--gp-border);
}

.gp-console-input-prefix {
    color: var(--gp-success);
    font-family: "SF Mono", monospace;
    font-weight: 600;
    font-size: 1rem;
}

.gp-console-input input {
    flex: 1;
    background: #0a0a0c;
    border: 1px solid var(--gp-border);
    border-radius: var(--gp-radius-sm);
    padding: 10px 14px;
    color: var(--gp-text-primary);
    font-family: "SF Mono", monospace;
    font-size: 0.875rem;
    outline: none;
    transition: all var(--gp-transition-fast);
}

.gp-console-input input:focus {
    border-color: var(--gp-accent);
    box-shadow: 0 0 0 3px var(--gp-accent-glow);
}

.gp-console-input input::placeholder {
    color: var(--gp-text-muted);
}

.gp-console-input input:disabled {
    background: #18181b;
    color: var(--gp-text-muted);
    cursor: not-allowed;
}

@keyframes console-pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ========================================
   Native ANSI Console
   ======================================== */
.ansi-console {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #0a0a0c;
    border: 1px solid var(--gp-border);
    border-radius: var(--gp-radius-lg);
    overflow: hidden;
}

.ansi-console-header {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    background: #111113;
    border-bottom: 1px solid var(--gp-border);
    flex-shrink: 0;
    gap: 12px;
}

.ansi-console-dots {
    display: flex;
    gap: 6px;
}

.ansi-console-dots .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.ansi-console-dots .dot.red {
    background: #ff5f56;
}

.ansi-console-dots .dot.yellow {
    background: #ffbd2e;
}

.ansi-console-dots .dot.green {
    background: #27c93f;
}

.ansi-console-title {
    flex: 1;
    color: var(--gp-text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.ansi-console-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ansi-console-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--gp-text-secondary);
}

.ansi-console-status .status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.ansi-console-status .status-indicator.connected {
    background: var(--gp-success);
    box-shadow: 0 0 6px var(--gp-success-glow);
}

.ansi-console-status .status-indicator.disconnected {
    background: var(--gp-text-muted);
}

.ansi-console-output {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    font-family: "SF Mono", "Fira Code", "Monaco", Consolas, monospace;
    font-size: 14px;
    line-height: 1.6;
    min-height: 0;
}

.ansi-console-output::-webkit-scrollbar {
    width: 8px;
}

.ansi-console-output::-webkit-scrollbar-track {
    background: transparent;
}

.ansi-console-output::-webkit-scrollbar-thumb {
    background: #27272a;
    border-radius: 4px;
}

.ansi-console-output::-webkit-scrollbar-thumb:hover {
    background: #3f3f46;
}

.ansi-console-line {
    display: grid;
    grid-template-columns: 70px 1fr;
    gap: 12px;
    padding: 2px 0;
    color: #e4e4e7;
}

.ansi-console-line.error .ansi-console-text {
    color: var(--gp-danger);
}

.ansi-console-line:hover {
    background: rgba(255, 255, 255, 0.02);
}

.ansi-console-timestamp {
    color: #52525b;
    font-variant-numeric: tabular-nums;
    text-align: right;
    user-select: none;
    flex-shrink: 0;
}

.ansi-console-text {
    white-space: pre-wrap;
    word-break: break-word;
}

.ansi-console-input {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #111113;
    border-top: 1px solid var(--gp-border);
    flex-shrink: 0;
}

.ansi-console-prompt {
    color: var(--gp-success);
    font-family: "SF Mono", monospace;
    font-weight: 600;
    font-size: 1rem;
}

.ansi-console-input input {
    flex: 1;
    background: #0a0a0c;
    border: 1px solid var(--gp-border);
    border-radius: var(--gp-radius-sm);
    padding: 8px 12px;
    color: var(--gp-text-primary);
    font-family: "SF Mono", monospace;
    font-size: 0.875rem;
}

.ansi-console-input input:focus {
    outline: none;
    border-color: var(--gp-accent);
    box-shadow: 0 0 0 3px var(--gp-accent-glow);
}

.ansi-console-input input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ansi-console-input input::placeholder {
    color: var(--gp-text-muted);
}

.ansi-console-history {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--gp-text-muted);
    font-size: 0.75rem;
}

.btn-ghost {
    background: transparent;
    border: none;
    color: var(--gp-text-secondary);
    padding: 6px 8px;
    border-radius: var(--gp-radius-sm);
    cursor: pointer;
    transition: all var(--gp-transition-fast);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--gp-text-primary);
}

/* ========================================
   Code Editor
   ======================================== */
.code-editor {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 260px);
    min-height: 400px;
    background: #0a0a0c;
    border: 1px solid var(--gp-border);
    border-radius: var(--gp-radius-lg);
    overflow: hidden;
}

.code-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #111113;
    border-bottom: 1px solid var(--gp-border);
    flex-shrink: 0;
}

.code-editor-header .badge {
    font-size: 0.7rem;
    padding: 3px 8px;
}

.code-editor-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.code-editor-lines {
    width: 50px;
    padding: 12px 8px;
    background: #09090b;
    border-right: 1px solid var(--gp-border);
    font-family: "SF Mono", "Fira Code", monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #52525b;
    text-align: right;
    user-select: none;
    overflow-y: hidden;
    flex-shrink: 0;
}

.code-editor-lines div {
    height: 22.4px; /* Match textarea line-height */
}

.code-editor-textarea {
    flex: 1;
    padding: 12px 16px;
    background: #0a0a0c;
    border: none;
    outline: none;
    resize: none;
    font-family: "SF Mono", "Fira Code", monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #e4e4e7;
    overflow-y: auto;
    white-space: pre;
    tab-size: 4;
}

.code-editor-textarea::placeholder {
    color: var(--gp-text-muted);
}

.code-editor-textarea::-webkit-scrollbar {
    width: 8px;
}

.code-editor-textarea::-webkit-scrollbar-track {
    background: transparent;
}

.code-editor-textarea::-webkit-scrollbar-thumb {
    background: #27272a;
    border-radius: 4px;
}

.code-editor-textarea::-webkit-scrollbar-thumb:hover {
    background: #3f3f46;
}

/* Console Sidebar */
.gp-console-sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Stats Cards */
.gp-stat-card {
    background: var(--gp-bg-secondary);
    border: 1px solid var(--gp-border);
    border-radius: var(--gp-radius);
    padding: 16px;
}

.gp-stat-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gp-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.gp-stat-card-header i {
    font-size: 0.875rem;
}

.gp-stat-card-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gp-text-primary);
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.gp-stat-card-value .gp-stat-limit {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--gp-text-muted);
}

.gp-stat-inactive {
    color: var(--gp-text-muted);
}

.gp-stat-progress {
    height: 6px;
    background: var(--gp-bg-primary);
    border-radius: 3px;
    margin-top: 12px;
    overflow: hidden;
}

.gp-stat-progress-bar {
    height: 100%;
    background: var(--gp-accent);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.gp-stat-progress-bar.memory {
    background: var(--gp-success);
}

.gp-stat-card-content-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.gp-stat-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--gp-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.gp-stat-value-small {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gp-text-primary);
}

/* Status Badge */
.gp-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--gp-radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
}

.gp-status-badge::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.gp-status-badge.running {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.gp-status-badge.running::before {
    background: #22c55e;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}

.gp-status-badge.starting,
.gp-status-badge.stopping {
    background: rgba(234, 179, 8, 0.1);
    color: #eab308;
}

.gp-status-badge.starting::before,
.gp-status-badge.stopping::before {
    background: #eab308;
    animation: console-pulse 1s ease-in-out infinite;
}

.gp-status-badge.offline {
    background: rgba(113, 113, 122, 0.1);
    color: #71717a;
}

.gp-status-badge.offline::before {
    background: #71717a;
}

/* Button Block */
.gp-btn-block {
    width: 100%;
    justify-content: center;
}

/* Button Icon Only */
.gp-btn-icon {
    padding: 10px;
}

.gp-btn-icon i {
    margin: 0;
}

/* ========================================
   Cards
   ======================================== */
.gp-card {
    background: var(--gp-bg-secondary);
    border: 1px solid var(--gp-border-subtle);
    border-radius: var(--gp-radius);
    overflow: hidden;
    transition: all var(--gp-transition-fast);
}

.gp-card:hover {
    border-color: var(--gp-border);
}

.gp-card-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--gp-border-subtle);
    background: linear-gradient(
        180deg,
        var(--gp-bg-elevated) 0%,
        var(--gp-bg-secondary) 100%
    );
}

.gp-card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gp-text-primary);
    margin: 0;
    letter-spacing: -0.01em;
}

.gp-card-body {
    padding: 22px;
}

/* ========================================
   Node List
   ======================================== */
.gp-node-row {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    background: var(--gp-bg-secondary);
    border: 1px solid var(--gp-border-subtle);
    border-radius: var(--gp-radius);
    cursor: pointer;
    transition: all var(--gp-transition-fast);
    position: relative;
}

.gp-node-row:hover {
    border-color: var(--gp-border);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.gp-node-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 16px;
}

.gp-node-status.online {
    background: var(--gp-success);
    box-shadow:
        0 0 12px var(--gp-success-glow),
        0 0 4px var(--gp-success);
}

.gp-node-status.offline {
    background: var(--gp-text-muted);
}

.gp-node-info {
    flex: 1;
}

.gp-node-name {
    font-weight: 500;
    color: var(--gp-text-primary);
    letter-spacing: -0.01em;
}

.gp-node-meta {
    font-size: 0.8125rem;
    color: var(--gp-text-muted);
    margin-top: 2px;
}

/* ========================================
   Form Elements
   ======================================== */
.gp-input {
    width: 100%;
    padding: 11px 14px;
    background: var(--gp-bg-primary);
    border: 1px solid var(--gp-border);
    border-radius: var(--gp-radius-sm);
    color: var(--gp-text-primary);
    font-size: 0.875rem;
    transition: all var(--gp-transition-fast);
}

.gp-input:focus {
    outline: none;
    border-color: var(--gp-accent);
    box-shadow: 0 0 0 3px var(--gp-accent-glow);
}

.gp-input::placeholder {
    color: var(--gp-text-muted);
}

.gp-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gp-text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.01em;
}

/* ========================================
   Loading
   ======================================== */
.gp-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--gp-border);
    border-top-color: var(--gp-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Skeleton shimmer */
.gp-skeleton {
    background: linear-gradient(
        90deg,
        var(--gp-bg-elevated) 0%,
        var(--gp-bg-hover) 50%,
        var(--gp-bg-elevated) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--gp-radius-sm);
}

.gp-skeleton-row {
    height: 72px;
    margin-bottom: 8px;
    border-radius: var(--gp-radius);
}

.gp-skeleton-text {
    height: 14px;
    width: 60%;
}

.gp-skeleton-text-sm {
    height: 10px;
    width: 40%;
    margin-top: 8px;
}

.gp-skeleton-circle {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

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

/* ========================================
   Animations
   ======================================== */
.gp-fade-in {
    animation: fadeIn var(--gp-transition-slow) ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Modal Overrides
   ======================================== */
.modal-content {
    background: var(--gp-bg-secondary);
    border: 1px solid var(--gp-border);
    border-radius: var(--gp-radius-lg);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
}

.modal-header {
    border-bottom-color: var(--gp-border);
    padding: 18px 22px;
}

.modal-body {
    padding: 22px;
}

.modal-footer {
    border-top-color: var(--gp-border);
    padding: 18px 22px;
}

.modal-title {
    font-weight: 600;
    letter-spacing: -0.01em;
}

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

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

::-webkit-scrollbar-thumb {
    background: var(--gp-border);
    border-radius: 5px;
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gp-text-muted);
    border: 2px solid transparent;
    background-clip: content-box;
}

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

/* ========================================
   Focus States
   ======================================== */
:focus-visible {
    outline: 2px solid var(--gp-accent);
    outline-offset: 2px;
}

.gp-btn:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 2px var(--gp-bg-primary),
        0 0 0 4px var(--gp-accent);
}

.gp-input:focus-visible {
    outline: none;
}

.gp-server-row:focus-visible,
.gp-node-row:focus-visible {
    outline: none;
    border-color: var(--gp-accent);
    box-shadow:
        0 0 0 2px var(--gp-accent-glow),
        0 4px 12px rgba(0, 0, 0, 0.2);
}

.gp-sidebar-item:focus-visible {
    outline: none;
    background: var(--gp-accent-glow);
    color: var(--gp-accent);
}

.gp-server-tab:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--gp-accent-glow);
}

/* ========================================
   Mobile
   ======================================== */
@media (max-width: 768px) {
    :root {
        --gp-sidebar-width: 0px;
    }

    .gp-sidebar {
        transform: translateX(-100%);
        transition: transform var(--gp-transition-normal);
    }

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

    .gp-content {
        padding: 24px 20px;
    }

    .gp-server-header {
        padding: 0 20px;
    }

    .gp-console-page {
        width: 100%;
    }

    .gp-console-grid {
        grid-template-columns: 1fr;
        height: auto;
        min-height: auto;
    }

    .gp-console {
        height: calc(100vh - 320px);
        min-height: 400px;
        border-radius: 0;
        margin: 0 -20px;
        border-left: none;
        border-right: none;
    }

    .gp-console-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
        margin: 0 -20px;
        padding: 0 20px;
    }

    .gp-stat-card {
        flex: 1;
        min-width: calc(50% - 6px);
    }

    .gp-console-page-header {
        flex-wrap: wrap;
    }

    .gp-console-page-title {
        font-size: 1rem;
    }

    .gp-page-title {
        font-size: 1.5rem;
    }
}

/* ========================================
   Legacy Support
   ======================================== */
.card {
    background: var(--gp-bg-secondary);
    border-color: var(--gp-border);
}

.btn-primary {
    background: var(--gp-accent);
    border-color: var(--gp-accent);
}

.btn-success {
    background: var(--gp-success);
    border-color: var(--gp-success);
}

.btn-warning {
    background: var(--gp-warning);
    border-color: var(--gp-warning);
}

.btn-danger {
    background: var(--gp-danger);
    border-color: var(--gp-danger);
}

.text-secondary {
    color: var(--gp-text-secondary) !important;
}

.text-muted {
    color: var(--gp-text-muted) !important;
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
}

.toast-container .toast {
    background: var(--gp-bg-elevated);
    border: 1px solid var(--gp-border);
    border-radius: var(--gp-radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    animation: slideInUp var(--gp-transition-normal) ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Console Status Dots
   ======================================== */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.status-running {
    background: var(--gp-success);
    box-shadow: 0 0 6px var(--gp-success-glow);
    animation: console-pulse 2s ease-in-out infinite;
}

.status-dot.status-offline {
    background: var(--gp-text-muted);
}

/* Ghost button for console header */
.btn-ghost-secondary {
    background: transparent;
    border: none;
    color: var(--gp-text-secondary);
    padding: 4px 8px;
    border-radius: var(--gp-radius-sm);
    transition: all var(--gp-transition-fast);
}

.btn-ghost-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--gp-text-primary);
}

/* Vertical divider */
.vr {
    width: 1px;
    height: 16px;
    background: var(--gp-border);
}
