/* ============================================================================
   Minecraft Server Manager — Design System & Styles
   ============================================================================ */

/* --- Design Tokens --- */
:root {
    /* Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #111119;
    --bg-card: #16161f;
    --bg-card-hover: #1c1c28;
    --bg-elevated: #1e1e2a;
    --bg-modal: #1a1a26;

    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-default: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.15);

    --text-primary: #f0f0f5;
    --text-secondary: #9090a8;
    --text-muted: #606078;
    --text-inverse: #0a0a0f;

    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-subtle: rgba(99, 102, 241, 0.12);
    --accent-glow: rgba(99, 102, 241, 0.25);

    --green: #22c55e;
    --green-subtle: rgba(34, 197, 94, 0.12);
    --green-glow: rgba(34, 197, 94, 0.25);

    --red: #ef4444;
    --red-subtle: rgba(239, 68, 68, 0.12);
    --red-glow: rgba(239, 68, 68, 0.25);

    --yellow: #eab308;
    --yellow-subtle: rgba(234, 179, 8, 0.12);

    --orange: #f97316;
    --orange-subtle: rgba(249, 115, 22, 0.12);

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 24px;
    --space-2xl: 32px;
    --space-3xl: 48px;

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px var(--accent-glow);

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --duration-fast: 150ms;
    --duration-normal: 250ms;
    --duration-slow: 400ms;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
}

/* Subtle background texture */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(99, 102, 241, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 100%, rgba(139, 92, 246, 0.04) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* --- Header --- */
#app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-2xl);
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border-bottom: 1px solid var(--border-subtle);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.logo h1 {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-right {
    display: flex;
    align-items: center;
}

.top-nav {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    padding: 6px;
    border-radius: 100px;
}

.nav-divider {
    width: 1px;
    height: 18px;
    background: var(--border-subtle);
    margin: 0 4px;
}

.btn-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease);
}

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

.btn-nav.admin-only:not([style*="display: none"]) {
    display: flex;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 2px 2px 2px 14px;
    background: var(--bg-elevated);
    border-radius: 100px;
    border: 1px solid var(--border-subtle);
}

.user-pill span {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.logout-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(239, 68, 68, 0.1);
    color: var(--red);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease);
}

.logout-trigger:hover {
    background: var(--red);
    color: white;
}

/* --- Proxy Badge --- */
.proxy-badge {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 500;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    transition: all var(--duration-normal) var(--ease);
}

.proxy-badge.is-running {
    background: var(--green-subtle);
    border-color: rgba(34, 197, 94, 0.2);
}

.proxy-badge.is-stopped {
    background: var(--red-subtle);
    border-color: rgba(239, 68, 68, 0.2);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: all var(--duration-normal) var(--ease);
}

.is-running .status-dot {
    background: var(--green);
    box-shadow: 0 0 8px var(--green-glow);
    animation: pulse-green 2s infinite;
}

.is-stopped .status-dot {
    background: var(--red);
}

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

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease);
    white-space: nowrap;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: var(--shadow-sm), 0 0 16px var(--accent-glow);
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: var(--shadow-md), 0 0 24px var(--accent-glow);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
}

.btn-ghost:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-hover);
    color: var(--text-secondary);
    transition: all var(--duration-fast) var(--ease);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent);
    color: var(--text-primary);
    box-shadow: 0 0 12px var(--accent-glow);
}

.btn-danger {
    background: var(--red);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-danger:hover {
    background: #dc2626;
    box-shadow: var(--shadow-md), 0 0 16px var(--red-glow);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration-fast) var(--ease);
}

.btn-icon:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.75rem;
}

.btn-success {
    background: var(--green);
    color: white;
}

.btn-success:hover {
    background: #16a34a;
    box-shadow: var(--shadow-md), 0 0 16px var(--green-glow);
}

.btn-warning {
    background: var(--orange);
    color: white;
}

.btn-warning:hover {
    background: #ea580c;
}

/* --- Main Content --- */
#app-main {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-2xl);
}

/* --- Stats Bar --- */
#stats-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

.stat-card {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-xl);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    transition: all var(--duration-normal) var(--ease);
}

.stat-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--accent-subtle);
    color: var(--accent);
    flex-shrink: 0;
}

.stat-icon--green {
    background: var(--green-subtle);
    color: var(--green);
}

