﻿/* ==========================================================================
   CAUSANOVA BPMN STUDIO - DEFINITIVE EDITION
   Merged Layout & Neon Styling
   ========================================================================== */

:root {
    /* --- CORE COLORS --- */
    --bg-dark: #0F1115;
    --bg-panel: #181A1F;
    --bg-canvas: #131519;
    /* --- ACCENTS --- */
    --primary: #00FF94; /* CausaNova Neon Green */
    --primary-dim: rgba(0, 255, 148, 0.1);
    --primary-glow: rgba(0, 255, 148, 0.4);
    --secondary: #0dcaf0; /* Cyan for Info/Hover */
    --danger: #FF4757;
    --warning: #FFA502;
    /* --- NODE COLORS (Specific) --- */
    --color-start: #00FF94;
    --color-end: #FF4757;
    --color-task: #0dcaf0;
    --color-gateway: #FFA502;
    --color-event: #a29bfe;
    /* --- TEXT --- */
    --text-main: #E0E1E6;
    --text-muted: #8B949E;
    /* --- BORDERS & EFFECTS --- */
    --border-color: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(24, 26, 31, 0.85);
    --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 15px rgba(0, 255, 148, 0.15);
    --grid-color: rgba(255, 255, 255, 0.05);
    /* --- SIZING --- */
    --toolbar-height: 56px;
    --sidebar-width: 280px;
}

/* ==========================================================================
   1. GLOBAL LAYOUT
   ========================================================================== */
html, body {
    height: 100%;
    overflow: hidden;
    background: var(--bg-dark);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-main);
}

.bpmn-studio-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

/* ==========================================================================
   2. TOOLBAR (GLASSMORPHISM)
   ========================================================================== */
.bpmn-toolbar {
    height: var(--toolbar-height);
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 20px;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.cms-select {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-main);
    padding: 4px 8px;
    font-size: 0.85rem;
    transition: all 0.2s;
}

    .cms-select:focus, .cms-select:hover {
        border-color: var(--primary);
        box-shadow: 0 0 8px var(--primary-dim);
        outline: none;
    }

/* ==========================================================================
   3. SIDEBAR (PALETTE & TEMPLATES)
   ========================================================================== */
.cms-sidebar {
    background: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    z-index: 90;
}

/* Tabs Styling */
.nav-tabs-dark {
    border-bottom: 1px solid var(--border-color);
    background: rgba(0,0,0,0.2);
}

    .nav-tabs-dark .nav-link {
        color: var(--text-muted);
        border: none;
        border-bottom: 2px solid transparent;
        transition: all 0.2s;
    }

        .nav-tabs-dark .nav-link:hover {
            color: var(--text-main);
            background: rgba(255,255,255,0.02);
        }

        .nav-tabs-dark .nav-link.active {
            background: transparent;
            color: var(--primary);
            border-bottom: 2px solid var(--primary);
        }

/* Palette Items */
.palette-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 10px 14px;
    border-radius: 6px;
    cursor: grab;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

    .palette-item i {
        width: 20px;
        text-align: center;
        color: var(--text-muted);
        transition: color 0.2s;
    }

    .palette-item:hover {
        background: var(--primary-dim);
        border-color: var(--primary);
        transform: translateX(4px);
        box-shadow: var(--shadow-glow);
    }

        .palette-item:hover i {
            color: var(--primary);
        }

/* Template Items */
.template-item {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 8px;
    transition: all 0.2s;
}

    .template-item:hover {
        background: rgba(255,255,255,0.05);
        border-color: var(--secondary);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    }

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 5px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

    .custom-scrollbar::-webkit-scrollbar-thumb:hover {
        background: #555;
    }

/* ==========================================================================
   4. CANVAS & BOARD (With Icons)
   ========================================================================== */
#bpmn-container {
    background-color: var(--bg-canvas);
    background-image: radial-gradient(var(--grid-color) 1px, transparent 1px);
    background-size: 20px 20px;
    position: relative;
    overflow: hidden;
}

