/* Estilos especializados para la terminal profesional */

.terminal-container {
    background-color: var(--terminal-bg);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 500px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Barra de título de la terminal */
.terminal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background-color: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.terminal-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 600;
}

.terminal-title i {
    color: #64ffda;
}

.terminal-controls {
    display: flex;
    gap: 8px;
}

.terminal-control-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #e2e8f0;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.terminal-control-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.terminal-control-btn.close {
    color: #f87171;
}

.terminal-control-btn.minimize {
    color: #fbbf24;
}

.terminal-control-btn.maximize {
    color: #34d399;
}

/* Área de historial de comandos */
.terminal-history {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #e2e8f0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.terminal-history::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.terminal-history::-webkit-scrollbar-track {
    background: transparent;
}

.terminal-history::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* Línea de entrada de comandos */
.terminal-input-line {
    display: flex;
    padding: 8px 20px 16px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #e2e8f0;
    background-color: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.terminal-prompt {
    display: flex;
    align-items: center;
    color: #64ffda;
    font-weight: bold;
    margin-right: 8px;
}

.terminal-prompt::before {
    content: "$";
    color: #f59e0b;
    margin-right: 8px;
}

.terminal-input {
    background: transparent;
    border: none;
    color: #e2e8f0;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    flex: 1;
    outline: none;
    caret-color: #64ffda;
}

/* Estilos para el cursor parpadeante */
@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.terminal-cursor {
    display: inline-block;
    width: 8px;
    height: 16px;
    background-color: #64ffda;
    margin-left: 2px;
    animation: blink 1s infinite;
    vertical-align: middle;
}

/* Salida de comandos */
.command-block {
    margin-bottom: 16px;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Estilos específicos para la ayuda del terminal */
.command-output.help-output {
    color: #ffffff;
    line-height: 1.5;
    border-left: 3px solid #64ffda;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 12px 16px;
    margin-top: 8px;
    border-radius: 0 4px 4px 0;
}

.command-output.help-output .categoria {
    color: #64ffda;
    font-weight: bold;
    margin-top: 8px;
    margin-bottom: 4px;
}

.command-input {
    color: #64ffda;
    font-weight: bold;
    margin-bottom: 8px;
}

.command-input::before {
    content: "$ ";
    color: #f59e0b;
}

.command-output {
    padding-left: 8px;
    border-left: 2px solid rgba(100, 255, 218, 0.2);
    margin-bottom: 12px;
    color: #e2e8f0;
}

/* Resaltado de sintaxis */
.text-ip {
    color: #f59e0b; /* naranja */
    font-weight: bold;
}

.text-method {
    color: #60a5fa; /* azul */
    font-weight: bold;
}

.text-date {
    color: #a78bfa; /* púrpura */
}

.text-path {
    color: #34d399; /* verde */
}

.text-status-200 {
    color: #34d399; /* verde */
}

.text-status-300 {
    color: #60a5fa; /* azul */
}

.text-status-400 {
    color: #f59e0b; /* naranja */
}

.text-status-500 {
    color: #f87171; /* rojo */
}

.text-error {
    color: #f87171; /* rojo */
    font-weight: bold;
}

.text-warning {
    color: #f59e0b; /* naranja */
}

.text-success {
    color: #34d399; /* verde */
}

.text-highlight {
    background-color: rgba(245, 158, 11, 0.2);
    padding: 0 2px;
    border-radius: 2px;
    color: #f59e0b;
    font-weight: bold;
}

.text-command {
    color: #60a5fa; /* azul */
    font-weight: bold;
}

.text-variable {
    color: #f472b6; /* rosa */
}

/* Bloque de explicación educativa */
.command-explanation {
    background-color: rgba(100, 255, 218, 0.05);
    border-left: 3px solid #64ffda;
    padding: 12px 16px;
    margin: 12px 0;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    line-height: 1.6;
    color: #e2e8f0;
    border-radius: 0 4px 4px 0;
}

.command-explanation strong {
    color: #64ffda;
    font-weight: 600;
}

.command-explanation .title {
    font-weight: 600;
    color: #64ffda;
    margin-bottom: 8px;
    display: block;
}

/* Ejemplo didáctico */
.command-example {
    background-color: rgba(96, 165, 250, 0.05);
    border-left: 3px solid #60a5fa;
    padding: 12px 16px;
    margin: 12px 0;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #e2e8f0;
    border-radius: 0 4px 4px 0;
}

.command-example .title {
    font-weight: 600;
    color: #60a5fa;
    margin-bottom: 8px;
    display: block;
    font-family: 'Inter', sans-serif;
}

.command-example .example-input {
    color: #60a5fa;
    margin-bottom: 8px;
}

.command-example .example-input::before {
    content: "$ ";
    color: #f59e0b;
}

.command-example .example-output {
    color: #e2e8f0;
    padding-left: 8px;
    border-left: 2px solid rgba(96, 165, 250, 0.2);
}

/* Tips educativos */
.command-tips {
    background-color: rgba(167, 139, 250, 0.05);
    border-left: 3px solid #a78bfa;
    padding: 12px 16px;
    margin: 12px 0;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    line-height: 1.6;
    color: #e2e8f0;
    border-radius: 0 4px 4px 0;
}

.command-tips .title {
    font-weight: 600;
    color: #a78bfa;
    margin-bottom: 8px;
    display: block;
}

/* Ajustes para el modo de seguimiento live */
.follow-mode {
    display: inline-block;
    margin-left: 12px;
    color: #a78bfa;
    font-size: 12px;
    align-self: center;
}

.follow-mode.active {
    color: #34d399;
}

/* Botones de ayuda rápida */
.terminal-quick-commands {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.quick-command-btn {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 12px;
    color: #e2e8f0;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-command-btn:hover {
    background-color: rgba(100, 255, 218, 0.1);
    border-color: rgba(100, 255, 218, 0.2);
    color: #64ffda;
}

/* Estilos para comandos personalizados */
.custom-output-result {
    background-color: rgba(0, 0, 0, 0.3);
    border-left: 3px solid #64ffda;
    padding: 12px 16px;
    margin: 12px 0;
    color: #ffcc66;
    font-weight: 500;
    border-radius: 0 4px 4px 0;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Destacar IPs en resultados personalizados */
.custom-output-result .text-ip {
    color: #3b82f6;
    font-weight: bold;
}

/* Destacar métodos HTTP en resultados personalizados */
.custom-output-result .text-method {
    color: #8b5cf6;
    font-weight: bold;
}

/* Destacar códigos de estado en resultados personalizados */
.custom-output-result .text-status-200 {
    color: #10b981;
    font-weight: bold;
}

.custom-output-result .text-status-400, 
.custom-output-result .text-status-500 {
    color: #ef4444;
    font-weight: bold;
}

/* Sugerencias de autocompletado */
.autocomplete-suggestions {
    position: absolute;
    bottom: 70px;
    left: 20px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    max-width: 80%;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 100;
    display: none;
}

.autocomplete-suggestions.show {
    display: block;
}

.autocomplete-suggestion {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background-color 0.2s;
}

.autocomplete-suggestion:last-child {
    border-bottom: none;
}

.autocomplete-suggestion:hover,
.autocomplete-suggestion.selected {
    background-color: rgba(100, 255, 218, 0.1);
}

.autocomplete-suggestion .command {
    color: #64ffda;
    font-weight: 600;
    margin-right: 8px;
}

.autocomplete-suggestion .description {
    color: var(--muted-text);
    font-size: 12px;
}

/* Estilos para la barra de herramientas inferior */
.terminal-toolbar {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    background-color: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    justify-content: space-between;
}

.terminal-toolbar-left,
.terminal-toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.terminal-status {
    font-size: 12px;
    color: var(--muted-text);
}

.terminal-status.success {
    color: #34d399;
}

.terminal-status.error {
    color: #f87171;
}

.terminal-btn {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 12px;
    color: #e2e8f0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.terminal-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.terminal-btn i {
    font-size: 12px;
}

.terminal-btn.clear {
    color: #f59e0b;
}

.terminal-btn.clear:hover {
    background-color: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.2);
}

.terminal-btn.history {
    color: #60a5fa;
}

.terminal-btn.history:hover {
    background-color: rgba(96, 165, 250, 0.1);
    border-color: rgba(96, 165, 250, 0.2);
}

.terminal-btn.help {
    color: #a78bfa;
}

.terminal-btn.help:hover {
    background-color: rgba(167, 139, 250, 0.1);
    border-color: rgba(167, 139, 250, 0.2);
}

/* Estilos responsivos */
@media (max-width: 768px) {
    .terminal-container {
        height: calc(100vh - 150px);
    }
    
    .terminal-quick-commands {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 12px;
        -webkit-overflow-scrolling: touch;
    }
    
    .quick-command-btn {
        flex: 0 0 auto;
    }
    
    .terminal-toolbar {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .terminal-toolbar-right {
        width: 100%;
        justify-content: space-between;
    }
}