* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'consolas', 'monaco', monospace;
    background: #1a1a2e;
    color: #eee;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #16213e;
    border-radius: 10px;
}

header h1 {
    color: #0f4c75;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.upload-section {
    background: #16213e;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.upload-section input[type="file"] {
    background: #0f4c75;
    color: #eee;
    padding: 10px;
    border: none;
    border-radius: 5px;
    margin-right: 10px;
    width: 300px;
}

.upload-section button {
    background: #3282b8;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.upload-section button:hover {
    background: #0f4c75;
}

.file-types {
    margin-top: 15px;
}

.file-types label {
    margin-right: 20px;
    cursor: pointer;
}

.analysis-controls {
    text-align: center;
    margin-bottom: 30px;
}

.analysis-controls button {
    background: #3282b8;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin: 0 10px;
    font-weight: bold;
}

.results-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    margin-bottom: 30px;
}

.files-panel, .analysis-panel {
    background: #16213e;
    padding: 20px;
    border-radius: 10px;
    min-height: 300px;
}

.code-viewer {
    background: #16213e;
    padding: 20px;
    border-radius: 10px;
}

#code-display {
    background: #0f1419;
    padding: 15px;
    border-radius: 5px;
    min-height: 200px;
    overflow-x: auto;
    font-family: 'courier new', monospace;
}

.file-item {
    background: #0f4c75;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 5px;
    cursor: pointer;
}

.file-item:hover {
    background: #3282b8;
}

.error {
    color: #ff6b6b;
    background: #2d1b1b;
    padding: 5px;
    border-radius: 3px;
}

.warning {
    color: #ffd93d;
    background: #2d2a1b;
    padding: 5px;
    border-radius: 3px;
}

.success {
    color: #6bcf7f;
    background: #1b2d1b;
    padding: 5px;
    border-radius: 3px;
}

.function-list {
    margin: 10px 0;
}

.function-item {
    background: #0f4c75;
    padding: 5px 10px;
    margin: 5px 0;
    border-radius: 3px;
    font-size: 0.9em;
}

.dependency-graph {
    margin: 15px 0;
}

.dependency-item {
    padding: 5px;
    margin: 5px 0;
    background: #2d1b2d;
    border-radius: 3px;
}

/* Estilos para funciones avanzadas */
.advanced-controls {
    margin: 15px 0;
    text-align: center;
}

.advanced-controls button {
    background: #0f4c75;
    color: white;
    padding: 10px 18px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin: 5px;
    font-weight: bold;
}

.advanced-controls button:hover {
    background: #3282b8;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 15px 0;
}

.stat-item {
    text-align: center;
    background: #0f4c75;
    padding: 12px;
    border-radius: 5px;
}

.stat-value {
    display: block;
    font-size: 1.8em;
    font-weight: bold;
    color: #3282b8;
}

.stat-label {
    font-size: 0.85em;
    color: #ccc;
    text-transform: uppercase;
}

.complexity-item, .security-issue {
    margin: 8px 0;
    padding: 10px;
    border-radius: 5px;
    border-left: 4px solid;
}

.complexity-item.error, .security-issue.error {
    border-left-color: #ff6b6b;
}

.complexity-item.warning, .security-issue.warning {
    border-left-color: #ffd93d;
}

.complexity-item.success, .security-issue.success {
    border-left-color: #6bcf7f;
}

.project-mapping {
    background: #0f4c75;
    padding: 15px;
    margin: 15px 0;
    border-radius: 8px;
    border-left: 5px solid #3282b8;
}

.project-info {
    margin: 10px 0;
    font-size: 0.9em;
}

.project-files ul, .node-deps ul {
    margin: 8px 0;
    padding-left: 20px;
}

.dependency-tree {
    margin: 15px 0 15px 20px;
}

.tree-node {
    margin: 12px 0;
    padding: 8px;
    background: rgba(15, 76, 117, 0.3);
    border-radius: 5px;
}

.node-file {
    font-weight: bold;
    color: #3282b8;
    margin-bottom: 5px;
}

.node-deps {
    margin-left: 15px;
}

.dep-node {
    padding: 3px 8px;
    margin: 3px 0;
    background: #0f4c75;
    border-radius: 3px;
    font-size: 0.85em;
}

