/* ==============================================================================
   IDE ESTILO ECLIPSE DARK - HOJA DE ESTILOS BLINDADA
   ============================================================================== */

:root {
    --bg-main: #1e1e1e;
    --bg-header: #2d2d2d;
    --bg-sidebar: #252526;
    --bg-panel: #181818;
    --border-color: #3f3f46;
    --accent-blue: #0e639c;
    --accent-blue-hover: #1177bb;
    --text-primary: #cccccc;
    --text-muted: #858585;
    --text-highlight: #ffffff;
    --danger-red: #f44747;
    --warning-orange: #cca700;
    --success-green: #89d185;
    --tab-active-bg: #1e1e1e;
    --tab-inactive-bg: #2d2d2d;
}

/* Blindaje anti-selección a nivel global */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==============================================================================
   BARRA SUPERIOR (TOOLBAR TIPO ECLIPSE)
   ============================================================================== */
.ide-toolbar {
    height: 38px;
    background-color: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
}

.ide-toolbar .left-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ide-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #4ec9b0;
    font-size: 13px;
    letter-spacing: 0.5px;
}

.ide-logo span.badge {
    background: #68217a;
    color: #fff;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 3px;
}

.toolbar-btn {
    background: #333333;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s ease;
}

.toolbar-btn:hover {
    background: #444444;
}

.toolbar-btn.btn-run {
    background: #1b5e20;
    border-color: #2e7d32;
    color: #ffffff;
    font-weight: 600;
}

.toolbar-btn.btn-run:hover {
    background: #2e7d32;
}

.toolbar-btn.btn-stop {
    background: #b71c1c;
    border-color: #c62828;
    color: #ffffff;
}

.toolbar-btn.btn-stop:hover {
    background: #c62828;
}

.student-info-badge {
    font-size: 12px;
    background: #264f78;
    padding: 4px 10px;
    border-radius: 4px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.network-isolated-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #ff8585;
    background: rgba(244, 71, 71, 0.15);
    border: 1px solid rgba(244, 71, 71, 0.4);
    padding: 3px 8px;
    border-radius: 3px;
}

.network-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #f44747;
    box-shadow: 0 0 6px #f44747;
}

/* ==============================================================================
   CONTENEDOR PRINCIPAL DEL IDE (SPLIT VIEW)
   ============================================================================== */
.ide-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ide-top-workarea {
    flex: 6.5;
    display: flex;
    overflow: hidden;
    border-bottom: 1px solid var(--border-color);
}

/* PANEL 1: EXPLORADOR DE PAQUETES (ECLIPSE PACKAGE EXPLORER) */
.package-explorer-panel {
    width: 220px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.panel-title-bar {
    height: 30px;
    background: #2a2d2e;
    color: #bbbbbb;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    border-bottom: 1px solid var(--border-color);
}

/* MENÚ DESPLEGABLE ESTILO ECLIPSE */
.eclipse-dropdown-container {
    position: relative;
    display: inline-block;
}

.btn-new-eclipse {
    padding: 2px 7px !important;
    font-size: 11px !important;
    background: #37373d !important;
    border: 1px solid #4f4f56 !important;
    color: #ffffff !important;
    font-weight: 600;
}

.btn-new-eclipse:hover {
    background: #46464d !important;
}

.eclipse-dropdown-menu {
    display: none;
    position: absolute;
    top: 26px;
    left: 0;
    min-width: 175px;
    background-color: #252526;
    border: 1px solid #454545;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
    border-radius: 3px;
    z-index: 1000;
    padding: 4px 0;
}

.eclipse-dropdown-menu.show {
    display: block;
}

.eclipse-dropdown-menu .menu-item {
    padding: 5px 12px;
    font-size: 12px;
    color: #cccccc;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    text-transform: none;
    font-weight: normal;
}

.eclipse-dropdown-menu .menu-item:hover {
    background-color: #094771;
    color: #ffffff;
}

.menu-divider {
    height: 1px;
    background-color: #3e3e42;
    margin: 4px 0;
}

/* ICONOS DE ECLIPSE (C+, I+, E+, R+, @+, etc.) */
.eclipse-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 11px;
    font-weight: bold;
    border-radius: 50%;
    line-height: 1;
}

.icon-file { font-size: 12px; border-radius: 0; }
.icon-folder { font-size: 12px; border-radius: 0; }

.icon-annotation {
    color: #2b70af;
    background: #dbeefb;
    border: 1px solid #2b70af;
    font-size: 10px;
}

.icon-class {
    color: #1b5e20;
    background: #c8e6c9;
    border: 1px solid #2e7d32;
    font-size: 10px;
}

.icon-enum {
    color: #bf360c;
    background: #ffccbc;
    border: 1px solid #d84315;
    font-size: 10px;
}

.icon-interface {
    color: #4a148c;
    background: #e1bee7;
    border: 1px solid #6a1b9a;
    font-size: 10px;
}

.icon-package {
    color: #e65100;
    font-size: 11px;
    border-radius: 0;
}

.icon-record {
    color: #f57f17;
    background: #fff9c4;
    border: 1px solid #fbc02d;
    font-size: 10px;
}

/* WIZARD MODAL DIALOG */
.eclipse-wizard-dialog {
    width: 520px !important;
}

.wizard-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.wizard-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    background: #c8e6c9;
    color: #1b5e20;
    border: 2px solid #2e7d32;
}

.wizard-header h2 {
    font-size: 16px;
    color: #ffffff;
    margin: 0 0 4px 0;
}

.wizard-header p {
    font-size: 11px;
    color: #999999;
    margin: 0;
}

.wizard-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

