/* ===== CSS Variables & Reset ===== */
:root {
    /* Colors - Premium Purple/Pink Theme */
    --primary: #8B5CF6;
    --primary-dark: #7C3AED;
    --primary-light: #A78BFA;
    --primary-glow: rgba(139, 92, 246, 0.5);
    --secondary: #EC4899;
    --secondary-dark: #DB2777;
    --secondary-light: #F472B6;
    --accent: #06B6D4;
    --accent-light: #22D3EE;

    #chat-messages,
    #console-messages {
        height: 400px;
        overflow-y: auto;
        background-color: #2E2E3E;
        color: white;
        padding: 10px;
        border-radius: 8px;
        font-family: 'Inter', sans-serif;
    }

    .console-info {
        color: white;
    }

    .console-warn {
        color: yellow;
    }

    .console-error {
        color: red;
    }

    input,
    button {
        background-color: #1E1E2E;
        color: white;
        border: 1px solid #8B5CF6;
        border-radius: 4px;
        padding: 6px 10px;
    }


    /* Success/Error/Warning */
    --success: #10B981;
    --success-light: #34D399;
    --error: #EF4444;
    --error-light: #F87171;
    --warning: #F59E0B;
    --warning-light: #FBBF24;

    /* Backgrounds */
    --bg-primary: #0A0A0F;
    --bg-secondary: #12121A;
    --bg-tertiary: #1A1A25;
    --bg-card: rgba(26, 26, 40, 0.7);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --bg-glass-hover: rgba(255, 255, 255, 0.06);

    /* Text */
    --text-primary: #FFFFFF;
    --text-secondary: #B4B4C0;
    --text-muted: #6B6B80;

    /* Effects */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px rgba(139, 92, 246, 0.4);
    --shadow-glow-pink: 0 0 30px rgba(236, 72, 153, 0.3);

    /* Borders */
    --border-radius: 20px;
    --border-radius-sm: 12px;
    --border-radius-xs: 8px;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-hover: rgba(255, 255, 255, 0.15);

    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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;
    min-height: 100vh;
}

/* Selection */
::selection {
    background: var(--primary);
    color: white;
}

/* ===== Animated Background ===== */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background:
        radial-gradient(ellipse at top left, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(236, 72, 153, 0.1) 0%, transparent 50%),
        var(--bg-primary);
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    animation: float 25s infinite ease-in-out;
    will-change: transform;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    top: -15%;
    left: -15%;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--secondary) 0%, transparent 70%);
    top: 50%;
    right: -15%;
    animation-delay: 8s;
}

.orb-3 {
    width: 550px;
    height: 550px;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    bottom: -15%;
    left: 25%;
    animation-delay: 16s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }

    25% {
        transform: translate(40px, -60px) scale(1.1) rotate(5deg);
    }

    50% {
        transform: translate(-30px, 40px) scale(0.95) rotate(-5deg);
    }

    75% {
        transform: translate(20px, 30px) scale(1.05) rotate(3deg);
    }
}

/* Background animation for files page */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background:
        radial-gradient(ellipse at top left, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(236, 72, 153, 0.1) 0%, transparent 50%),
        var(--bg-primary);
}

.background-animation .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    animation: float 25s infinite ease-in-out;
}

.background-animation .orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    top: -15%;
    left: -15%;
}

.background-animation .orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--secondary) 0%, transparent 70%);
    top: 50%;
    right: -15%;
    animation-delay: 8s;
}

.background-animation .orb-3 {
    width: 550px;
    height: 550px;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    bottom: -15%;
    left: 25%;
    animation-delay: 16s;
}

/* ===== Container ===== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 24px;
    position: relative;
    z-index: 1;
}

.site-footer {
    margin-top: 32px;
    padding: 16px 0 8px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
}

/* ===== Header ===== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 40px;
    padding: 24px 32px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-glow), var(--secondary), var(--primary-glow), transparent);
}

.logo {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo svg {
    filter: drop-shadow(0 4px 12px var(--primary-glow));
    transition: transform var(--transition-normal);
}

.logo:hover svg {
    transform: rotate(-5deg) scale(1.05);
}

.logo h1 {
    font-size: 26px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary) 50%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
    padding: 6px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}

.nav-tab {
    background: transparent;
    border: none;
    padding: 12px 24px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--border-radius-xs);
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.nav-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.nav-tab svg {
    opacity: 0.8;
}

/* Stats Container */
.stats-container {
    display: flex;
    gap: 16px;
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 28px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    min-width: 140px;
    transition: all var(--transition-normal);
}

