/* Layout */
.constructor-layout {
    display: grid;
    grid-template-columns: 250px 1fr 300px;
    height: 100vh;
    margin: 0;
    background-color: #f5f5f5;
}

/* Toolbar Styles */
.toolbar {
    background-color: #ffffff;
    border-right: 1px solid #e0e0e0;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    height: 100%;
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f5f5f5;
}

/* Custom scrollbar styles for Webkit browsers (Chrome, Safari, etc) */
.toolbar::-webkit-scrollbar {
    width: 8px;
}

.toolbar::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 4px;
}

.toolbar::-webkit-scrollbar-thumb {
    background-color: #c1c1c1;
    border-radius: 4px;
    border: 2px solid #f5f5f5;
}

.toolbar::-webkit-scrollbar-thumb:hover {
    background-color: #a8a8a8;
}

.toolbar-section:first-child {
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f5f5f5;
}

.toolbar-section:first-child::-webkit-scrollbar {
    width: 8px;
}

.toolbar-section:first-child::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 4px;
}

.toolbar-section:first-child::-webkit-scrollbar-thumb {
    background-color: #c1c1c1;
    border-radius: 4px;
    border: 2px solid #f5f5f5;
}

.toolbar-section:first-child::-webkit-scrollbar-thumb:hover {
    background-color: #a8a8a8;
}

.toolbar-section:last-child {
    position: sticky;
    bottom: 0;
    background-color: #ffffff;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    margin: 0 -20px;
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 5px;
}

.toolbar-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 16px;
}

/* Element Types Container */
.element-types {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
    padding-bottom: 20px;
}

.element-type {
    padding: 10px 12px;
    background-color: #ffffff;
    border: 1.5px solid #e0e0e0;
    border-radius: 6px;
    cursor: move;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #666;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.element-type i {
    width: 20px;
    text-align: center;
    font-size: 14px;
    transition: transform 0.2s ease;
}