/* Nodes Styling */
.bpmn-node {
    cursor: pointer;
    transition: all 0.2s;
}

    .bpmn-node .body {
        fill: #252526;
        stroke: var(--text-muted);
        stroke-width: 2px;
        filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
        transition: all 0.3s;
    }

    /* Node Types Colors */
    .bpmn-node[data-component*="startEvent"] .body {
        stroke: var(--color-start);
    }

    .bpmn-node[data-component*="endEvent"] .body {
        stroke: var(--color-end);
        stroke-width: 3px;
    }

    .bpmn-node[data-component*="userTask"] .body {
        stroke: var(--color-task);
    }

    .bpmn-node[data-component*="serviceTask"] .body {
        stroke: var(--color-task);
        stroke-dasharray: 5,2;
    }

    .bpmn-node[data-component*="Gateway"] .body {
        stroke: var(--color-gateway);
    }

    .bpmn-node[data-component*="timer"] .body {
        stroke: var(--color-event);
    }

    /* --- ICONS (CRITICAL) --- */
    .bpmn-node .bpmn-icon {
        font-family: "Font Awesome 6 Free", "Font Awesome 5 Free";
        font-weight: 900;
        fill: #fff;
        font-size: 14px;
        opacity: 0.9;
    }

    .bpmn-node[data-component*="startEvent"] .bpmn-icon {
        fill: var(--color-start);
        font-size: 16px;
    }

    .bpmn-node[data-component*="endEvent"] .bpmn-icon {
        fill: var(--color-end);
    }

    .bpmn-node[data-component*="Gateway"] .bpmn-icon {
        fill: var(--color-gateway);
        font-size: 18px;
    }

    .bpmn-node[data-component*="Task"] .bpmn-icon {
        fill: var(--color-task);
        font-size: 20px;
    }

    /* Selection */
    .bpmn-node.selected .body {
        stroke: #fff;
        stroke-width: 2.5px;
        filter: drop-shadow(var(--shadow-glow));
        animation: pulseBorder 2s infinite;
    }

@keyframes pulseBorder {
    0% {
        stroke-opacity: 1;
    }

    50% {
        stroke-opacity: 0.5;
    }

    100% {
        stroke-opacity: 1;
    }
}

.bpmn-label {
    fill: var(--text-main);
    font-size: 11px;
    font-weight: 500;
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* Edges */
.bpmn-edge {
    stroke: #555;
    stroke-width: 2px;
    fill: none;
    transition: stroke 0.2s;
}

    .bpmn-edge:hover, .bpmn-node.selected + .bpmn-edge {
        stroke: var(--text-main);
    }

/* ==========================================================================
   5. DASHBOARD & CARDS
   ========================================================================== */
#bpmn-dashboard {
    background: var(--bg-canvas);
}

.process-card {
    background: linear-gradient(145deg, #1e2025 0%, #16181d 100%);
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

    .process-card:hover {
        transform: translateY(-5px) scale(1.01);
        border-color: var(--primary);
        box-shadow: 0 10px 30px rgba(0,0,0,0.4), 0 0 20px rgba(0, 255, 148, 0.05);
    }

    .process-card h5 {
        font-weight: 600;
        letter-spacing: 0.5px;
    }

/* ==========================================================================
   6. UTILS
   ========================================================================== */
.btn-icon {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

    .btn-icon:hover {
        background: rgba(255,255,255,0.1);
        color: #fff;
        border-color: rgba(255,255,255,0.2);
    }

.zoom-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 5px;
    background: var(--bg-panel);
    padding: 5px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
}
/* POOLS & LANES */
.bpmn-pool {
    fill: rgba(255, 255, 255, 0.03);
    stroke: rgba(255, 255, 255, 0.2);
    stroke-width: 2px;
}

.bpmn-lane {
    fill: transparent;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 1px;
    stroke-dasharray: 5,5; /* Gestrichelte Linie für Lanes */
}

.bpmn-label-pool {
    fill: #888;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    writing-mode: vertical-rl; /* Vertikaler Text wenn gewünscht */
    transform: rotate(180deg); /* Korrektur für vertical-rl */
}

.bpmn-label-lane {
    fill: #666;
    font-size: 12px;
    font-weight: bold;
}