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

:root {
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --surface-light: rgba(255, 255, 255, 0.05);
    --surface-border: rgba(255, 255, 255, 0.1);
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.5);
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;
    --danger: #ef4444;
    --glass-blur: blur(16px);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-gradient);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
}

#app-container {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* Glassmorphism sidebar */
.sidebar {
    width: 280px;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--surface-border);
    padding: 30px 0;
    display: flex;
    flex-direction: column;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.logo-container {
    padding: 0 30px 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--surface-border);
    margin-bottom: 20px;
}

.logo-container h2 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar ul {
    list-style: none;
    padding: 0 15px;
}

.sidebar li {
    padding: 14px 20px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-muted);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.sidebar li:hover {
    background: var(--surface-light);
    color: var(--text);
    transform: translateX(5px);
}

.sidebar li.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.2) 0%, transparent 100%);
    color: #818cf8;
    border-left: 4px solid #818cf8;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 50px;
    overflow-y: auto;
    position: relative;
    z-index: 1;
}

/* Decorative background orbs */
.main-content::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.3) 0%, transparent 70%);
    z-index: -1;
}

.main-content::after {
    content: '';
    position: absolute;
    bottom: -100px;
    left: -100px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.2) 0%, transparent 70%);
    z-index: -1;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

p.subtitle {
    color: var(--text-muted);
    margin-bottom: 40px;
    font-size: 1.1rem;
}

/* Glass Panels */
.glass-panel {
    background: var(--surface-light);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--surface-border);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.5s ease-out forwards;
}

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

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

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

label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: var(--text);
    font-size: 0.95rem;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    max-width: 600px;
    padding: 15px 20px;
    border-radius: 12px;
    border: 1px solid var(--surface-border);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    background: rgba(0, 0, 0, 0.4);
}

small {
    display: block;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Buttons - Liquid Style */
.btn {
    position: relative;
    padding: 12px 24px;
    border: none;
    border-radius: 30px; /* Pill shape */
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), inset 0 0 10px rgba(255, 255, 255, 0.1);
    color: white;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    transform: rotate(45deg);
    pointer-events: none;
    transition: all 0.5s;
}

.btn:hover::before {
    left: -30%; top: -30%;
}

.btn:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), inset 0 0 15px rgba(255, 255, 255, 0.2);
}

.btn-primary { background: linear-gradient(135deg, rgba(99, 102, 241, 0.6) 0%, rgba(139, 92, 246, 0.6) 100%); }
.btn-success { background: linear-gradient(135deg, rgba(16, 185, 129, 0.6) 0%, rgba(5, 150, 105, 0.6) 100%); }
.btn-danger { background: linear-gradient(135deg, rgba(239, 68, 68, 0.6) 0%, rgba(185, 28, 28, 0.6) 100%); }

.msg {
    margin-top: 20px;
    font-size: 0.95rem;
    font-weight: 500;
}

.msg.success {
    color: var(--success);
}

