/**
 * WB Components Styling
 *
 * Styles for theAIsWorkbench integration components:
 * - Dependency Graph
 * - Blessed Files Indicator
 * - WB Metadata Widgets
 */

/* ============================================================================
   Common WB Styles
   ============================================================================ */

.wb-not-available,
.wb-error {
    padding: 12px;
    border-radius: 4px;
    font-size: 0.9em;
    color: #7f8c8d;
    background: #f8f9fa;
    border: 1px dashed #dee2e6;
}

.wb-error {
    color: #e74c3c;
    background: #fee;
    border-color: #fcc;
}

.wb-warning {
    padding: 10px 12px;
    margin-bottom: 12px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    color: #856404;
    font-size: 0.9em;
}

/* ============================================================================
   Dependency Graph
   ============================================================================ */

.wb-dependency-graph {
    padding: 16px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

.wb-deps-section {
    margin-bottom: 20px;
}

.wb-deps-section:last-child {
    margin-bottom: 0;
}

.wb-deps-section h4 {
    margin: 0 0 12px 0;
    font-size: 1em;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 6px;
}

.wb-dep-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wb-dep-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #3498db;
    transition: all 0.2s ease;
}

.wb-dep-item:hover {
    background: #e9ecef;
    transform: translateX(3px);
}

.wb-dep-item[data-type="image"] {
    border-left-color: #9b59b6;
}

.wb-dep-item[data-type="pdf"] {
    border-left-color: #e74c3c;
}

.wb-dep-link {
    flex: 1;
    color: #2c3e50;
    text-decoration: none;
    font-size: 0.9em;
}

.wb-dep-link:hover {
    color: #3498db;
    text-decoration: underline;
}

.wb-dep-stale {
    margin-left: 8px;
    font-size: 1.1em;
    cursor: help;
}

.wb-deps-empty {
    color: #95a5a6;
    font-style: italic;
    font-size: 0.9em;
    margin: 8px 0;
}

.wb-deps-info {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #dee2e6;
    font-size: 0.85em;
    color: #7f8c8d;
    text-align: right;
}

/* Compact Dependency Widget (for sidebars) */
.wb-deps-widget {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #3498db;
}

.wb-deps-counts {
    display: flex;
    gap: 12px;
    align-items: center;
}

.wb-dep-count {
    font-size: 0.9em;
    color: #2c3e50;
    cursor: help;
}

/* ============================================================================
   Blessed Files Indicator
   ============================================================================ */

.wb-blessed-indicator {
    padding: 12px 16px;
    margin: 16px 0;
    background: linear-gradient(135deg, #fff9e6 0%, #fffbf0 100%);
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.wb-blessed-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wb-blessed-icon {
    font-size: 1.2em;
}

.wb-blessed-label {
    font-weight: 600;
    color: #2c3e50;
}

.wb-blessed-priority {
    margin-left: auto;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(0,0,0,0.05);
    font-size: 0.85em;
    font-weight: 600;
}

.wb-blessed-reason {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0,0,0,0.1);
    font-size: 0.9em;
    color: #555;
    font-style: italic;
}

/* Compact Blessed Badge (for lists) */
.wb-blessed-badge {
    display: inline-block;
    font-size: 1em;
    margin-left: 4px;
    cursor: help;
}

/* Blessed Files List */
.wb-blessed-files-container {
    padding: 16px;
}

.wb-blessed-section {
    margin-bottom: 24px;
}

.wb-blessed-section:last-child {
    margin-bottom: 0;
}

.wb-blessed-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px 0;
    font-size: 1em;
    font-weight: 600;
    color: #2c3e50;
    padding-bottom: 8px;
    border-bottom: 2px solid #e0e0e0;
}

.wb-blessed-files-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.wb-blessed-file-item {
    padding: 10px 12px;
    margin-bottom: 6px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #f39c12;
    transition: all 0.2s ease;
}

.wb-blessed-file-item:hover {
    background: #e9ecef;
    transform: translateX(3px);
}

.wb-blessed-file-item.wb-stale {
    background: #fee;
    border-left-color: #e74c3c;
}

.wb-blessed-file-link {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
}

.wb-blessed-file-link:hover {
    color: #3498db;
    text-decoration: underline;
}

.wb-stale-indicator {
    margin-left: 8px;
    color: #e74c3c;
    font-size: 1.1em;
    cursor: help;
}

.wb-blessed-file-reason {
    margin-top: 6px;
    font-size: 0.85em;
    color: #666;
    font-style: italic;
    padding-left: 8px;
    border-left: 2px solid #dee2e6;
}

/* ============================================================================
   Priority Colors
   ============================================================================ */

/* BLOCKING */
.wb-blessed-section:has(.wb-blessed-badge[title*="BLOCKING"]) .wb-blessed-file-item {
    border-left-color: #e74c3c;
}

/* MUST */
.wb-blessed-section:has(.wb-blessed-badge[title*="MUST"]) .wb-blessed-file-item {
    border-left-color: #e67e22;
}

/* SHOULD */
.wb-blessed-section:has(.wb-blessed-badge[title*="SHOULD"]) .wb-blessed-file-item {
    border-left-color: #f39c12;
}

/* COULD */
.wb-blessed-section:has(.wb-blessed-badge[title*="COULD"]) .wb-blessed-file-item {
    border-left-color: #95a5a6;
}

/* ============================================================================
   Responsive
   ============================================================================ */

@media (max-width: 768px) {
    .wb-dependency-graph,
    .wb-blessed-files-container {
        padding: 12px;
    }

    .wb-blessed-header {
        flex-wrap: wrap;
    }

    .wb-blessed-priority {
        margin-left: 0;
        width: 100%;
        text-align: center;
        margin-top: 8px;
    }

    .wb-deps-counts {
        flex-wrap: wrap;
    }
}

/* ============================================================================
   Dark Mode (Optional)
   ============================================================================ */

@media (prefers-color-scheme: dark) {
    .wb-dependency-graph,
    .wb-blessed-files-container {
        background: #1e1e1e;
        border-color: #3a3a3a;
    }

    .wb-dep-item,
    .wb-blessed-file-item,
    .wb-deps-widget {
        background: #2a2a2a;
    }

    .wb-dep-item:hover,
    .wb-blessed-file-item:hover {
        background: #333;
    }

    .wb-dep-link,
    .wb-blessed-file-link,
    .wb-blessed-label {
        color: #e0e0e0;
    }

    .wb-blessed-indicator {
        background: linear-gradient(135deg, #2a2a1a 0%, #2f2f1f 100%);
    }

    .wb-not-available {
        background: #2a2a2a;
        color: #999;
        border-color: #3a3a3a;
    }
}