.stat-icon--red {
    background: var(--red-subtle);
    color: var(--red);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* --- Toolbar --- */
#toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
}

#toolbar h2 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* --- Server Grid --- */
.servers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: var(--space-lg);
}

/* --- Server Card --- */
.server-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    transition: all var(--duration-normal) var(--ease);
    animation: card-in 0.4s var(--ease) both;
}

.server-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

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

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.card-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.card-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.card-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-running {
    background: var(--green-subtle);
    color: var(--green);
}

.badge-stopped, .badge-exited {
    background: var(--red-subtle);
    color: var(--red);
}

.badge-unknown, .badge-created, .badge-not.running {
    background: var(--yellow-subtle);
    color: var(--yellow);
}

.badge-creating {
    background: var(--accent-subtle);
    color: var(--accent);
}

.badge-downloading_mods {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
}

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

.badge-running .badge-dot,
.badge-downloading_mods .badge-dot {
    animation: pulse-green 2s infinite;
}

/* Card Details */
.card-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm) var(--space-lg);
    margin-bottom: var(--space-xl);
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.detail-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 500;
}

.detail-value {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-weight: 400;
}

/* Card Actions */
.card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-subtle);
}

.card-actions .btn {
    justify-content: center;
}

/* --- Empty State --- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-3xl) var(--space-xl);
    text-align: center;
    gap: var(--space-md);
}

.empty-state p {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.empty-state span {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* --- Modals --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--duration-normal) var(--ease);
}

.modal-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

/* App Login Layer */
.login-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity var(--transition-normal);
}
.login-overlay:not(.is-visible) {
    opacity: 0;
    pointer-events: none;
}
.login-box {
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 3rem;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow-xl);
    text-align: center;
}
.login-box h2 {
    margin-bottom: 2rem;
}
.login-box .form-group {
    text-align: left;
    margin-bottom: 1.5rem;
}

.modal {
    background: var(--bg-modal);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    width: 90%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px) scale(0.96);
    transition: all var(--duration-normal) var(--ease);
}

.modal-overlay.is-visible .modal {
    transform: translateY(0) scale(1);
}

.modal--small {
    max-width: 400px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
}

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-header--danger h3 {
    color: var(--red);
}

.modal-body {
    margin-bottom: var(--space-xl);
}

.modal-body p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: var(--space-lg);
}

/* --- Forms --- */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    transition: all var(--duration-fast) var(--ease);
    outline: none;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group input:disabled,
.form-group select:disabled {
    background: rgba(255, 255, 255, 0.03) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: var(--text-muted) !important;
    opacity: 0.55;
    cursor: not-allowed;
}

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

.form-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
    margin-top: var(--space-xl);
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    accent-color: var(--accent);
}

/* --- Toasts --- */
#toast-container {
    position: fixed;
    bottom: var(--space-2xl);
    right: var(--space-2xl);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-xl);
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    animation: toast-in 0.3s var(--ease), toast-out 0.3s var(--ease) forwards;
    animation-delay: 0s, 3.5s;
    max-width: 380px;
}

.toast--success {
    border-left: 3px solid var(--green);
}

.toast--error {
    border-left: 3px solid var(--red);
}

.toast--info {
    border-left: 3px solid var(--accent);
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(30px);
    }
}

/* --- Spinner (for loading states) --- */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* --- Responsive --- */
@media (max-width: 768px) {
    #app-header {
        padding: var(--space-md) var(--space-lg);
    }

    #app-main {
        padding: var(--space-lg);
    }

    #stats-bar {
        grid-template-columns: 1fr;
    }

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

    .form-row {
        grid-template-columns: 1fr;
    }

    .card-details {
        grid-template-columns: 1fr;
    }

    #toast-container {
        left: var(--space-lg);
        right: var(--space-lg);
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 0.95rem;
    }

    .proxy-badge .status-text {
        display: none;
    }
}

/* --- Console Modal --- */
.modal--large.console-modal {
    max-width: 1200px;
    width: 95vw;
    height: 90vh;
    display: flex;
    flex-direction: column;
    padding: var(--space-xl);
}

.console-modal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: 0;
    min-height: 0;
}

.console-logs-container {
    flex: 1;
    background-color: #0c0c10;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    overflow-y: auto;
    min-height: 0;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.8);
}

