/* Atos Brand Guidelines - Custom Styles for Workflow Editor */

/* ============================================
   ATOS BRAND COLORS (Reference)
   - Atos Blue: #0073E6
   - Deep Blue: #00005C
   - Light Blue: #3DC7FF
   - Pink: #EF5E82
   - Green: #4AA82D
   - Purple: #663894
   - Orange: #F56A00
   - White: #FFFFFF
   ============================================ */

/* Typography - Raleway */
body {
    font-family: 'Raleway', sans-serif;
}

/* Canvas container */
#canvas-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #F8F9FA;
}

#canvas-container canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Node status indicators - Using Atos colors */
.node-status-running {
    box-shadow: 0 0 10px 2px #0073E6;
    animation: pulse 1s infinite;
}

.node-status-completed {
    box-shadow: 0 0 10px 2px #4AA82D;
}

.node-status-failed {
    box-shadow: 0 0 10px 2px #EF5E82;
}

.node-status-waiting {
    box-shadow: 0 0 10px 2px #F56A00;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Node palette items - Sharp corners (Atos) */
.node-item {
    padding: 0.625rem 0.75rem;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    user-select: none;
    margin-bottom: 0.25rem;
}

.node-item:hover {
    background-color: #f0f7ff;
    border-color: #0073E6;
    transform: translateX(2px);
}

.node-item:active {
    background-color: #0073E6;
    color: white;
}

.node-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.node-item .node-color,
.node-item > span:first-child {
    width: 0.875rem;
    height: 0.875rem;
    flex-shrink: 0;
}

.node-item .node-name,
.node-item > span:last-child {
    color: #00005C;
    font-weight: 500;
}

/* Category toggle */
.node-category {
    margin-bottom: 0.5rem;
}

.node-category h3 {
    user-select: none;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #00005C;
    padding: 0.5rem 0;
    border-bottom: 2px solid #0073E6;
    margin-bottom: 0.5rem;
}

.node-category h3:hover {
    color: #0073E6;
}

.node-category.collapsed .category-nodes {
    display: none;
}

.node-category.collapsed h3 [data-lucide="chevron-down"] {
    transform: rotate(-90deg);
}

/* Main section header (Configurations / Agents) */
.main-section-header {
    font-size: 0.8rem;
    border-bottom: none;
    margin-bottom: 0;
    padding: 0.5rem 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.main-section-header:hover {
    background-color: #e5e7eb;
}

/* Sub-category styles */
.node-subcategory {
    margin-bottom: 0.25rem;
}

.subcategory-header {
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    transition: background-color 0.15s;
}

.subcategory-header:hover {
    background-color: #f3f4f6;
}

.subcategory-nodes {
    padding: 0.25rem 0;
}

.subcategory-nodes .node-item {
    padding-left: 0.5rem;
}

/* Section content */
.section-content {
    padding: 0.25rem 0;
}

/* Tab switching - Sharp underline */
[data-tab].active {
    border-color: #0073E6;
    color: #0073E6;
}

/* Execution log items - Sharp corners */
.log-item {
    padding: 0.5rem;
    border-left: 3px solid;
}

.log-item.pending {
    border-color: #6b7280;
    background-color: #f3f4f6;
}

.log-item.running {
    border-color: #0073E6;
    background-color: #e0f2fe;
}

.log-item.completed {
    border-color: #4AA82D;
    background-color: #dcfce7;
}

.log-item.failed {
    border-color: #EF5E82;
    background-color: #fce7f3;
}

.log-item.waiting {
    border-color: #F56A00;
    background-color: #ffedd5;
}

/* Modal backdrop */
.modal-backdrop {
    backdrop-filter: blur(4px);
}

/* Workflow list items - Sharp corners */
.workflow-item {
    padding: 0.75rem;
    background-color: #f8f9fa;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.15s ease;
}

.workflow-item:hover {
    background-color: #e5e7eb;
    border-color: #0073E6;
}

.workflow-item .workflow-name {
    font-weight: 600;
    color: #00005C;
}

.workflow-item .workflow-date {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Property field styles - Sharp corners */
.prop-field {
    margin-bottom: 1rem;
}

.prop-field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #00005C;
    margin-bottom: 0.25rem;
}

.prop-field input,
.prop-field select,
.prop-field textarea {
    width: 100%;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: #00005C;
}

.prop-field input:focus,
.prop-field select:focus,
.prop-field textarea:focus {
    outline: none;
    border-color: #0073E6;
    box-shadow: 0 0 0 2px rgba(0, 115, 230, 0.2);
}

.prop-field textarea {
    min-height: 80px;
    resize: vertical;
}

/* Scrollbar styling - Atos colors */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #0073E6;
}

::-webkit-scrollbar-thumb:hover {
    background: #00005C;
}

/* Toast notifications - Sharp corners */
.toast {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 100;
    animation: slideUp 0.3s ease;
}

.toast.success {
    background-color: #4AA82D;
    color: white;
}

.toast.error {
    background-color: #EF5E82;
    color: white;
}

.toast.warning {
    background-color: #F56A00;
    color: white;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* Toolbar buttons - Sharp, flat design */
.toolbar-btn {
    padding: 0.5rem;
    color: #00005C;
    transition: all 0.15s ease;
    background: transparent;
    border: 1px solid transparent;
}

.toolbar-btn:hover {
    background-color: #e5e7eb;
    border-color: #0073E6;
}

/* Atos Primary Button */
.btn-primary {
    background-color: #0073E6;
    color: white;
    padding: 0.5rem 1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.btn-primary:hover {
    background-color: #005bb5;
}

/* Atos Secondary Button */
.btn-secondary {
    background-color: #00005C;
    color: white;
    padding: 0.5rem 1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.btn-secondary:hover {
    background-color: #000040;
}

/* Atos Ghost Button */
.btn-ghost {
    background-color: transparent;
    color: #0073E6;
    padding: 0.5rem 1rem;
    font-weight: 600;
    border: 1px solid #0073E6;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-ghost:hover {
    background-color: #0073E6;
    color: white;
}

/* Cards - Flat design, no rounded corners */
.atos-card {
    background-color: white;
    border: 1px solid #e5e7eb;
    padding: 1.5rem;
}

.atos-card-header {
    border-bottom: 2px solid #0073E6;
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}

/* Form inputs - Sharp corners, visible labels */
.atos-input {
    width: 100%;
    background-color: white;
    border: 1px solid #d1d5db;
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    color: #00005C;
    transition: border-color 0.15s ease;
}

.atos-input:focus {
    outline: none;
    border-color: #0073E6;
    box-shadow: 0 0 0 2px rgba(0, 115, 230, 0.2);
}

.atos-input::placeholder {
    color: #9ca3af;
}

/* Atos Label */
.atos-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #00005C;
    margin-bottom: 0.375rem;
}

/* Toggle switch - Atos style */
.atos-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    background-color: #d1d5db;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.atos-toggle.active {
    background-color: #0073E6;
}

.atos-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background-color: white;
    transition: transform 0.15s ease;
}

.atos-toggle.active::after {
    transform: translateX(20px);
}

/* Animation for fade in */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in { 
    animation: fadeIn 0.3s ease-out; 
}

/* Atos Curves of Progress - Decorative element */
.atos-curve {
    position: absolute;
    width: 200px;
    height: 200px;
    border: 3px solid #3DC7FF;
    border-radius: 0 0 100% 0;
    border-top: none;
    border-left: none;
}

.atos-curve.top-right {
    top: 0;
    right: 0;
    transform: rotate(0deg);
}

.atos-curve.bottom-left {
    bottom: 0;
    left: 0;
    transform: rotate(180deg);
}

/* ============================================
   ATOS BRANDED LOADING SYSTEM
   Unified loading indicators across the app
   ============================================ */

/* Global Loading Overlay */
.atos-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(248, 249, 250, 0.95);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.atos-loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.atos-loading-content {
    text-align: center;
    color: #00005C;
}

/* Atos Branded Spinner - Triple Ring */
.atos-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
}