.file-tree {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    font-size: 12px;
}

.file-node {
    padding: 3px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #cccccc;
    white-space: nowrap;
}

.file-node:hover {
    background: #2a2d2e;
}

.file-node.active {
    background: #37373d;
    color: #ffffff;
}

.file-node.folder {
    font-weight: 600;
    color: #dcb67a;
}

/* PANEL 2: EDITOR MONACO */
.editor-container-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-main);
    overflow: hidden;
}

.editor-tabs-bar {
    height: 32px;
    background: var(--tab-inactive-bg);
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.editor-tab {
    height: 100%;
    padding: 0 14px;
    background: var(--tab-inactive-bg);
    color: var(--text-muted);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-right: 1px solid var(--border-color);
    cursor: pointer;
}

.editor-tab.active {
    background: var(--tab-active-bg);
    color: var(--text-highlight);
    border-top: 2px solid var(--accent-blue);
}

#monaco-editor {
    flex: 1;
    width: 100%;
    height: 100%;
}

/* Permitir selección de texto dentro del editor Monaco exclusivamente */
#monaco-editor, #monaco-editor * {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    user-select: text !important;
}

/* PANEL 3: PANEL LATERAL DE MANUALES */
.manuals-panel {
    width: 380px;
    background-color: var(--bg-sidebar);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.manuals-frame {
    flex: 1;
    border: none;
    width: 100%;
    height: 100%;
    pointer-events: auto;
}

/* ==============================================================================
   PANEL INFERIOR: CONSOLA & CLIENTE HTTP (POSTMAN EMBEBIDO)
   ============================================================================== */
.ide-bottom-panel {
    flex: 3.5;
    background: var(--bg-panel);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bottom-tabs-header {
    height: 30px;
    background: #252526;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding: 0 8px;
    gap: 4px;
}

.bottom-tab-btn {
    background: transparent;
    border: none;
    color: #888888;
    padding: 5px 12px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: 3px 3px 0 0;
}

.bottom-tab-btn.active {
    color: #ffffff;
    background: var(--bg-panel);
    border-bottom: 2px solid var(--accent-blue);
}

.bottom-tab-content {
    flex: 1;
    display: none;
    overflow: hidden;
}

.bottom-tab-content.active {
    display: flex;
}

/* TERMINAL / CONSOLA LOGS */
.terminal-view {
    flex: 1;
    background: #121212;
    padding: 10px;
    font-family: "Consolas", "Courier New", monospace;
    font-size: 12px;
    line-height: 1.4;
    overflow-y: auto;
    color: #cccccc;
    white-space: pre-wrap;
}

/* CLIENTE HTTP / POSTMAN SIMPLIFICADO */
.postman-view {
    flex: 1;
    display: flex;
    padding: 10px;
    gap: 12px;
    overflow: hidden;
}

.postman-left-col {
    flex: 1.2;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.postman-right-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #1e1e1e;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.postman-request-bar {
    display: flex;
    gap: 6px;
}

.method-select {
    background: #2d2d2d;
    color: #4ec9b0;
    border: 1px solid var(--border-color);
    padding: 6px 10px;
    border-radius: 3px;
    font-weight: 700;
    font-size: 12px;
}

.url-input {
    flex: 1;
    background: #2d2d2d;
    color: #ffffff;
    border: 1px solid var(--border-color);
    padding: 6px 10px;
    border-radius: 3px;
    font-family: "Consolas", monospace;
    font-size: 12px;
    -webkit-user-select: text;
    user-select: text;
}

.btn-send-http {
    background: #0e639c;
    color: #ffffff;
    border: none;
    padding: 6px 16px;
    border-radius: 3px;
    font-weight: 600;
    cursor: pointer;
}

.btn-send-http:hover {
    background: #1177bb;
}

.postman-body-textarea {
    flex: 1;
    background: #141414;
    color: #ce9178;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 8px;
    font-family: "Consolas", monospace;
    font-size: 12px;
    resize: none;
    -webkit-user-select: text;
    user-select: text;
}

.response-header-bar {
    background: #252526;
    padding: 6px 10px;
    font-size: 11px;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.response-status-badge {
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 700;
}

.response-body-pre {
    flex: 1;
    padding: 8px;
    margin: 0;
    overflow: auto;
    font-family: "Consolas", monospace;
    font-size: 12px;
    color: #9cdcfe;
    -webkit-user-select: text;
    user-select: text;
}

/* ==============================================================================
   MODAL DE INICIO DE SESIÓN DEL ALUMNO
   ============================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-dialog {
    background: #252526;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    width: 440px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
}

.modal-dialog h2 {
    font-size: 18px;
    color: #569cd6;
    margin-bottom: 12px;
}

.modal-dialog p {
    font-size: 12px;
    color: #aaaaaa;
    margin-bottom: 20px;
    line-height: 1.4;
}

.modal-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.modal-form-group label {
    font-size: 12px;
    color: #cccccc;
}

.modal-form-group input {
    background: #1e1e1e;
    border: 1px solid var(--border-color);
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    -webkit-user-select: text;
    user-select: text;
}

.modal-btn-start {
    width: 100%;
    background: #0e639c;
    border: none;
    color: #ffffff;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
}

/* ==============================================================================
   AVISO DE INFRACCIÓN ANTI-CHEAT (OVERLAY DISPARADOR)
   ============================================================================== */
.cheat-alert-banner {
    display: none;
    position: fixed;
    top: 45px;
    right: 20px;
    background: #b71c1c;
    color: #ffffff;
    padding: 12px 18px;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    font-size: 13px;
    font-weight: 600;
    z-index: 10000;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}