#console-logs-content {
    color: #e4e4e7;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
}

.console-command-line {
    color: #38bdf8;
    font-weight: 600;
}

.console-command-response {
    color: #a1a1aa;
}

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

#console-input-form {
    margin-top: auto;
}

.console-input-group {
    display: flex;
    align-items: center;
    background: #18181b;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    padding: 0 var(--space-md);
    transition: all var(--duration-fast) var(--ease);
}

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

.console-prompt {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: bold;
    color: var(--accent);
    margin-right: var(--space-sm);
    user-select: none;
}

#console-command-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px 0;
    color: #f4f4f5;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    outline: none;
}

#console-command-input::placeholder {
    color: #52525b;
}

@media (max-width: 768px) {
    .modal--large.console-modal {
        width: 98vw;
        height: 95vh;
        padding: var(--space-md);
    }
    #console-logs-content {
        font-size: 0.75rem;
    }
}

/* --- Upload Mods Modal Specifics --- */
.mods-source-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease);
    display: flex;
    gap: var(--space-lg);
    align-items: center;
}

.mods-source-card:hover {
    border-color: var(--accent);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-md), 0 0 16px var(--accent-glow);
    transform: translateY(-2px);
}

.mods-source-card:active {
    transform: translateY(0);
}

.mods-source-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    flex-shrink: 0;
    transition: all var(--duration-normal) var(--ease);
}

.mods-source-icon--cf {
    background: rgba(249, 115, 22, 0.1);
    color: var(--orange);
}

.mods-source-card:hover .mods-source-icon--cf {
    background: var(--orange);
    color: white;
    box-shadow: 0 0 12px rgba(249, 115, 22, 0.4);
}

.mods-source-icon--local {
    background: var(--accent-subtle);
    color: var(--accent);
}

.mods-source-card:hover .mods-source-icon--local {
    background: var(--accent);
    color: white;
    box-shadow: var(--shadow-glow);
}

.mods-source-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mods-source-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.mods-source-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

/* Drag & Drop Zone */
.drop-zone {
    background: rgba(255, 255, 255, 0.01);
    border: 2px dashed var(--border-hover);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl) var(--space-xl);
    text-align: center;
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease);
    display: flex;
    align-items: center;
    justify-content: center;
}

.drop-zone--over {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.04) !important;
    box-shadow: inset 0 0 12px var(--accent-glow);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
}

.drop-zone-icon {
    color: var(--text-muted);
    transition: color var(--duration-fast) var(--ease), transform var(--duration-normal) var(--ease);
}

.drop-zone:hover .drop-zone-icon,
.drop-zone--over .drop-zone-icon {
    color: var(--accent);
    transform: translateY(-4px);
}

.drop-zone-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.browse-link {
    color: var(--accent);
    font-weight: 600;
    text-decoration: underline;
}

.drop-zone-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Selected File Info */
.selected-file-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 12px var(--space-lg);
    margin-top: var(--space-lg);
    animation: file-in var(--duration-normal) var(--ease) both;
}

@keyframes file-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.file-icon {
    color: var(--accent);
    display: flex;
    align-items: center;
}

.file-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.file-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.remove-file-btn {
    color: var(--text-muted) !important;
    padding: var(--space-xs) !important;
}

.remove-file-btn:hover {
    color: var(--red) !important;
    background: rgba(239, 68, 68, 0.1) !important;
}


/* ============================================================================
   File Explorer Styles
   ============================================================================ */

.modal--large.file-explorer-modal {
    max-width: 1300px;
    width: 96vw;
    height: 92vh;
    display: flex;
    flex-direction: column;
    padding: var(--space-xl);
}

.file-explorer-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin-bottom: 0;
    padding-top: 0;
}

.explorer-grid {
    display: grid;
    grid-template-columns: 2.2fr 1fr;
    gap: var(--space-xl);
    flex: 1;
    min-height: 0;
    height: 100%;
}

.explorer-left-container {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
    overflow: hidden;
}

.explorer-view-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    height: 100%;
}

.explorer-toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-subtle);
    backdrop-filter: blur(10px);
}

.breadcrumbs {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    margin-left: var(--space-md);
    opacity: 0.8;
}

.explorer-files-panel {
    flex: 1;
    min-height: 0;
    position: relative;
    overflow-y: auto;
}