.stat-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.15);
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: 4px;
    background: linear-gradient(135deg, var(--text-primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Status Indicator */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
}

.status-dot {
    width: 10px;
    height: 10px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse-glow 2s infinite;
    box-shadow: 0 0 10px var(--success);
}

.status-indicator.offline .status-dot {
    background: var(--error);
    animation: none;
    box-shadow: 0 0 10px var(--error);
}

.status-indicator.offline {
    color: var(--error);
}

@keyframes pulse-glow {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
}

/* ===== Section Styling ===== */
section {
    margin-bottom: 40px;
}

.section-header {
    margin-bottom: 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-header h2 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.section-description {
    color: var(--text-secondary);
    font-size: 15px;
    margin-top: 6px;
}

/* ===== Upload Section ===== */
.upload-section {
    margin-bottom: 50px;
}

.upload-area {
    position: relative;
    padding: 60px 40px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px dashed rgba(139, 92, 246, 0.3);
    border-radius: var(--border-radius);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.03), rgba(236, 72, 153, 0.03));
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.upload-area:hover {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.05);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.upload-area:hover::before {
    opacity: 1;
}

.upload-area.drag-over {
    border-color: var(--secondary);
    background: rgba(236, 72, 153, 0.08);
    transform: scale(1.02);
    box-shadow: var(--shadow-glow-pink);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.upload-icon {
    color: var(--primary);
    opacity: 0.9;
    transition: all var(--transition-normal);
    filter: drop-shadow(0 4px 8px var(--primary-glow));
}

.upload-area:hover .upload-icon {
    opacity: 1;
    transform: translateY(-8px) scale(1.1);
    color: var(--primary-light);
}

.upload-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.upload-subtext {
    font-size: 15px;
    color: var(--text-secondary);
}

.browse-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: inherit;
    transition: all var(--transition-fast);
    border-bottom: 2px solid transparent;
}

.browse-link:hover {
    color: var(--accent-light);
    border-bottom-color: var(--accent);
}

/* Upload Progress */
.upload-progress {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.upload-progress.hidden {
    display: none;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
    background-size: 200% 100%;
    border-radius: 999px;
    transition: width var(--transition-normal);
    box-shadow: 0 0 20px var(--primary-glow);
    animation: shimmer 2s infinite linear;
}

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

    100% {
        background-position: -200% 0;
    }
}

#progressText {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

/* ===== Buttons ===== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius-xs);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

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

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px var(--primary-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

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

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--error);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

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

.btn-success:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--success);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-icon {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-xs);
    padding: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary);
    border-color: var(--primary);
    transform: rotate(180deg);
}

/* ===== Plugins Grid ===== */
.plugins-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

.plugin-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 28px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.plugin-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.plugin-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.03), rgba(236, 72, 153, 0.02));
    opacity: 0;
    transition: opacity var(--transition-normal);
    pointer-events: none;
}

.plugin-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    border-color: rgba(139, 92, 246, 0.3);
}

.plugin-card:hover::before {
    opacity: 1;
}

.plugin-card:hover::after {
    opacity: 1;
}

.plugin-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.plugin-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 800;
    color: white;
    box-shadow: 0 8px 20px var(--primary-glow);
    flex-shrink: 0;
    transition: all var(--transition-normal);
}

.plugin-card:hover .plugin-icon {
    transform: rotate(-5deg) scale(1.05);
}

.plugin-info {
    flex: 1;
    margin-left: 18px;
    min-width: 0;
}

.plugin-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.plugin-filename {
    font-size: 12px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 10px;
    border-radius: 6px;
    display: inline-block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.plugin-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--border-radius-xs);
    position: relative;
    z-index: 1;
}

.meta-item {
    display: flex;
    flex-direction: column;
}

.meta-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}

.meta-value {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 600;
    margin-top: 4px;
}

