/*
 * BPMN Studio - Tool-Specific Styles
 * Simulation & Canvas Styling
 * Copyright © 2026 ORAND Advisors
 */

/* ============================================================================
   CANVAS STYLES
   ============================================================================ */

.workspace-container {
    display: flex;
    height: 100%;
    width: 100%;
    position: relative;
}

#canvas {
    flex: 1;
    height: 100%;
    background: #fff;
    background-image: radial-gradient(#e0e0e0 1px, transparent 1px);
    background-size: 20px 20px;
}

/* ============================================================================
   BREADCRUMB NAVIGATION
   ============================================================================ */

.breadcrumb-nav {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1000;
    background: white;
    border: 2px solid var(--orand-blue);
    border-radius: 6px;
    padding: 8px 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    max-width: 600px;
}

.breadcrumb-nav.hidden {
    display: none;
}

.breadcrumb-icon {
    font-size: 1.1rem;
    color: var(--orand-orange);
}

.breadcrumb-path {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.breadcrumb-item {
    color: var(--orand-blue);
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 3px;
    transition: background-color 0.2s, color 0.2s;
    white-space: nowrap;
}

.breadcrumb-item:hover {
    background-color: rgba(0, 151, 215, 0.1);
    color: var(--orand-orange);
}

.breadcrumb-item.active {
    color: var(--text-main);
    font-weight: 600;
    cursor: default;
    background-color: #f0f0f0;
}

.breadcrumb-separator {
    color: #999;
    font-weight: 300;
    user-select: none;
}

/* Breadcrumb on mobile */
@media (max-width: 768px) {
    .breadcrumb-nav {
        max-width: calc(100% - 20px);
        font-size: 0.8rem;
        padding: 6px 10px;
    }
    
    .breadcrumb-icon {
        font-size: 1rem;
    }
}

/* ============================================================================
   SUB-TABS (for User Guide)
   ============================================================================ */

.sub-tabs {
    display: flex;
    gap: 8px;
    margin: 20px 0;
    flex-wrap: wrap;
    border-bottom: 2px solid var(--orand-blue);
    padding-bottom: 10px;
}

.sub-tab-btn {
    padding: 10px 16px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 5px 5px 0 0;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-main);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.sub-tab-btn:hover {
    background: #e8e8e8;
    border-color: var(--orand-blue);
}

.sub-tab-btn.active {
    background: var(--orand-blue);
    color: white;
    border-color: var(--orand-blue);
    border-bottom-color: var(--orand-blue);
}

.sub-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.sub-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile sub-tabs */
@media (max-width: 768px) {
    .sub-tabs {
        gap: 6px;
    }
    
    .sub-tab-btn {
        padding: 8px 12px;
        font-size: 0.75rem;
    }
}

/* ============================================================================
   PROPERTIES PANEL
   ============================================================================ */

.properties-panel {
    width: 320px;
    background: #f9f9f9;
    border-left: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.properties-header {
    padding: 15px;
    background: white;
    border-bottom: 2px solid var(--orand-orange);
}

.properties-header h3 {
    margin: 0 0 5px 0;
    color: var(--orand-blue);
    font-size: 1.1rem;
}

.element-type {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.properties-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.hint {
    background: #e8f4f8;
    border-left: 3px solid var(--orand-blue);
    padding: 10px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #444;
}

.property-section {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
}

.property-section h4 {
    margin: 0 0 12px 0;
    color: var(--orand-blue);
    font-size: 0.95rem;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.property-field {
    margin-bottom: 12px;
}

.property-field:last-child {
    margin-bottom: 0;
}

.property-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 5px;
}

.property-field input[type="text"],
.property-field textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 0.9rem;
    font-family: inherit;
}

.property-field input[type="text"]:focus,
.property-field textarea:focus {
    outline: none;
    border-color: var(--orand-blue);
    box-shadow: 0 0 0 2px rgba(0, 151, 215, 0.1);
}

.property-field input.readonly,
.property-field textarea.readonly {
    background: #f5f5f5;
    color: #666;
    cursor: not-allowed;
}

.property-value {
    display: inline-block;
    padding: 6px 10px;
    background: #e8f4f8;
    color: var(--orand-blue);
    font-weight: 600;
    border-radius: 3px;
    font-size: 0.85rem;
}

.info-box {
    background: #fffbeb;
    border: 1px solid #fbbf24;
    border-radius: 4px;
    padding: 10px;
    margin-top: 12px;
    font-size: 0.85rem;
}

.info-box strong {
    color: var(--orand-orange);
    display: block;
    margin-bottom: 5px;
}

.info-box ul {
    margin: 5px 0 0 20px;
    padding: 0;
}

.info-box li {
    margin-bottom: 3px;
    color: #666;
}

/* Color Picker Styles */
.color-row {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.1s;
}

.color-swatch:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.color-swatch.active {
    border-color: #333;
    box-shadow: 0 0 0 1px white inset;
}

.swatch-none { 
    background: #fff; 
    border: 2px solid #ccc; 
    position: relative; 
}

.swatch-none::before { 
    content:''; 
    position:absolute; 
    top:50%; 
    left:50%; 
    width:20px; 
    height:2px; 
    background:#ccc; 
    transform:translate(-50%, -50%) rotate(45deg); 
}

.swatch-red { background: #ef4444; }
.swatch-green { background: #10b981; }
.swatch-orange { background: #f97316; }
.swatch-blue { background: #0047AB; }

/* ============================================================================
   TOKEN SIMULATION STYLES
   ============================================================================ */

.simulation-token {
    width: 20px;
    height: 20px;
    background: var(--orand-orange);
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.4);
    pointer-events: none;
    z-index: 100;
    animation: pulse 0.6s ease-in-out;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Highlight active flows during simulation */
.simulation-active-flow .djs-visual path {
    stroke: var(--orand-orange) !important;
    stroke-width: 3px !important;
    animation: flowPulse 0.8s ease-in-out;
}

@keyframes flowPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ============================================================================
   BPMN.JS PALETTE CUSTOMIZATION
   ============================================================================ */

.djs-palette {
    background: #fcfcfc;
    border-color: #ccc;
}

.djs-palette .entry:hover {
    color: var(--orand-blue);
    background-color: rgba(0, 151, 215, 0.1);
}

/* Hide palette during simulation */
.simulation-active .djs-palette {
    display: none;
}

/* ============================================================================
   DOCUMENTATION / USER GUIDE STYLES
   ============================================================================ */

.docs-container {
    padding: 40px;
    max-width: 900px;
    margin: 0 auto;
    overflow-y: auto;
    height: 100%;
}

.docs-container h1 {
    color: var(--orand-blue);
    margin-bottom: 20px;
    font-size: 2rem;
}

.docs-container h2 {
    color: var(--orand-orange);
    margin-top: 30px;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
    font-size: 1.5rem;
}

.docs-container h3 {
    color: var(--text-main);
    margin-top: 20px;
    margin-bottom: 8px;
    font-size: 1.2rem;
}

.docs-container p {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #444;
}

.docs-container ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.docs-container li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.docs-container strong {
    color: var(--orand-blue);
    font-weight: 600;
}

.code-block {
    background: #f4f4f4;
    padding: 15px;
    border-radius: 4px;
    font-family: 'Courier New', Consolas, monospace;
    border-left: 4px solid var(--orand-blue);
    margin: 15px 0;
    font-size: 0.9rem;
    overflow-x: auto;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.feature-card {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
    border-left: 3px solid var(--orand-orange);
}

.feature-card h4 {
    color: var(--orand-blue);
    margin-bottom: 8px;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 768px) {
    header {
        flex-direction: column;
        height: auto;
        padding: 10px;
        gap: 10px;
    }
    
    .brand-area {
        width: 100%;
        justify-content: center;
    }
    
    .controls {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .docs-container {
        padding: 20px;
    }
    
    .tabs {
        padding-left: 0;
        justify-content: center;
    }
    
    /* Properties panel becomes bottom drawer on mobile */
    .workspace-container {
        flex-direction: column;
    }
    
    .properties-panel {
        width: 100%;
        height: 300px;
        border-left: none;
        border-top: 2px solid var(--orand-orange);
    }
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {
    header, footer, .tabs, .controls {
        display: none !important;
    }
    
    main {
        height: auto;
    }
    
    #canvas {
        background: white;
        page-break-inside: avoid;
    }
}