.explorer-file-list {
    display: flex;
    flex-direction: column;
}

.explorer-item {
    display: flex;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease);
    animation: fade-in-up 0.2s var(--ease) both;
}

.explorer-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.explorer-item-icon {
    margin-right: var(--space-md);
    display: flex;
    align-items: center;
    color: var(--accent);
}

.explorer-item-icon.folder {
    color: var(--yellow);
}

.explorer-item-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: var(--space-md);
}

.explorer-item-details {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.explorer-item-actions {
    display: flex;
    gap: var(--space-xs);
    opacity: 0;
    transition: opacity var(--duration-fast) var(--ease);
}

.explorer-item:hover .explorer-item-actions {
    opacity: 1;
}

/* Drag and Drop Zone */
#explorer-drag-zone {
    position: relative;
}

.drag-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 15, 0.9);
    border: 2px dashed var(--accent);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--duration-fast) var(--ease);
}

.drag-overlay.drag-active {
    opacity: 1;
    pointer-events: auto;
}

.drag-overlay-box {
    text-align: center;
    color: var(--accent);
    animation: pulse-glow 2s infinite;
}

.drag-overlay-box p {
    margin-top: var(--space-md);
    font-weight: 600;
    font-size: 1rem;
}

/* Editor View */
.editor-file-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.editor-textarea-container {
    flex: 1;
    min-height: 0;
    padding: var(--space-md);
    background: #09090d;
}

#explorer-editor-textarea {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    color: #e4e4e7;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.6;
    resize: none;
    outline: none;
    padding: var(--space-sm);
}

/* Right Panel Styles */
.explorer-right-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
    min-height: 0;
    height: 100%;
}

.staging-section {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.unstaged-section {
    height: 48%;
}

.staged-section {
    flex: 1;
}

.staging-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.staging-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.staging-badge.bg-green {
    background: var(--green-subtle);
    color: var(--green);
}

.changes-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.change-item {
    display: flex;
    align-items: center;
    padding: var(--space-sm) var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.8rem;
    animation: fade-in-up 0.15s var(--ease) both;
}

.change-item-path {
    font-family: var(--font-mono);
    font-size: 0.775rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin-right: var(--space-md);
}

.change-tag {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: var(--space-md);
}

.change-tag.tag-new {
    background: var(--green-subtle);
    color: var(--green);
}

.change-tag.tag-edit {
    background: var(--orange-subtle);
    color: var(--orange);
}

.change-item-actions {
    display: flex;
    gap: var(--space-xs);
}

.upload-commit-panel {
    padding: var(--space-lg);
    background: rgba(255, 255, 255, 0.01);
    border-top: 1px solid var(--border-subtle);
}

.btn-upload {
    width: 100%;
    justify-content: center;
    padding: var(--space-md);
    font-weight: 600;
    font-size: 0.875rem;
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-glow {
    0%, 100% {
        opacity: 1;
        filter: drop-shadow(0 0 2px var(--accent));
    }
    50% {
        opacity: 0.7;
        filter: drop-shadow(0 0 10px var(--accent));
    }
}

/* File explorer modal grid wrapping for responsiveness */
@media (max-width: 900px) {
    .explorer-grid {
        grid-template-columns: 1fr;
        grid-template-rows: 1.2fr 1fr;
    }
    .unstaged-section {
        height: 200px;
    }
    .modal--large.file-explorer-modal {
        height: 96vh;
    }
}


/* ============================================================================
   Server Logs Modal split screen layout
   ============================================================================ */
.modal--large.server-logs-modal {
    max-width: 1300px;
    width: 96vw;
    height: 92vh;
    display: flex;
    flex-direction: column;
    padding: var(--space-xl);
}

.server-logs-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin-bottom: 0;
    padding-top: 0;
}

.logs-grid {
    display: grid;
    grid-template-columns: 1fr 2.2fr;
    gap: var(--space-lg);
    flex: 1;
    min-height: 0;
    height: 100%;
}

.logs-sidebar {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.logs-sidebar .sidebar-header {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-subtle);
}

.logs-file-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.log-file-item {
    display: flex;
    flex-direction: column;
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease);
}

.log-file-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.log-file-item.is-active {
    background: rgba(99, 102, 241, 0.08);
    border-left: 3px solid var(--accent);
    padding-left: calc(var(--space-md) - 3px);
}