.atos-spinner-ring {
    position: absolute;
    border: 3px solid transparent;
    border-radius: 50%;
    animation: atos-spin 1.5s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
}

.atos-spinner-ring:nth-child(1) {
    width: 80px;
    height: 80px;
    border-top-color: #0073E6;
    border-right-color: #0073E6;
    animation-delay: 0s;
}

.atos-spinner-ring:nth-child(2) {
    width: 60px;
    height: 60px;
    top: 10px;
    left: 10px;
    border-top-color: #3DC7FF;
    border-right-color: #3DC7FF;
    animation-delay: -0.2s;
    animation-direction: reverse;
}

.atos-spinner-ring:nth-child(3) {
    width: 40px;
    height: 40px;
    top: 20px;
    left: 20px;
    border-top-color: #663894;
    border-right-color: #663894;
    animation-delay: -0.4s;
}

/* Center dot with pulse */
.atos-spinner-dot {
    position: absolute;
    width: 12px;
    height: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #0073E6, #3DC7FF);
    border-radius: 50%;
    animation: atos-pulse 1s ease-in-out infinite;
}

@keyframes atos-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes atos-pulse {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0.7;
    }
}

/* Loading text */
.atos-loading-text {
    font-family: 'Raleway', sans-serif;
    font-size: 1.125rem;
    font-weight: 600;
    color: #00005C;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.atos-loading-subtext {
    font-family: 'Raleway', sans-serif;
    font-size: 0.875rem;
    color: #0073E6;
    opacity: 0.9;
}

/* Progress bar variant */
.atos-loading-progress {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    margin: 16px auto 0;
    overflow: hidden;
}

.atos-loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #0073E6, #3DC7FF, #663894);
    background-size: 200% 100%;
    animation: atos-progress 1.5s ease-in-out infinite;
}

@keyframes atos-progress {
    0% { 
        width: 0%;
        background-position: 0% 0%;
    }
    50% {
        width: 70%;
        background-position: 100% 0%;
    }
    100% { 
        width: 100%;
        background-position: 0% 0%;
    }
}

/* Canvas-specific loading (lighter variant) */
.atos-canvas-loading {
    position: absolute;
    inset: 0;
    background: rgba(248, 249, 250, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.atos-canvas-loading .atos-spinner-ring:nth-child(1) {
    border-top-color: #00005C;
    border-right-color: #00005C;
}

.atos-canvas-loading .atos-loading-text {
    color: #00005C;
}

.atos-canvas-loading .atos-loading-subtext {
    color: #0073E6;
}

/* Button loading state */
.btn-loading {
    position: relative;
    pointer-events: none;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-top: -10px;
    margin-left: -10px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-right-color: currentColor;
    border-radius: 50%;
    animation: atos-spin 0.8s linear infinite;
}

.btn-loading.btn-primary::after {
    border-top-color: white;
    border-right-color: white;
}

/* Inline spinner for text */
.atos-inline-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-right-color: currentColor;
    border-radius: 50%;
    animation: atos-spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