.plugin-actions {
    display: flex;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.plugin-actions .btn {
    flex: 1;
    padding: 12px 16px;
    font-size: 12px;
}

/* ===== Empty State ===== */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 100px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    opacity: 0.3;
    margin-bottom: 24px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.empty-state h3 {
    font-size: 24px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-weight: 700;
}

.empty-state p {
    font-size: 16px;
    color: var(--text-muted);
}

/* ===== Toast Notification ===== */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 18px 28px;
    box-shadow: var(--shadow-lg);
    transform: translateX(450px);
    transition: transform var(--transition-normal);
    z-index: 10000;
    min-width: 320px;
}

.toast.show {
    transform: translateX(0);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 14px;
}

#toastIcon {
    font-size: 22px;
    min-width: 24px;
    text-align: center;
}

#toastMessage {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.toast.success {
    border-left: 4px solid var(--success);
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.1), var(--bg-secondary));
}

.toast.success #toastIcon::before {
    content: '✓';
    color: var(--success);
}

.toast.error {
    border-left: 4px solid var(--error);
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.1), var(--bg-secondary));
}

.toast.error #toastIcon::before {
    content: '✕';
    color: var(--error);
}

.toast.info {
    border-left: 4px solid var(--accent);
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.1), var(--bg-secondary));
}

.toast.info #toastIcon::before {
    content: 'ℹ';
    color: var(--accent);
}

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

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-light), var(--secondary-light));
}

/* ===== Accessibility ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ==========================================================
   FILE MANAGER PAGE STYLES
   ========================================================== */

/* File Page Container */
.file-page-container {
    max-width: 1600px;
    height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    padding: 30px;
}

.file-page-container .header {
    margin-bottom: 24px;
}

/* File Manager Layout */
.file-manager-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    flex: 1;
    min-height: 0;
}

/* Header Controls */
.header-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-area {
    display: flex;
    align-items: center;
}

.back-link {
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 16px;
    border-radius: var(--border-radius-xs);
    transition: all var(--transition-normal);
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    transform: translateX(-4px);
}

.back-link svg {
    transition: transform var(--transition-normal);
}

.back-link:hover svg {
    transform: translateX(-4px);
}

.divider {
    width: 1px;
    height: 28px;
    background: var(--border-color);
    margin: 0 20px;
}

.logo-area h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Status Badge */
.status-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-xs);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.status-badge .status-dot {
    width: 8px;
    height: 8px;
}

/* File Manager Sidebar */
.fm-sidebar {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.fm-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
}

.fm-sidebar-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-light);
    font-family: 'JetBrains Mono', monospace;
}

.btn-icon-small {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-icon-small:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary);
    border-color: var(--primary);
    transform: rotate(180deg);
}

/* Breadcrumbs */
.fm-breadcrumbs {
    padding: 14px 20px;
    background: rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.crumb {
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 6px;
    transition: all var(--transition-fast);
    font-weight: 500;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: inherit;
}

.crumb:hover {
    color: var(--primary);
    background: rgba(139, 92, 246, 0.1);
}

.separator {
    color: var(--text-muted);
    font-weight: 300;
}

/* File Tree */
.fm-file-tree {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.fm-file-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    border-radius: var(--border-radius-xs);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    user-select: none;
    font-size: 14px;
    margin-bottom: 4px;
}

.fm-file-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    transform: translateX(4px);
}

.fm-file-item.active {
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.15), rgba(139, 92, 246, 0.05));
    color: var(--primary-light);
    border-left: 3px solid var(--primary);
}

.fm-file-item .file-icon {
    margin-right: 12px;
    font-size: 18px;
}

.fm-file-item .file-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Editor Area */
.fm-editor-area {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.fm-editor-header {
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    font-weight: 600;
}

.file-info svg {
    color: var(--primary);
}

.current-file-name {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
}

.unsaved-dot {
    width: 10px;
    height: 10px;
    background: var(--warning);
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.6);
    animation: pulse-warning 2s infinite;
}

.unsaved-dot.hidden {
    display: none;
}

@keyframes pulse-warning {

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

    50% {
        opacity: 0.7;
        transform: scale(1.2);
    }
}