/* Grid List for Campaigns */
.grid-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.card {
    background: var(--surface-light);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    padding: 25px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.card h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

.status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.status.active {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status.inactive {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.card-context {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    flex-grow: 1;
    margin-bottom: 20px;
}

.card-actions {
    display: flex;
    gap: 12px;
}

/* Logs List */
.log-item {
    background: var(--surface-light);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.2s ease;
}

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

.log-meta {
    font-size: 0.85rem;
    color: #818cf8;
    margin-bottom: 8px;
    font-weight: 500;
    display: flex;
    gap: 15px;
}

.log-comment {
    font-weight: 400;
    margin-bottom: 8px;
    color: var(--text);
    border-left: 3px solid var(--surface-border);
    padding-left: 10px;
}

.log-reply {
    color: #34d399;
    font-size: 0.95rem;
    border-left: 3px solid #34d399;
    padding-left: 10px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #ffffff;
    padding: 40px;
    border-radius: 12px;
    width: 600px;
    max-width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--surface-border);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    position: relative;
    animation: scaleIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-content h2 {
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.close {
    position: absolute;
    top: 20px;
    right: 25px;
    color: var(--text-muted);
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover {
    color: var(--text);
}

/* Chat Box inside Modal */
.chat-box {
    height: 260px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 20px;
    padding: 20px;
    overflow-y: auto;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-msg {
    max-width: 85%;
    padding: 12px 18px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    animation: slideUp 0.3s ease-out;
}

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

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

.chat-msg.user {
    align-self: flex-end;
    background: var(--primary);
    color: #ffffff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.2);
}

.chat-msg.ai {
    align-self: flex-start;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
    border-bottom-left-radius: 4px;
}

.chat-input-area {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.chat-input-area input {
    flex: 1;
    margin-bottom: 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
    border-top: 1px solid var(--surface-border);
    padding-top: 20px;
}

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

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Spin Animation */
@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 1s linear infinite;
}

/* Media Gallery */
.media-gallery {
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.media-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    aspect-ratio: 1;
    background: #000;
}

.media-item:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
    z-index: 2;
}

.media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.media-item:hover img {
    opacity: 1;
}

.media-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    font-size: 0.75rem;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =========================================
   CAMPAIGN CONTROL BAR (above canvas)
   ========================================= */
.canvas-control-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    margin-bottom: 14px;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(129, 140, 248, 0.25);
    border-radius: 14px;
    box-shadow: 0 0 24px rgba(99, 102, 241, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.control-bar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.control-bar-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #818cf8;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

.control-bar-label i {
    width: 14px;
    height: 14px;
}

/* Custom neon select */
.neon-select {
    appearance: none;
    -webkit-appearance: none;
    flex: 1;
    max-width: 320px;
    padding: 9px 36px 9px 14px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(129, 140, 248, 0.35);
    border-radius: 10px;
    color: #e2e8f0;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23818cf8' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.neon-select:focus {
    outline: none;
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2), 0 0 16px rgba(99, 102, 241, 0.15);
    background-color: rgba(99, 102, 241, 0.14);
}

.neon-select option {
    background: #1e1b4b;
    color: #f1f5f9;
}

/* Neon refresh button */
.btn-neon-refresh {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(129, 140, 248, 0.4);
    border-radius: 10px;
    color: #818cf8;
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.btn-neon-refresh i {
    width: 15px;
    height: 15px;
    transition: transform 0.4s ease;
}

.btn-neon-refresh:hover {
    background: rgba(99, 102, 241, 0.22);
    border-color: #818cf8;
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.3);
    color: #c7d2fe;
}

.btn-neon-refresh.refreshing i {
    animation: spin-360 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes spin-360 {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Live pulse dot */
.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: pulse-dot 2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes pulse-dot {

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

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

/* =========================================
   CANVAS WRAPPER — Neon Glass
   ========================================= */
.canvas-wrapper {
    position: relative;
    width: 100%;
    height: 430px;
    background: rgba(8, 14, 35, 0.6);
    backdrop-filter: blur(24px);
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 30px;
    border: 1px solid rgba(129, 140, 248, 0.18);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 8px 40px rgba(0, 0, 0, 0.5),
        0 0 60px rgba(99, 102, 241, 0.06);
}

/* Animated dot-grid background */
.canvas-bg-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(129, 140, 248, 0.18) 1px, transparent 1px);
    background-size: 28px 28px;
    animation: grid-drift 30s linear infinite;
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;
}

@keyframes grid-drift {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 28px 28px;
    }
}

/* Ambient glow orbs inside canvas */
.canvas-wrapper::before {
    content: '';
    position: absolute;
    top: -60px;
    left: -60px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
    animation: orb-drift 8s ease-in-out infinite alternate;
}

.canvas-wrapper::after {
    content: '';
    position: absolute;
    bottom: -40px;
    right: 40px;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
}

@keyframes orb-drift {
    from {
        transform: translate(0, 0);
    }

    to {
        transform: translate(30px, 20px);
    }
}

.node-canvas {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 2;
}

/* =========================================
   NEON GLASS PILL NODES
   ========================================= */
.n8n-node {
    position: absolute;
    width: 190px;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    /* full pill */
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    cursor: grab;
    user-select: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.15s ease;
    display: flex;
    align-items: center;
    padding: 10px 14px;
    gap: 10px;
}

.n8n-node:active {
    cursor: grabbing;
    transform: scale(1.04);
}

.n8n-node:hover {
    border-color: rgba(129, 140, 248, 0.4);
    box-shadow: 0 0 22px rgba(99, 102, 241, 0.15), 0 8px 24px rgba(0, 0, 0, 0.5);
}

.node-icon-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.node-icon-wrapper i {
    width: 16px;
    height: 16px;
}

.node-header {
    display: none;
}

.node-body {
    display: none;
}

.node-status {
    display: none;
}

.node-details-wrap {
    flex: 1;
    min-width: 0;
}

.node-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.node-subtitle {
    font-size: 0.62rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-top: 2px;
}

/* ---- State: pending ---- */
.n8n-node.pending {
    border-color: rgba(255, 255, 255, 0.07);
}

/* ---- State: success ---- */
.n8n-node.success {
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.12), 0 8px 24px rgba(0, 0, 0, 0.5);
}

.n8n-node.success .node-icon-wrapper {
    background: rgba(16, 185, 129, 0.18);
    color: #10b981;
    box-shadow: 0 0 14px rgba(16, 185, 129, 0.5);
}

.n8n-node.success .node-title {
    color: #6ee7b7;
}

/* ---- State: processing ---- */
.n8n-node.processing {
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 0 28px rgba(99, 102, 241, 0.22), 0 8px 24px rgba(0, 0, 0, 0.5);
    animation: pill-pulse 1.4s ease-in-out infinite alternate;
}

.n8n-node.processing .node-icon-wrapper {
    background: rgba(99, 102, 241, 0.22);
    color: #818cf8;
    box-shadow: 0 0 18px rgba(99, 102, 241, 0.6);
    animation: icon-spin-slow 2s linear infinite;
}

.n8n-node.processing .node-title {
    color: #a5b4fc;
}

@keyframes pill-pulse {
    from {
        box-shadow: 0 0 14px rgba(99, 102, 241, 0.2), 0 8px 24px rgba(0, 0, 0, 0.5);
        border-color: rgba(99, 102, 241, 0.4);
    }

    to {
        box-shadow: 0 0 36px rgba(99, 102, 241, 0.4), 0 8px 24px rgba(0, 0, 0, 0.5);
        border-color: rgba(99, 102, 241, 0.9);
    }
}

@keyframes icon-spin-slow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ---- State: error ---- */
.n8n-node.error {
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.15), 0 8px 24px rgba(0, 0, 0, 0.5);
}

.n8n-node.error .node-icon-wrapper {
    background: rgba(239, 68, 68, 0.18);
    color: #ef4444;
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.5);
}

/* ---- State: ignored ---- */
.n8n-node.ignored {
    border-color: rgba(245, 158, 11, 0.4);
}

.n8n-node.ignored .node-icon-wrapper {
    background: rgba(245, 158, 11, 0.18);
    color: #f59e0b;
}

/* Node connector dots */
.node-handle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 7px;
    height: 7px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    z-index: 3;
    transition: all 0.3s ease;
}

.n8n-node.success .node-handle {
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

.n8n-node.processing .node-handle {
    background: #818cf8;
    box-shadow: 0 0 8px #818cf8;
}

.node-handle.left {
    left: -4px;
}

.node-handle.right {
    right: -4px;
}

/* =========================================
   SLIDING DETAILS PANEL
   ========================================= */
.details-panel {
    position: absolute;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100%;
    background: rgba(8, 14, 35, 0.92);
    backdrop-filter: blur(28px);
    border-left: 1px solid rgba(129, 140, 248, 0.18);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    display: flex;
    flex-direction: column;
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.6);
}

.details-panel.open {
    right: 0;
}

.panel-header {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

.panel-content {
    padding: 15px;
    overflow-y: auto;
    flex: 1;
    font-size: 0.84rem;
    color: var(--text-muted);
}

.panel-content pre {
    background: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 6px;
    overflow-x: auto;
    margin-top: 10px;
    border: 1px solid #334155;
    color: #e2e8f0;
}

/* =========================================
   SVG GLOWING CIRCUIT LINES
   ========================================= */
.svg-path {
    fill: none;
    stroke: rgba(99, 102, 241, 0.12);
    stroke-width: 2;
    stroke-dasharray: 5 7;
    animation: flow-dash 25s linear infinite;
    transition: stroke 0.4s ease, filter 0.4s ease, stroke-width 0.4s ease;
}

.svg-path.active {
    stroke: #818cf8;
    stroke-width: 2.5;
    filter: drop-shadow(0 0 5px rgba(99, 102, 241, 0.9)) drop-shadow(0 0 12px rgba(99, 102, 241, 0.4));
    stroke-dasharray: 8 5;
    animation: flow-dash 0.8s linear infinite;
}

@keyframes flow-dash {
    to {
        stroke-dashoffset: -100;
    }
}

/* =========================================
   REFRESH & FLASH
   ========================================= */
@keyframes spin-fast {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.btn-refreshing i {
    animation: spin-fast 0.5s linear;
}

@keyframes flash-canvas {
    0% {
        box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04) inset, 0 8px 40px rgba(0, 0, 0, 0.5), 0 0 80px rgba(99, 102, 241, 0.35);
    }

    100% {
        box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04) inset, 0 8px 40px rgba(0, 0, 0, 0.5), 0 0 60px rgba(99, 102, 241, 0.06);
    }
}

.flash {
    animation: flash-canvas 0.5s ease-out;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    #app-container { flex-direction: column; }
    .sidebar { width: 100%; height: auto; border-right: none; border-bottom: 1px solid var(--surface-border); padding: 10px 0; }
    .sidebar ul { display: flex; overflow-x: auto; padding: 0 10px; gap: 5px; }
    .sidebar li { white-space: nowrap; padding: 8px 12px; margin-bottom: 0; }
    .logo-container { padding: 0 20px 10px; margin-bottom: 10px; }
    .main-content { padding: 20px; }
    h1 { font-size: 1.8rem; }
    .modal-content { width: 100%; max-height: 95vh; padding: 20px; }
    .sidebar-footer { border-top: none; padding: 10px 20px 15px !important; }
}

/* =========================================
   AUTHENTICATION LAYOUT & GLASSMORPHISM
   ========================================= */
#auth-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 10% 20%, #1e1b4b 0%, #090d16 100%);
    z-index: 9999;
    overflow-y: auto;
    padding: 20px;
}

