/* Fix Explorer Styles - Carbon Design System */

/* Container */
.fix-explorer-container {
    width: 100%;
    padding: 1rem 2rem;
    box-sizing: border-box;
}

/* For larger screens, add max-width with proper margins */
@media (min-width: 1584px) {
    .fix-explorer-container {
        max-width: 1584px;
        margin: 0 auto;
    }
}

/* Header Section */
.fix-explorer-header {
    margin-bottom: 2rem;
}

.fix-explorer-header h2 {
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
    color: #161616;
}

.fix-explorer-header p {
    font-size: 0.875rem;
    color: #525252;
}

/* Search Section */
.search-section {
    margin-bottom: 1rem;
}

#fix-search {
    width: 100%;
    max-width: 600px;
}

/* Main Layout */
.fix-explorer-layout {
    display: grid;
    grid-template-columns: minmax(350px, 400px) 1fr;
    gap: 1rem;
    min-height: calc(100vh - 200px); /* Full viewport height minus navbar, search, and footer */
}

@media (max-width: 1056px) {
    .fix-explorer-layout {
        grid-template-columns: 1fr;
    }
    
    .detail-panel {
        margin-top: 1rem;
    }
}

/* Tree Panel */
.tree-panel {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 600px;
}

.tree-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
    background: #f4f4f4;
}

.tree-header h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: #161616;
}

.tree-actions {
    display: flex;
    gap: 0.5rem;
}

.tree-container {
    flex: 1;
    overflow-y: auto;
    /*padding: 0.5rem;*/
}

/* Carbon Tree Component Styling */
#fix-tree {
    width: 100%;
}

/* Override Carbon tree node styles to match React TreeView */
cds-tree-node {
    --cds-tree-node-min-height: 2rem;
}

cds-tree-node::part(node) {
    padding: 0.25rem 0.5rem;
    margin: 1px 0.5rem;
    border: 2px solid transparent;
    transition: all 0.11s ease;
}

cds-tree-node::part(node):hover {
    background-color: #e8e8e8;
}

cds-tree-node[selected]::part(node) {
    border: 2px solid #0f62fe;
    background-color: #ffffff;
}

cds-tree-node::part(label) {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

/* Search Results Header */
.search-results-header {
    padding: 0.5rem 1rem;
    background: #e5f6ff;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.search-results-header p {
    margin: 0;
    font-size: 0.875rem;
    color: #161616;
}

/* Detail Panel */
.detail-panel {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 600px;
}

/* Welcome State */
.detail-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    height: 100%;
}

.welcome-icon {
    width: 64px;
    height: 64px;
    fill: #c6c6c6;
    margin-bottom: 1.5rem;
}

.detail-welcome h3 {
    font-size: 1.25rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
    color: #161616;
}

.detail-welcome p {
    font-size: 0.875rem;
    color: #525252;
}

/* Detail Content */
.detail-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.detail-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    background: #ffffff;
}

.detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #f4f4f4;
}

/* Fix Information Tile */
.fix-info-tile {
    background: #ffffff !important;
    border: 1px solid #e0e0e0 !important;
    padding: 1.5rem !important;
    box-shadow: none !important;
}

.fix-info-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.fix-info-header h3 {
    font-size: 1.25rem;
    font-weight: 400;
    margin: 0;
    color: #161616;
}

.fix-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.fix-info-item label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.32px;
    color: #525252;
    margin-bottom: 0.5rem;
}

.fix-info-item p {
    font-size: 0.875rem;
    color: #161616;
    margin: 0;
    line-height: 1.5;
    word-break: break-word;
}

/* Readme Tile */
.readme-tile {
    background: #ffffff !important;
    border: 1px solid #e0e0e0 !important;
    padding: 1.5rem !important;
    box-shadow: none !important;
}

/* Readme Section */
.readme-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.readme-header label {
    font-size: 1rem;
    font-weight: 600;
    color: #161616;
    margin: 0;
}

.readme-content {
    background: #f4f4f4;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 1rem;
    font-size: 0.875rem;
    line-height: 1.6;
    max-height: 400px;
    overflow-y: auto;
}

.readme-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 1rem;
    color: #161616;
}

.readme-content h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #161616;
}

.readme-content h5 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: #161616;
}

.readme-content p {
    margin-bottom: 1rem;
}

.readme-content ul {
    margin: 0.5rem 0 1rem 1.5rem;
    padding: 0;
}

.readme-content li {
    margin-bottom: 0.25rem;
}

.readme-content code {
    background: #e0e0e0;
    padding: 0.125rem 0.25rem;
    border-radius: 2px;
    font-family: 'IBM Plex Mono', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', Courier, monospace;
    font-size: 0.75rem;
}

.readme-content strong {
    font-weight: 600;
    color: #161616;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.loading-state p {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #525252;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.empty-state p {
    font-size: 0.875rem;
    color: #525252;
}

/* Scrollbar Styling */
.tree-container::-webkit-scrollbar,
.detail-body::-webkit-scrollbar,
.readme-content::-webkit-scrollbar {
    width: 8px;
}

.tree-container::-webkit-scrollbar-track,
.detail-body::-webkit-scrollbar-track,
.readme-content::-webkit-scrollbar-track {
    background: #f4f4f4;
}

.tree-container::-webkit-scrollbar-thumb,
.detail-body::-webkit-scrollbar-thumb,
.readme-content::-webkit-scrollbar-thumb {
    background: #c6c6c6;
    border-radius: 4px;
}

.tree-container::-webkit-scrollbar-thumb:hover,
.detail-body::-webkit-scrollbar-thumb:hover,
.readme-content::-webkit-scrollbar-thumb:hover {
    background: #8d8d8d;
}

/* Responsive Design */
@media (max-width: 672px) {
    .fix-explorer-container {
        padding: 1rem;
    }
    
    .fix-explorer-header h2 {
        font-size: 1.5rem;
    }
    
    .tree-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .tree-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Print Styles */
@media print {
    .fix-explorer-header,
    .search-section,
    .tree-panel {
        display: none;
    }
    
    .fix-explorer-layout {
        grid-template-columns: 1fr;
    }
    
    .detail-panel {
        border: none;
    }
}

/* Made with Bob */