.log-file-name {
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: var(--font-mono);
    color: var(--text-primary);
    word-break: break-all;
}

.log-file-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
    display: flex;
    justify-content: space-between;
}

.logs-content-panel {
    background: #09090d;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.logs-content-panel .content-header {
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-subtle);
}

.logs-view-container {
    flex: 1;
    min-height: 0;
    padding: var(--space-lg);
    overflow-y: auto;
    overflow-x: auto;
}

#server-logs-viewer-pre {
    margin: 0;
    color: #e4e4e7;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
}

.settings-actions-group .btn-ghost {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-default);
}

.settings-actions-group .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--accent);
}

/* --- Firewall --- */
.modal--medium.firewall-modal {
    max-width: 850px;
    width: 90vw;
    display: flex;
    flex-direction: column;
}

.firewall-modal-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    min-height: 0;
}

/* Voice Chat Alert Box */
.voicechat-alert-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    gap: var(--space-lg);
    animation: fade-in-up var(--duration-normal) var(--ease) both;
}

.voicechat-alert-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.voicechat-alert-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--green);
    letter-spacing: 0.02em;
}

.voicechat-alert-text {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0;
}

.status-dot--green {
    background-color: var(--green) !important;
    box-shadow: 0 0 8px var(--green);
}

/* Sections */
.firewall-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: var(--space-xs);
}

.firewall-section-header h4 {
    margin: 0;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

/* Add Rule Card */
.add-rule-card {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    animation: fade-in-up var(--duration-normal) var(--ease) both;
}

.form-hint-inline {
    display: block;
    margin-top: 4px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Table Style */
.firewall-rules-list-container {
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.005);
}

.firewall-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
    text-align: left;
}

.firewall-table th,
.firewall-table td {
    padding: 12px var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
}

.firewall-table th {
    background: rgba(255, 255, 255, 0.02);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    user-select: none;
}

.firewall-table tr:last-child td {
    border-bottom: none;
}

.firewall-table tr:hover td {
    background: rgba(255, 255, 255, 0.015);
}

/* Protocol Badges */
.badge-proto {
    display: inline-flex;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.65rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.badge-proto--tcp {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.badge-proto--udp {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

/* Status Toggle inside cell */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 18px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .3s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-muted);
    transition: .3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--green);
}

input:checked + .toggle-slider:before {
    transform: translateX(14px);
    background-color: white;
}

.empty-state-small {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.firewall-footer {
    display: flex;
    align-items: center;
    border-top: 1px solid var(--border-subtle);
    padding-top: var(--space-md);
    margin-top: 0;
}

.modal--large.quick-settings-modal {
    max-width: 1200px;
    width: 95vw;
    height: 90vh;
    display: flex;
    flex-direction: column;
    padding: var(--space-xl);
}
.quick-settings-modal-body {
    flex: 1;
    overflow-y: auto;
    padding-right: var(--space-md);
    margin-bottom: 0;
    min-height: 0;
}

/* --- Firewall Rule External Port Lock Styles --- */
.port-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
    width: 100%;
}

.port-input-wrapper input {
    flex: 1;
}

#btn-lock-external-port {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    width: 38px;
    min-width: 38px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

#btn-lock-external-port:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(99, 102, 241, 0.08);
}

#btn-lock-external-port.active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(99, 102, 241, 0.15);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.25);
}

#btn-lock-external-port svg {
    transition: transform 0.2s ease;
}

#btn-lock-external-port:active svg {
    transform: scale(0.9);
}

/* --- Quick Settings Advanced Layout & Interactions --- */

.qs-sections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-xl);
}

.qs-section-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    transition: all var(--duration-normal) var(--ease);
}

.qs-section-card:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border-hover);
}

.qs-section-card h5 {
    color: var(--accent);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: var(--space-sm);
    margin-bottom: var(--space-xs);
}

/* Flex layout form group inside card section */
.form-group-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding-bottom: var(--space-md);
    margin-bottom: 0;
}

.form-group-flex label {
    font-weight: 600;
    margin-bottom: 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.form-group-flex input,
.form-group-flex select {
    width: 170px !important;
    text-align: right;
    font-weight: 600;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    outline: none;
    transition: all var(--duration-fast) var(--ease);
}

.form-group-flex input:hover,
.form-group-flex select:hover {
    border-color: var(--border-hover);
    background: rgba(0, 0, 0, 0.35);
}

.form-group-flex input:focus,
.form-group-flex select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
    background: rgba(0, 0, 0, 0.45);
}