#auth-container::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, transparent 70%);
    pointer-events: none;
}

#auth-container::after {
    content: '';
    position: absolute;
    bottom: 20%;
    right: 20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(192, 132, 252, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

.auth-box {
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 40px;
    border-radius: 24px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 40px rgba(99, 102, 241, 0.1);
    text-align: center;
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    position: relative;
    z-index: 10;
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 25px;
}

.auth-logo h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.auth-box h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-bottom: 30px;
    line-height: 1.5;
}

.auth-group {
    text-align: left;
    margin-bottom: 20px;
}

.auth-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: #cbd5e1;
    margin-bottom: 8px;
}

.auth-group label i {
    width: 16px;
    height: 16px;
    color: #818cf8;
}

.auth-group input {
    background: rgba(0, 0, 0, 0.25) !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 14px 18px;
    font-size: 0.95rem;
    border-radius: 12px;
    width: 100%;
}

.auth-group input:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.25);
    background: rgba(0, 0, 0, 0.45) !important;
}

.auth-btn {
    padding: 14px 28px;
    font-size: 1rem;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-switch {
    margin-top: 25px;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.auth-switch span {
    color: #818cf8;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease;
    text-decoration: underline;
}

.auth-switch span:hover {
    color: #c084fc;
}

.sidebar-footer {
    border-top: 1px solid var(--surface-border);
    margin-top: auto;
}