/* ===========================================
   BIM CHECKER - IDS PARSER STYLES
   Styles specific to IDS Parser & Visualizer
   =========================================== */

/* Upload Section */
.upload-section {
    background: #f8f9fa;
    padding: 40px;
    border-bottom: 2px solid #e9ecef;
}

.file-upload {
    border: 3px dashed #667eea;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-upload:hover {
    border-color: #764ba2;
    background: #f8f9ff;
}

.file-upload.dragover {
    border-color: #764ba2;
    background: #f8f9ff;
}

.file-upload-icon {
    font-size: 4em;
    color: #667eea;
    margin-bottom: 20px;
}

.file-upload h3 {
    font-size: 1.2em;
    color: #495057;
    margin-bottom: 10px;
}

.file-upload p {
    color: #6c757d;
    font-size: 1em;
}

.file-input {
    display: none;
}

.sample-button {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 1rem;
    font-size: 1em;
    transition: all 0.3s ease;
    font-weight: 600;
}

.sample-button:hover {
    background: #5568d3;
}

/* Visualization Section */
.visualization-section {
    padding: 40px;
    background: white;
    display: none;
}

.ids-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    border: 2px solid #e9ecef;
}

.ids-info h3 {
    margin-top: 0;
    color: #4a5568;
}

.ids-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.info-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #e9ecef;
}

.info-label {
    font-size: 0.875rem;
    color: #718096;
    margin-bottom: 0.25rem;
}

.info-value {
    font-weight: 600;
    color: #2d3748;
}

/* Specifications */
.specifications-container {
    margin-top: 2rem;
}

.specification-card {
    background: white;
    border: 2px solid #667eea;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.specification-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.specification-card.collapsed {
    padding-bottom: 0;
}

.specification-card.collapsed .spec-content {
    display: none;
}

.specification-card.collapsed .spec-header {
    margin-bottom: 1.5rem;
}

.spec-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s;
}

.spec-header:hover {
    color: #667eea;
}

.spec-header h4 {
    margin: 0;
    color: #667eea;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.spec-badge {
    background: #667eea;
    color: white;
    font-size: 0.85em;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
}

.spec-content {
    display: grid;
    gap: 1.5rem;
}

/* Facets */
.facet-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border: 2px solid #e9ecef;
}

.facet-header {
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.facet-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: white;
}

.applicability-icon {
    background: #48bb78;
}

.requirements-icon {
    background: #ed8936;
}

.facet-item {
    background: white;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
    border: 2px solid #e9ecef;
}

.facet-item:last-child {
    margin-bottom: 0;
}

.facet-type {
    font-size: 0.875rem;
    color: #667eea;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.facet-details {
    font-size: 0.875rem;
    color: #4a5568;
}

.facet-value {
    font-family: 'Courier New', monospace;
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 4px;
    color: #495057;
    font-weight: 600;
}

/* Regex Pattern */
.regex-pattern {
    font-family: 'Courier New', monospace;
    background: #fef5e7;
    border: 1px solid #f39c12;
    padding: 0.5rem;
    border-radius: 4px;
    display: block;
    margin-top: 0.5rem;
    color: #d35400;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.regex-label {
    font-size: 0.75rem;
    color: #f39c12;
    font-weight: 600;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.regex-help {
    position: relative;
    display: inline-block;
    margin-left: 0.5rem;
    cursor: help;
}

.regex-help-icon {
    background: #3498db;
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
}

.regex-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #2c3e50;
    color: white;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    width: 300px;
    display: none;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    margin-bottom: 5px;
}

.regex-help:hover .regex-tooltip {
    display: block;
}

.regex-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #2c3e50;
}

.regex-tooltip table {
    width: 100%;
    font-family: 'Courier New', monospace;
}

.regex-tooltip td {
    padding: 2px 4px;
    border-bottom: 1px solid #34495e;
}

.regex-tooltip td:first-child {
    color: #3498db;
    font-weight: bold;
}

.restriction-list {
    margin-top: 0.5rem;
    padding-left: 1.5rem;
}

.restriction-list li {
    color: #4a5568;
    margin-bottom: 0.25rem;
}

/* Tree View */
.tree-view {
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
    border: 2px solid #e9ecef;
}

.tree-node {
    line-height: 1.8;
    cursor: pointer;
    user-select: none;
}

.tree-node:hover > .tree-label {
    color: #667eea;
}

.tree-node.collapsed > .tree-children {
    display: none;
}

.tree-children {
    margin-left: 1.5rem;
}

.tree-root {
    font-weight: bold;
    color: #667eea;
}

.tree-label {
    color: #2d3748;
}

.tree-value {
    color: #48bb78;
}

.tree-bracket {
    color: #a0aec0;
}

.tree-expand {
    display: inline-block;
    width: 12px;
    text-align: center;
    color: #718096;
    font-weight: normal;
}

.expand-icon {
    display: inline-block;
    width: 1rem;
    transition: transform 0.3s;
    cursor: pointer;
}

.specification-card.collapsed .expand-icon {
    transform: rotate(0deg);
}

.specification-card:not(.collapsed) .expand-icon {
    transform: rotate(90deg);
}

/* Responsive */
@media (max-width: 768px) {
    .ids-info-grid {
        grid-template-columns: 1fr;
    }
}