.editor-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.status-text {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Editor Wrapper */
.fm-editor-wrapper {
    flex: 1;
    position: relative;
    background: #0d1117;
}

.code-editor {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    color: #e6edf3;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.7;
    padding: 24px;
    resize: none;
    outline: none;
    tab-size: 4;
}

.code-editor:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.editor-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(13, 17, 23, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    color: var(--text-secondary);
    flex-direction: column;
    gap: 16px;
}

.editor-overlay svg {
    color: var(--error);
    opacity: 0.7;
}

.editor-overlay.hidden {
    display: none;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    gap: 16px;
    padding: 40px;
}

.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.empty-folder {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 20px;
    font-size: 14px;
}

/* ==========================================================
   RESPONSIVE DESIGN
   ========================================================== */

@media (max-width: 1200px) {
    .header {
        padding: 20px 24px;
    }

    .plugins-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }

    .file-manager-layout {
        grid-template-columns: 280px 1fr;
    }
}

@media (max-width: 992px) {
    .header {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }

    .nav-tabs {
        order: -1;
        justify-content: center;
    }

    .stats-container {
        justify-content: center;
    }

    .file-manager-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .fm-sidebar {
        max-height: 250px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 16px;
    }

    .header {
        padding: 16px 20px;
        gap: 12px;
    }

    .logo h1 {
        font-size: 20px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .section-header h2 {
        font-size: 22px;
    }

    .plugins-grid {
        grid-template-columns: 1fr;
    }

    .upload-area {
        padding: 40px 20px;
    }

    .upload-text {
        font-size: 18px;
    }

    .nav-tabs {
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }

    .nav-tab {
        padding: 10px 16px;
        font-size: 13px;
        flex: 1 1 auto;
        text-align: center;
    }

    .stat-card {
        padding: 12px 20px;
        min-width: 120px;
    }

    .stat-value {
        font-size: 22px;
    }

    .stats-container {
        width: 100%;
        gap: 10px;
    }

    .plugin-card {
        padding: 16px;
    }

    .plugin-card h3 {
        font-size: 16px;
    }

    .plugin-actions {
        gap: 8px;
    }

    .plugin-actions .btn {
        padding: 10px 12px;
    }

    .toast {
        left: 16px;
        right: 16px;
        bottom: 16px;
        min-width: auto;
    }

    .file-page-container {
        padding: 16px;
        height: auto;
        min-height: 100vh;
    }

    .back-link span {
        display: none;
    }

    .divider {
        display: none;
    }

    .file-manager-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        gap: 16px;
    }

    .fm-sidebar {
        max-height: 320px;
    }

    .fm-file-tree {
        max-height: 220px;
    }

    .fm-editor-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .editor-actions {
        width: 100%;
        justify-content: space-between;
    }

    .code-editor {
        padding: 16px;
        font-size: 13px;
    }

    .context-menu {
        left: 16px !important;
        right: 16px !important;
        width: calc(100% - 32px);
        top: auto !important;
        bottom: 16px;
    }
}