.element-type:hover {
    transform: translateX(2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.element-type:hover i {
    transform: scale(1.1);
}

/* Element Type Variants */
.type-event {
    border-color: #A5D6A7;
    color: #2E7D32;
    background-color: rgba(76, 175, 80, 0.05);
}
.type-event i { color: #43A047; }

.type-alert {
    border-color: #FFE082;
    color: #F57F17;
    background-color: rgba(255, 193, 7, 0.05);
}
.type-alert i { color: #FFA000; }


.type-incident {
    border-color: #EF9A9A;
    color: #C62828;
    background-color: rgba(244, 67, 54, 0.05);
}
.type-incident i { color: #E53935; }


.type-email {
    border-color: #90CAF9;
    color: #1565C0;
    background-color: rgba(33, 150, 243, 0.05);
}
.type-email i { color: #1E88E5; }


.type-http {
    border-color: #CE93D8;
    color: #6A1B9A;
    background-color: rgba(156, 39, 176, 0.05);
}
.type-http i { color: #8E24AA; }


.type-remote {
    border-color: #FFAB91;
    color: #D84315;
    background-color: rgba(255, 87, 34, 0.05);
}
.type-remote i { color: #F4511E; }


.type-code {
    border-color: #90A4AE;
    color: #37474F;
    background-color: rgba(96, 125, 139, 0.05);
}
.type-code i { color: #546E7A; }


.type-file {
    border-color: #B39DDB;
    color: #4527A0;
    background-color: rgba(103, 58, 183, 0.05);
}
.type-file i { color: #5E35B1; }


.type-malware {
    border-color: #F48FB1;
    color: #880E4F;
    background-color: rgba(233, 30, 99, 0.05);
}
.type-malware i { color: #D81B60; }


.type-vulnerability {
    border-color: #C5E1A5;
    color: #33691E;
    background-color: rgba(139, 195, 74, 0.05);
}
.type-vulnerability i { color: #7CB342; }


.type-threat {
    border-color: #FF8A80;
    color: #D50000;
    background-color: rgba(255, 82, 82, 0.05);
}
.type-threat i { color: #FF1744; }


.type-asset {
    border-color: #81D4FA;
    color: #01579B;
    background-color: rgba(3, 169, 244, 0.05);
}
.type-asset i { color: #039BE5; }


.type-attack {
    border-color: #F48FB1;
    color: #C2185B;
    background-color: rgba(255, 64, 129, 0.05);
}
.type-attack i { color: #EC407A; }


.type-policy {
    border-color: #CE93D8;
    color: #6A1B9A;
    background-color: rgba(156, 39, 176, 0.05);
}
.type-policy i { color: #8E24AA; }


.type-control {
    border-color: #FFB74D;
    color: #E65100;
    background-color: rgba(255, 152, 0, 0.05);
}
.type-control i { color: #FB8C00; }


.type-host {
    border-color: #90A4AE;
    color: #37474F;
    background-color: rgba(96, 125, 139, 0.05);
}
.type-host i { color: #546E7A; }


.type-ssh {
    border-color: #A1887F;
    color: #3E2723;
    background-color: rgba(121, 85, 72, 0.05);
}
.type-ssh i { color: #6D4C41; }


.type-registry {
    border-color: #80DEEA;
    color: #006064;
    background-color: rgba(0, 188, 212, 0.05);
}
.type-registry i { color: #00ACC1; }


.type-credential {
    border-color: #FFE082;
    color: #E6B800;
    background-color: rgba(255, 193, 7, 0.05);
}
.type-credential i { color: #E6B800; }


.type-process {
    border-color: #81D4FA;
    color: #0098DB;
    background-color: rgba(3, 169, 244, 0.05);
}
.type-process i { color: #0098DB; }


.type-session {
    border-color: #B39DDB;
    color: #6937C5;
    background-color: rgba(103, 58, 183, 0.05);
}
.type-session i { color: #6937C5; }


.type-uri {
    border-color: #FF8A80;
    color: #FF6B6B;
    background-color: rgba(255, 82, 82, 0.05);
}
.type-uri i { color: #FF6B6B; }


.type-external-host {
    border-color: #90CAF9;
    color: #40A9FF;
    background-color: rgba(33, 150, 243, 0.05);
}
.type-external-host i { color: #40A9FF; }


/* Canvas Styles */
.canvas-container {
    position: relative;
    background-color: #fff;
    overflow: hidden;
}

.canvas-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    background-color: #fff;
    padding: 5px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 1000;
}

.canvas-controls button {
    width: 36px;
    height: 36px;
    border: none;
    background-color: #fff;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.canvas-controls button:hover {
    background-color: #f8f9fa;
}

.diagram-canvas {
    width: 100%;
    height: 100%;
    position: relative;
    background-image: linear-gradient(#e1e1e1 1px, transparent 1px),
                      linear-gradient(90deg, #e1e1e1 1px, transparent 1px);
    background-size: 20px 20px;
    background-color: #ffffff;
    z-index: 1;
}

/* Properties Panel Styles */
.properties-panel {
    background-color: #ffffff;
    border-left: 1px solid #e0e0e0;
    padding: 20px;
    overflow-y: auto;
}

.properties-panel h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 16px;
}

.properties-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-size: 14px;
    color: #666;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

/* Action Buttons Container */
.action-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

/* Modern Action Buttons */
.action-button {
    padding: 12px 16px;
    background-color: #ffffff;
    color: #666666;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    width: 100%;
}

/* Button variants */
#visualize-diagram {
    border-color: #90CAF9;
    color: #1976D2;
    background-color: rgba(33, 150, 243, 0.05);
}

/* Button group styles */
.button-group {
    display: flex;
    gap: 8px;
    width: 100%;
}

.button-group .action-button {
    flex: 1;
}

#import-diagram {
    border-color: #B39DDB;
    color: #4527A0;
    background-color: rgba(103, 58, 183, 0.05);
}

#import-diagram:hover {
    background-color: rgba(103, 58, 183, 0.1);
}

#export-diagram {
    border-color: #A5D6A7;
    color: #2E7D32;
    background-color: rgba(76, 175, 80, 0.05);
}

#clear-diagram {
    border-color: #EF9A9A;
    color: #D32F2F;
    background-color: rgba(244, 67, 54, 0.05);
}

#update-element {
    border-color: #A5D6A7;
    color: #2E7D32;
    background-color: rgba(76, 175, 80, 0.02);
}

/* Icon styling */
.action-button i {
    font-size: 16px;
    transition: transform 0.2s ease;
}

/* Hover effects */
.action-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

#visualize-diagram:hover {
    background-color: rgba(33, 150, 243, 0.1);
}

#export-diagram:hover {
    background-color: rgba(76, 175, 80, 0.1);
}

#clear-diagram:hover {
    background-color: rgba(244, 67, 54, 0.1);
}

#update-element:hover {
    background-color: rgba(76, 175, 80, 0.08);
}

.action-button:hover i {
    transform: scale(1.1);
}

/* Ripple animation */
.action-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: currentColor;
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.action-button:hover::after {
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.2;
    }
    20% {
        transform: scale(25, 25);
        opacity: 0.1;
    }
    100% {
        opacity: 0;
        transform: scale(40, 40);
    }
}

/* Active state */
.action-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Global Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    margin: 0;
    padding: 0;
}

/* Diagram Element Styles */
.diagram-element {
    position: absolute;
    width: 200px;
    min-height: 60px;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px;
    cursor: move;
    user-select: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.diagram-element::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 14px;
}

.diagram-element.selected {
    box-shadow: 0 0 0 2px #2196F3;
}

/* Element type styles on canvas */
.diagram-element.event {
    border-left: 4px solid #4CAF50;
}
.diagram-element.event::before {
    content: "\f0e7"; /* bolt */
    color: #4CAF50;
}

.diagram-element.alert {
    border-left: 4px solid #FFC107;
}
.diagram-element.alert::before {
    content: "\f0f3"; /* bell */
    color: #FFC107;
}

.diagram-element.incident {
    border-left: 4px solid #F44336;
}
.diagram-element.incident::before {
    content: "\f071"; /* exclamation-triangle */
    color: #F44336;
}

.diagram-element.email {
    border-left: 4px solid #2196F3;
}
.diagram-element.email::before {
    content: "\f0e0"; /* envelope */
    color: #2196F3;
}

.diagram-element.http-request {
    border-left: 4px solid #9C27B0;
}
.diagram-element.http-request::before {
    content: "\f0ac"; /* globe */
    color: #9C27B0;
}

.diagram-element.remote-request {
    border-left: 4px solid #FF5722;
}
.diagram-element.remote-request::before {
    content: "\f233"; /* server */
    color: #FF5722;
}

.diagram-element.code-execution {
    border-left: 4px solid #607D8B;
}
.diagram-element.code-execution::before {
    content: "\f121"; /* code */
    color: #607D8B;
}

.diagram-element.file {
    border-left: 4px solid #673AB7;
}
.diagram-element.file::before {
    content: "\f15b"; /* file */
    color: #673AB7;
}

.diagram-element.malware {
    border-left: 4px solid #E91E63;
}
.diagram-element.malware::before {
    content: "\f964"; /* virus */
    color: #E91E63;
}

.diagram-element.vulnerability {
    border-left: 4px solid #8BC34A;
}
.diagram-element.vulnerability::before {
    content: "\f3ed"; /* shield */
    color: #8BC34A;
}

.diagram-element.threat {
    border-left: 4px solid #FF5252;
}
.diagram-element.threat::before {
    content: "\f714"; /* skull */
    color: #FF5252;
}

.diagram-element.asset {
    border-left: 4px solid #03A9F4;
}
.diagram-element.asset::before {
    content: "\f1b2"; /* cube */
    color: #03A9F4;
}

.diagram-element.attack {
    border-left: 4px solid #FF4081;
}
.diagram-element.attack::before {
    content: "\f1e2"; /* bomb */
    color: #FF4081;
}

.diagram-element.policy {
    border-left: 4px solid #9C27B0;
}
.diagram-element.policy::before {
    content: "\f02d"; /* book */
    color: #9C27B0;
}

.diagram-element.control {
    border-left: 4px solid #FF9800;
}
.diagram-element.control::before {
    content: "\f023"; /* lock */
    color: #FF9800;
}

.diagram-element.host {
    border-left: 4px solid #607D8B;
}
.diagram-element.host::before {
    content: "\f108"; /* desktop */
    color: #607D8B;
}

.diagram-element.ssh {
    border-left: 4px solid #795548;
}
.diagram-element.ssh::before {
    content: "\f120"; /* terminal */
    color: #795548;
}

.diagram-element.registry {
    border-left: 4px solid #00BCD4;
}
.diagram-element.registry::before {
    content: "\f1c0"; /* database */
    color: #00BCD4;
}

.diagram-element.credential {
    border-left: 4px solid #E6B800;
}
.diagram-element.credential::before {
    content: "\f084"; /* key */
    color: #E6B800;
}

.diagram-element.process {
    border-left: 4px solid #0098DB;
}
.diagram-element.process::before {
    content: "\f2db"; /* microchip */
    color: #0098DB;
}

.diagram-element.session {
    border-left: 4px solid #6937C5;
}
.diagram-element.session::before {
    content: "\f4fd"; /* user-clock */
    color: #6937C5;
}

.diagram-element.uri {
    border-left: 4px solid #FF6B6B;
}
.diagram-element.uri::before {
    content: "\f0c1"; /* link */
    color: #FF6B6B;
}

.diagram-element.external-host {
    border-left: 4px solid #40A9FF;
}
.diagram-element.external-host::before {
    content: "\f6ff"; /* network-wired */
    color: #40A9FF;
}

.diagram-element .element-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Connection Styles */
.connection-line {
    position: absolute;
    pointer-events: none;
    z-index: 1;
}

.connection-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 6px;
    border-color: transparent;
    pointer-events: none;
}

.diagram-element.connection-source {
    box-shadow: 0 0 0 2px #4CAF50;
}

.diagram-element.connection-target {
    box-shadow: 0 0 0 2px #2196F3;
}

.diagram-element.connection-hover {
    box-shadow: 0 0 0 2px #FFC107;
}

#connection-mode.active {
    background-color: #4CAF50;
}

.connection-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #fff;
    border: 2px solid #2196F3;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2;
}

.connection-handle:hover {
    background-color: #2196F3;
}

.connection-handle.right {
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
}

.connection-handle.left {
    left: -5px;
    top: 50%;
    transform: translateY(-50%);
}

/* Properties Actions */
.properties-actions {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.properties-actions .action-button {
    flex: 1;
}

#delete-element {
    border-color: #FFCDD2;
    color: #C62828;
    background-color: rgba(244, 67, 54, 0.02);
}

#delete-element:hover {
    background-color: rgba(244, 67, 54, 0.08);
} 
