/**
 * Archive Viewer Styles
 * Corporate, functional design for BAR/WAR/EAR/JAR/ZIP analysis
 */

.archive-viewer {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #f8f9fa;
}

.archive-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: white;
    border-bottom: 1px solid #dee2e6;
    gap: 1rem;
    flex-wrap: wrap;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toolbar-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #f8f9fa;
    border: 1px solid #ced4da;
    border-radius: 6px;
}

.toolbar-search input {
    border: none;
    background: transparent;
    outline: none;
    width: 200px;
}

/* Empty State */
.archive-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 3rem;
    text-align: center;
}

.archive-empty-state h3 {
    margin: 1rem 0 0.5rem 0;
    color: #495057;
}

.archive-empty-state p {
    color: #6c757d;
    margin-bottom: 1.5rem;
}

/* Archive Content Layout */
.archive-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.archive-sidebar {
    display: flex;
    flex-direction: column;
    background: white;
    border-right: 1px solid #dee2e6;
    overflow-y: auto;
}

.archive-info {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.archive-info h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--primary);
}

.archive-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
}

.stat-label {
    font-weight: 600;
    color: #6c757d;
}

.stat-value {
    color: #212529;
}

.archive-metadata {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.archive-metadata h4 {
    font-size: 0.875rem;
    color: #495057;
    margin-bottom: 0.5rem;
}

.archive-metadata ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.archive-metadata li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    padding: 0.25rem 0;
    color: #495057;
}

.archive-metadata i {
    width: 16px;
    color: var(--primary);
}

/* Tree View */
.archive-tree {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

.archive-tree h4 {
    font-size: 0.875rem;
    color: #495057;
    margin-bottom: 0.75rem;
}

.tree-node {
    margin-bottom: 0.25rem;
    user-select: none;
}

.tree-node-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s ease;
}

.tree-node-header:hover {
    background: #f0f4f8;
}

.tree-node-file {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s ease;
}

.tree-node-file:hover {
    background: #f0f4f8;
}

.tree-expand-icon {
    width: 12px;
    color: #6c757d;
    font-size: 0.75rem;
}

.tree-node-name {
    flex: 1;
    font-size: 0.875rem;
    color: #495057;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tree-node-size {
    font-size: 0.75rem;
    color: #adb5bd;
}

.tree-node.search-match .tree-node-name {
    background: #fff3cd;
    font-weight: 600;
}

/* Main Content Area */
.archive-main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.no-file-selected {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: #6c757d;
}

/* File Viewer */
.file-viewer {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.file-viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: white;
    border-bottom: 1px solid #dee2e6;
}

.file-viewer-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1rem;
    color: #212529;
}

.file-viewer-content {
    flex: 1;
    overflow: auto;
    background: white;
    padding: 1rem;
}

.file-viewer-content pre {
    margin: 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

.file-viewer-content code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #6c757d;
}

.loading i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.binary-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
    color: #6c757d;
}

/* Flow Diagram */
.flow-diagram-container {
    padding: 1rem;
}

.flow-diagram-container h4 {
    margin-bottom: 1rem;
    color: var(--primary);
}

.mermaid-diagram {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 2rem;
    margin-bottom: 1rem;
    overflow-x: auto;
}

.flow-stats {
    display: flex;
    gap: 2rem;
    padding: 1rem;
    background: #e9ecef;
    border-radius: 6px;
    font-size: 0.875rem;
}

.flow-stats strong {
    color: var(--primary);
}

/* Buttons */
.btn-primary {
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(26, 58, 82, 0.3);
}

.btn-secondary {
    padding: 0.5rem 1rem;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* Dependency Graph */
.dependency-graph-container {
    padding: 1rem;
}

.dep-stats {
    display: flex;
    gap: 2rem;
    padding: 1rem;
    background: #e9ecef;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

/* Comparison Dialog */
.comparison-dialog {
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.form-group {
    margin: 1.5rem 0;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #495057;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 1rem;
}

.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Comparison Result */
.comparison-result {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.comparison-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: white;
    border-radius: 6px;
    border: 2px solid #dee2e6;
}

.summary-item.added {
    border-color: #28a745;
}

.summary-item.removed {
    border-color: #dc3545;
}

.summary-item.modified {
    border-color: #ffc107;
}

.summary-item.unchanged {
    border-color: #6c757d;
}

.summary-item i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.summary-item.added i {
    color: #28a745;
}

.summary-item.removed i {
    color: #dc3545;
}

.summary-item.modified i {
    color: #ffc107;
}

.summary-item.unchanged i {
    color: #6c757d;
}

.critical-changes {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
}

.critical-changes h5 {
    color: #856404;
    margin-bottom: 0.75rem;
}

.critical-changes ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.critical-change-item {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border-left: 3px solid #ffc107;
    background: white;
    border-radius: 4px;
}

.critical-change-item.critical {
    border-left-color: #dc3545;
    background: #f8d7da;
}

.comparison-report {
    background: white;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 768px) {
    .archive-content {
        grid-template-columns: 1fr;
    }

    .archive-sidebar {
        max-height: 300px;
    }

    .comparison-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}