.form-group-flex select {
    text-align-last: right;
    padding-right: 28px !important;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%239090a8' stroke-width='2.5' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

/* Toggle row style form group inside card section */
.form-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding-bottom: var(--space-md);
    margin-bottom: 0;
}

.form-group-toggle label {
    font-weight: 600;
    margin-bottom: 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

/* Glowing border for inputs with unsaved changes */
.qs-input-changed {
    border-color: var(--yellow) !important;
    box-shadow: 0 0 0 3px var(--yellow-subtle) !important;
    background: rgba(234, 179, 8, 0.02) !important;
}

/* Unsaved changes inline indicator dot/badge */
.qs-unsaved-badge {
    color: var(--yellow);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-left: var(--space-sm);
    background: var(--yellow-subtle);
    padding: 1px 6px;
    border-radius: 4px;
    animation: pulse-glow 2s infinite alternate;
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 4px rgba(234, 179, 8, 0.1);
    }
    100% {
        box-shadow: 0 0 8px rgba(234, 179, 8, 0.3);
    }
}

/* Unsaved Glowing primary button style */
.btn-primary--glowing {
    background: var(--yellow) !important;
    color: var(--text-inverse) !important;
    font-weight: 700;
    box-shadow: 0 0 16px rgba(234, 179, 8, 0.45) !important;
}

.btn-primary--glowing:hover {
    background: #f59e0b !important;
    box-shadow: 0 0 24px rgba(234, 179, 8, 0.65) !important;
}

/* ============================================================================
   User Dropdown & Settings Modal Styles
   ============================================================================ */

/* User Rollout Menu */
.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    color: inherit;
    font: inherit;
    outline: none;
}

.user-menu-trigger:focus-visible {
    outline: 2px solid var(--accent);
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 200px;
    background: var(--bg-modal);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: var(--space-sm);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    z-index: 1000;
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    pointer-events: none;
    transition: opacity var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease);
}

.user-dropdown-menu.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 8px 12px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: all var(--duration-fast) var(--ease);
    outline: none;
    text-decoration: none;
}

.user-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.user-dropdown-item:focus-visible {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

/* Settings Modals (Almost Fullscreen) */
.modal--fullscreen {
    max-width: 95vw;
    width: 1200px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    padding: var(--space-xl);
}

.modal--fullscreen .modal-body {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 0;
    padding: var(--space-md) 0;
}

/* Premium Blank State for Settings */
.settings-placeholder-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    color: var(--text-secondary);
    text-align: center;
    animation: fade-in 0.4s var(--ease);
}

.settings-placeholder-icon {
    margin-bottom: var(--space-lg);
    opacity: 0.25;
    color: var(--accent);
    animation: pulse-icon 3s ease-in-out infinite alternate;
}

@keyframes pulse-icon {
    0% { transform: scale(1); opacity: 0.25; filter: drop-shadow(0 0 0px var(--accent-glow)); }
    100% { transform: scale(1.05); opacity: 0.45; filter: drop-shadow(0 0 15px var(--accent-glow)); }
}

.settings-placeholder-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.settings-placeholder-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    max-width: 400px;
}

/* Settings Layout & Sidebar */
.settings-layout {
    display: flex;
    flex: 1;
    height: 100%;
    min-height: 0;
}

.settings-sidebar {
    width: 220px;
    border-right: 1px solid var(--border-subtle);
    padding-right: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.settings-sidebar-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px 14px;
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: all var(--duration-fast) var(--ease);
    outline: none;
}

.settings-sidebar-btn:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.settings-sidebar-btn.is-active {
    background: var(--accent-subtle);
    color: var(--accent-hover);
    box-shadow: inset 3px 0 0 var(--accent);
}

.settings-sidebar-btn svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.settings-sidebar-btn.is-active svg {
    opacity: 1;
}

.settings-content-pane {
    display: none;
    flex-direction: column;
    flex: 1;
    padding-left: var(--space-2xl);
    overflow-y: auto;
    height: 100%;
}

.settings-content-pane.is-active {
    display: flex;
}

.route-file {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-hover);
    font-weight: 500;
}