@media (max-width: 480px) {
    .stats-container {
        flex-direction: column;
        width: 100%;
    }

    .stat-card {
        width: 100%;
    }

    .plugin-actions {
        flex-direction: column;
    }

    .plugin-actions .btn {
        width: 100%;
    }

    .header {
        padding: 14px 16px;
    }

    .logo h1 {
        font-size: 18px;
    }

    .nav-tabs {
        gap: 6px;
    }

    .nav-tab {
        padding: 8px 10px;
        font-size: 12px;
    }

    .plugin-card {
        border-radius: 16px;
    }

    .fm-editor-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

    .editor-actions {
        justify-content: space-between;
    }

    .header-controls {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 10px;
    }

    .fm-sidebar-header {
        padding: 16px;
    }

    .fm-breadcrumbs {
        padding: 10px 14px;
    }

    .fm-file-item {
        padding: 10px 12px;
        font-size: 13px;
    }

    .fm-editor-header {
        padding: 14px 16px;
    }

    .status-badge {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* ==========================================================
   ANIMATIONS & KEYFRAMES
   ========================================================== */

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

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

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

.view-section {
    animation: fadeIn 0.4s ease-out;
}

.plugin-card {
    animation: fadeIn 0.4s ease-out backwards;
}

.plugin-card:nth-child(1) {
    animation-delay: 0.05s;
}

.plugin-card:nth-child(2) {
    animation-delay: 0.1s;
}

.plugin-card:nth-child(3) {
    animation-delay: 0.15s;
}

.plugin-card:nth-child(4) {
    animation-delay: 0.2s;
}

.plugin-card:nth-child(5) {
    animation-delay: 0.25s;
}

.plugin-card:nth-child(6) {
    animation-delay: 0.3s;
}

.fm-file-item {
    animation: slideIn 0.3s ease-out backwards;
}

.fm-file-item:nth-child(1) {
    animation-delay: 0.02s;
}

.fm-file-item:nth-child(2) {
    animation-delay: 0.04s;
}

.fm-file-item:nth-child(3) {
    animation-delay: 0.06s;
}

.fm-file-item:nth-child(4) {
    animation-delay: 0.08s;
}

.fm-file-item:nth-child(5) {
    animation-delay: 0.1s;
}

.fm-file-item:nth-child(6) {
    animation-delay: 0.12s;
}

.fm-file-item:nth-child(7) {
    animation-delay: 0.14s;
}

.fm-file-item:nth-child(8) {
    animation-delay: 0.16s;
}

.fm-file-item:nth-child(9) {
    animation-delay: 0.18s;
}

.fm-file-item:nth-child(10) {
    animation-delay: 0.2s;
}

/* ==========================================================
   CHAT PAGE STYLES
   ========================================================== */

.chat-container {
    max-width: 1200px;
    margin: 0 auto;
}

.chat-window {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    max-height: 700px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-status-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

.chat-status-icon {
    font-size: 24px;
}

.chat-message {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 14px 18px;
    animation: slideIn 0.3s ease-out;
}

.chat-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.chat-player {
    font-weight: 600;
    font-size: 14px;
}

.chat-player-user {
    color: var(--primary-light);
}

.chat-player-server {
    color: var(--accent);
}

.chat-timestamp {
    font-size: 12px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.chat-message-body {
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-input-area {
    display: flex;
    gap: 12px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid var(--border-color);
}

.chat-input {
    flex: 1;
    padding: 14px 18px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-xs);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: all var(--transition-normal);
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.chat-send-btn {
    padding: 14px 24px;
}

/* ==========================================================
   CONSOLE PAGE STYLES
   ========================================================== */

.console-container {
    max-width: 1400px;
    margin: 0 auto;
}

.console-window {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    max-height: 700px;
}

.console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--border-color);
}

.console-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.console-output {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.4);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
}

.console-status-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    color: var(--text-secondary);
}

.console-status-icon {
    font-size: 24px;
}

.console-log {
    padding: 4px 0;
    color: var(--text-primary);
    word-wrap: break-word;
    animation: slideIn 0.2s ease-out;
}

.console-time {
    color: var(--text-muted);
    margin-right: 8px;
}

.console-prompt {
    color: var(--primary-light);
    margin-right: 8px;
    font-weight: 600;
}

.console-info {
    color: var(--text-primary);
}

.console-warn {
    color: var(--warning);
}

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

.console-command {
    color: var(--accent);
    font-weight: 500;
}

.console-response {
    color: var(--text-secondary);
    padding-left: 16px;
    border-left: 2px solid var(--primary);
    margin-left: 8px;
}

.console-input-area {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.4);
    border-top: 1px solid var(--border-color);
}

.console-input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-xs);
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'JetBrains Mono', monospace;
    transition: all var(--transition-normal);
}

.console-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.console-execute-btn {
    padding: 12px 20px;
}

/* ==========================================================
   FILE MANAGEMENT UI COMPONENTS
   ========================================================== */

/* Context Menu */
.context-menu {
    position: fixed;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 8px;
    min-width: 160px;
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    animation: fadeIn 0.2s ease-out;
}

.context-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: transparent;
    border: none;
    border-radius: var(--border-radius-xs);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
}

.context-menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--primary-light);
}

.context-menu-item svg {
    opacity: 0.8;
}

.context-menu-item[data-action="delete"]:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 32px;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.modal-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.modal-description {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.modal-warning {
    font-size: 14px;
    color: var(--warning);
    margin-bottom: 20px;
    padding: 12px 16px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--border-radius-xs);
}

.modal-input {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-xs);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: all var(--transition-normal);
    margin-bottom: 24px;
}

.modal-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

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

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Small button variant */
.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
    text-transform: none;
    letter-spacing: normal;
}

/* File manager sidebar actions */
.fm-sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    padding: 0 4px;
}

.fm-sidebar-actions .btn-sm {
    width: 100%;
    justify-content: flex-start;
}

/* Hidden utility class */
.hidden {
    display: none !important;
}