/* Catalog Tab Styles */
.catalog-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.status-text {
    color: #666;
    font-style: italic;
}

.catalog-content {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.catalog-table {
    width: 100%;
    border-collapse: collapse;
}

.catalog-table th {
    background: #f8f9fa;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    position: sticky;
    top: 0;
}

.catalog-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #dee2e6;
    vertical-align: top;
}

.catalog-table tr:hover {
    background: #f8f9fa;
}

.device-key {
    font-family: monospace;
    font-weight: bold;
    color: #007bff;
}

.file-list {
    font-size: 0.9rem;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.file-item:last-child {
    border-bottom: none;
}

.file-path {
    font-family: monospace;
    color: #666;
    flex: 1;
    margin-right: 1rem;
}

.file-size {
    color: #888;
    font-size: 0.8rem;
}

.device-type {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: bold;
}

.device-type.master {
    background: #d4edda;
    color: #155724;
}

.device-type.extending {
    background: #fff3cd;
    color: #856404;
}

/* Builder section styles */
.builder-section {
    margin-bottom: 2rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    background: #fafbfc;
}

.builder-section h3 {
    margin: 0 0 1rem 0;
    color: #495057;
    font-size: 1.1rem;
    border-bottom: 2px solid #28a745;
    padding-bottom: 0.5rem;
}

.device-selection {
    margin-bottom: 1rem;
}

.device-selection label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.device-selection select {
    width: 100%;
    max-width: 400px;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    background: white;
}

.device-info {
    background: #e8f5e8;
    border: 1px solid #c3e6c3;
    border-radius: 4px;
    padding: 1rem;
    margin-top: 1rem;
}

.expansion-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.expansion-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.expansion-card:hover {
    border-color: #007bff;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.1);
}

.expansion-card.selected {
    border-color: #28a745;
    background: #f8fff8;
}

.expansion-card input[type="checkbox"] {
    margin-right: 0.5rem;
}

.expansion-card h4 {
    margin: 0 0 0.5rem 0;
    color: #333;
}

.expansion-card p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.preview-section {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1rem;
    min-height: 200px;
}

.build-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.build-actions input {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.device-selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.match-type {
    background: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.device-selection-files {
    margin-top: 0.5rem;
}

.file-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
    font-size: 0.9rem;
    color: #666;
}

.file-path {
    font-family: monospace;
    flex: 1;
    margin-right: 1rem;
}

.file-size {
    color: #888;
}

/* File Disambiguation Dialog */
.file-comparison {
    margin: 1rem 0;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.comparison-table th,
.comparison-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.comparison-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.comparison-table tr:hover {
    background-color: #f8f9fa;
}

.file-path {
    font-family: monospace;
    font-size: 0.9rem;
    color: #666;
}

.file-size {
    font-size: 0.9rem;
    color: #666;
}

.file-modified {
    font-size: 0.9rem;
    color: #666;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

/* Device Details Modal */
.device-details-modal .modal-content {
    max-width: 700px;
    width: 90%;
}

.device-details-view {
    padding: 0;
}

.device-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.device-header h3 {
    margin: 0 0 0.5rem 0;
    color: #212529;
    font-size: 1.5rem;
}

.device-manufacturer {
    margin: 0;
    color: #6c757d;
    font-size: 1rem;
}

.device-metadata {
    margin-bottom: 1.5rem;
}

.metadata-row {
    display: flex;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.metadata-row:last-child {
    border-bottom: none;
}

.metadata-label {
    font-weight: 600;
    color: #495057;
    width: 180px;
    flex-shrink: 0;
}

.metadata-value {
    color: #212529;
    flex: 1;
}

.device-files-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e9ecef;
}

.device-files-section h4 {
    margin: 0 0 1rem 0;
    color: #495057;
    font-size: 1.1rem;
}

.file-list-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 0.5rem;
}

.file-item-detail {
    padding: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
}

.file-item-detail:last-child {
    border-bottom: none;
}

.file-path-detail {
    font-family: monospace;
    color: #212529;
    margin-bottom: 0.25rem;
    word-break: break-all;
}

.file-meta-detail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6c757d;
}

.file-separator {
    color: #adb5bd;
}

.file-size-detail,
.file-date-detail {
    color: #6c757d;
}