.architecture-graph {
    border: 1px solid #3282b8;
    margin: 20px 0;
    padding: 20px;
    border-radius: 10px;
    background: rgba(50, 130, 184, 0.1);
}

.entry-point {
    background: #3282b8;
    color: white;
    padding: 12px;
    border-radius: 6px;
    text-align: center;
    font-weight: bold;
    margin-bottom: 15px;
}

.suggestion {
    padding: 12px;
    margin: 10px 0;
    border-radius: 5px;
    border-left: 4px solid;
}

.file-metrics {
    background: #16213e;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

/* Estilos para visor de código mejorado */
.viewer-controls {
    background: #0f4c75;
    padding: 15px;
    border-radius: 8px 8px 0 0;
    border-bottom: 2px solid #3282b8;
}

.viewer-buttons {
    margin-bottom: 10px;
}

.viewer-buttons button {
    background: #3282b8;
    color: white;
    border: none;
    padding: 8px 12px;
    margin: 2px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
}

.viewer-buttons button:hover {
    background: #0f4c75;
}

.file-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
    color: #ccc;
    margin-top: 10px;
}

.search-box {
    margin-top: 10px;
    padding: 10px;
    background: rgba(50, 130, 184, 0.2);
    border-radius: 5px;
}

.search-box input {
    background: #1a1a2e;
    border: 1px solid #3282b8;
    color: #eee;
    padding: 5px 10px;
    border-radius: 3px;
    margin-right: 10px;
    width: 200px;
}

.code-container {
    display: flex;
    background: #0f1419;
    border-radius: 0 0 8px 8px;
    overflow: auto;
    max-height: 500px;
}

.line-numbers {
    background: #1a1a2e;
    padding: 15px 10px;
    border-right: 1px solid #3282b8;
    user-select: none;
    min-width: 50px;
}

.line-number {
    color: #666;
    font-family: 'courier new', monospace;
    font-size: 0.85em;
    line-height: 1.4;
    cursor: pointer;
    padding: 1px 5px;
    border-radius: 2px;
}

.line-number:hover {
    background: #3282b8;
    color: white;
}

.code-content {
    flex: 1;
    padding: 15px;
    overflow-x: auto;
}

.code-content pre {
    margin: 0;
    font-family: 'courier new', monospace;
    font-size: 0.9em;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.code-editor {
    width: 100%;
    height: 400px;
    background: #1a1a2e;
    color: #eee;
    border: 1px solid #3282b8;
    padding: 15px;
    font-family: 'courier new', monospace;
    font-size: 0.9em;
    line-height: 1.4;
    resize: vertical;
    border-radius: 5px;
}

/* Syntax highlighting */
.keyword { color: #569cd6; font-weight: bold; }
.string { color: #ce9178; }
.comment { color: #6a9955; font-style: italic; }
.variable { color: #9cdcfe; }
.php-tag { color: #569cd6; font-weight: bold; }

.search-highlight {
    background: #ffd93d;
    color: #000;
    padding: 1px 2px;
    border-radius: 2px;
}

.execution-result {
    margin-top: 20px;
    padding: 15px;
    background: #16213e;
    border-radius: 5px;
    border-left: 4px solid #3282b8;
}

.console-log {
    color: #6bcf7f;
    font-family: monospace;
    margin: 5px 0;
}

.console-error {
    color: #ff6b6b;
    font-family: monospace;
    margin: 5px 0;
}

.console-alert {
    color: #ffd93d;
    font-family: monospace;
    margin: 5px 0;
}

/* Pantalla completa */
.code-viewer.fullscreen {
    background: #1a1a2e;
    padding: 20px;
}

.code-viewer.fullscreen .code-container {
    max-height: calc(100vh - 200px);
}

@media (max-width: 768px) {
    .results-container {
        grid-template-columns: 1fr;
    }
    
    .upload-section input[type="file"] {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .advanced-controls button {
        width: 100%;
        margin: 5px 0;
    }
    
    .viewer-buttons button {
        display: block;
        width: 100%;
        margin: 5px 0;
    }
    
    .file-info {
        flex-direction: column;
        gap: 5px;
    }
    
    .search-box input {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .code-container {
        flex-direction: column;
    }
    
    .line-numbers {
        border-right: none;
        border-bottom: 1px solid #3282b8;
        display: flex;
        overflow-x: auto;
        min-width: auto;
    }
    
    .line-number {
        margin-right: 10px;
    }
}
