@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;600;700&display=swap');

:root {
    --bg-dark: #050508;
    --cyan: #00f0ff;
    --purple: #bd00ff;
    --yellow: #f0ff00;
    --text-white: #ffffff;
    --text-dim: #8b9bb4;
    --card-bg: rgba(20, 25, 40, 0.7);
    --border-light: rgba(255, 255, 255, 0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Rajdhani', sans-serif; user-select: none; }
body { background-color: var(--bg-dark); color: var(--text-white); height: 100vh; overflow: hidden; position: relative; }

/* --- INPUTS DE DATOS EN VISOR --- */
.data-input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-light);
    color: var(--yellow); 
    font-family: monospace;
    width: 100px; /* Un poco más ancho por defecto */
    text-align: right;
    padding: 2px 5px;
    font-weight: bold;
    outline: none;
    transition: 0.3s;
    font-size: 0.9rem;
}
/* Estilo específico para el área de notas */
textarea.data-input {
    width: 100%;
    height: 80px;
    text-align: left;
    resize: vertical; /* Solo redimensionar alto */
    white-space: pre-wrap;
    margin-top: 5px;
    line-height: 1.2;
}

.data-input:focus {
    border-color: var(--yellow);
    background: rgba(240, 255, 0, 0.1);
    box-shadow: 0 0 5px var(--yellow);
}
.data-input::placeholder { color: var(--text-dim); opacity: 0.3; }
.data-input::-webkit-outer-spin-button, .data-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* --- RESTO DE ESTILOS (Mantenidos) --- */
.glitch-text { position: relative; display: inline-block; color: var(--cyan); z-index: 1; }
.glitch-text::before, .glitch-text::after { content: attr(data-text); position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: #0a0a0f; z-index: -1; opacity: 0.7; }
.glitch-text::before { left: 2px; text-shadow: -2px 0 #ff00c1; clip: rect(44px, 450px, 56px, 0); animation: glitch-anim 3s infinite linear alternate-reverse; }
.glitch-text::after { left: -2px; text-shadow: -2px 0 #00fff9; clip: rect(44px, 450px, 56px, 0); animation: glitch-anim2 3s infinite linear alternate-reverse; }
@keyframes glitch-anim { 0% { clip: rect(31px, 9999px, 94px, 0); } 100% { clip: rect(12px, 9999px, 53px, 0); } }
@keyframes glitch-anim2 { 0% { clip: rect(69px, 9999px, 13px, 0); } 100% { clip: rect(36px, 9999px, 4px, 0); } }

/* BARRA DE PROGRESO */
.modal-progress-container { width: 100%; margin-top: 1.5rem; display: none; flex-direction: column; gap: 5px; }
.modal-progress-track { width: 100%; height: 4px; background: rgba(255, 255, 255, 0.1); position: relative; overflow: hidden; border-radius: 2px; }
.modal-progress-fill { height: 100%; background: var(--cyan); width: 30%; position: absolute; left: 0; box-shadow: 0 0 10px var(--cyan); animation: cyber-load 2s infinite ease-in-out; }
.modal-progress-text { font-size: 0.7rem; color: var(--text-dim); text-align: right; font-family: monospace; }
@keyframes cyber-load { 0% { left: -30%; width: 30%; } 50% { left: 30%; width: 60%; } 100% { left: 100%; width: 30%; } }

#matrixCanvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; opacity: 0.3; pointer-events: none; }
.bg-gradient { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: radial-gradient(circle at 10% 20%, rgba(189, 0, 255, 0.05) 0%, transparent 40%), radial-gradient(circle at 90% 80%, rgba(0, 240, 255, 0.05) 0%, transparent 40%); z-index: 1; pointer-events: none; }

.main-wrapper { position: relative; z-index: 10; width: 90%; max-width: 1200px; height: 100vh; display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; margin: 0 auto; }
.brand-header { padding: 2rem; }
.logo-area { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.logo-icon { width: 64px; height: 64px; color: var(--cyan); filter: drop-shadow(0 0 10px var(--cyan)); } 
.brand-title { font-size: 6rem; line-height: 1; font-weight: 800; letter-spacing: 2px; }
.cyber-aura { color: rgba(255, 255, 255, 0.02); -webkit-text-stroke: 2px var(--cyan); text-shadow: 0 0 20px rgba(0, 240, 255, 0.5); }
.gradient-text { background: linear-gradient(90deg, var(--cyan), var(--purple)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; filter: drop-shadow(0 0 5px rgba(189, 0, 255, 0.5)); }
.brand-subtitle { font-size: 1.5rem; color: var(--text-dim); letter-spacing: 4px; border-bottom: 1px solid var(--border-light); padding-bottom: 0.5rem; display: inline-block; }
.system-status { font-family: monospace; color: var(--cyan); font-size: 0.9rem; opacity: 0.7; margin-top: 1rem; cursor: pointer; }

/* VISOR 3D */
.viewer-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: radial-gradient(circle at center, #1a1a20, #000); z-index: 1000; display: flex; flex-direction: column; }
.viewer-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 1rem 2rem; background: rgba(0, 240, 255, 0.05); border-bottom: 1px solid var(--cyan); z-index: 1001; }
#modelNameDisplay { font-family: monospace; color: var(--cyan); font-size: 1.2rem; font-weight: bold; letter-spacing: 2px; }
.viewer-controls { display: flex; gap: 1rem; }
.viewer-btn { background: transparent; border: 1px solid var(--border-light); color: var(--text-white); padding: 0.5rem 1rem; cursor: pointer; display: flex; align-items: center; gap: 0.5rem; font-weight: bold; transition: 0.2s; }
.viewer-btn:hover { border-color: var(--cyan); color: var(--cyan); box-shadow: 0 0 10px rgba(0, 240, 255, 0.3); }
.viewer-btn.primary { background: var(--cyan); color: black; border-color: var(--cyan); }

/* PANEL DE DATOS 3D REDIMENSIONABLE */
.viewer-data-panel {
    position: absolute; top: 80px; left: 20px; 
    width: 280px; /* Ancho inicial un poco mayor */
    min-width: 250px;
    max-width: 500px;
    min-height: 200px;
    max-height: 80vh;
    background: rgba(0, 0, 0, 0.85); /* Un poco más opaco para leer mejor */
    border: 1px solid var(--cyan);
    padding: 1rem; border-left: 3px solid var(--purple);
    font-family: monospace; z-index: 1002;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.1);
    
    /* PROPIEDADES DE REDIMENSIÓN */
    resize: both; /* Permite estirar en ancho y alto */
    overflow: auto; /* Necesario para que funcione el resize */
}
/* Scrollbar bonita para el panel */
.viewer-data-panel::-webkit-scrollbar { width: 6px; height: 6px; }
.viewer-data-panel::-webkit-scrollbar-thumb { background: var(--cyan); border-radius: 3px; }
.viewer-data-panel::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); }

.data-row { display: flex; justify-content: space-between; margin-bottom: 0.5rem; font-size: 0.9rem; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 2px; align-items: center; }
.data-label { color: var(--text-dim); }
.data-value { color: var(--cyan); font-weight: bold; }
.data-value.warning { color: var(--yellow); }

#canvas3DContainer { flex: 1; width: 100%; height: 100%; overflow: hidden; position: relative; background-image: linear-gradient(rgba(0, 240, 255, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 240, 255, 0.05) 1px, transparent 1px); background-size: 50px 50px; }
.viewer-instructions { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); color: var(--text-dim); font-family: monospace; font-size: 0.8rem; pointer-events: none; }

/* CARDS, AUTH, ETC (Igual) */
.view-section { animation: fadeIn 0.5s ease-out; width: 100%; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1.5rem; }
.identity-card { background: var(--card-bg); border: 1px solid var(--border-light); padding: 2rem 1rem; border-radius: 4px; display: flex; flex-direction: column; align-items: center; cursor: pointer; transition: all 0.3s ease; backdrop-filter: blur(10px); }
.identity-card:hover { border-color: var(--cyan); transform: translateY(-5px); box-shadow: 0 5px 20px rgba(0, 240, 255, 0.2); }
.card-icon-wrapper { width: 50px; height: 50px; background: rgba(255,255,255,0.05); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; color: var(--text-white); }
.identity-card:hover .card-icon-wrapper { background: var(--cyan); color: #000; }
.new-identity { background: transparent; border: 1px dashed var(--text-dim); }
.new-identity:hover { border-color: var(--purple); }

.auth-box { background: var(--card-bg); border: 1px solid var(--border-light); padding: 2.5rem; border-radius: 8px; backdrop-filter: blur(15px); max-width: 400px; margin: 0 auto; border-left: 3px solid var(--purple); }
.auth-header { text-align: center; margin-bottom: 2rem; }
.lock-icon { width: 40px; height: 40px; color: var(--purple); }
.user-display { font-size: 1.5rem; font-weight: 700; margin-top: 0.5rem; }
.cyber-form { display: flex; flex-direction: column; gap: 1rem; }
.input-container { position: relative; }
.input-icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-dim); width: 20px; }
.cyber-form input { width: 100%; background: rgba(0,0,0,0.3); border: 1px solid var(--border-light); padding: 1rem 1rem 1rem 3rem; color: white; outline: none; transition: 0.3s; }
.cyber-form input:focus { border-color: var(--cyan); }
.action-btn { background: linear-gradient(90deg, var(--cyan), #00a8ff); border: none; padding: 1rem; color: #000; font-weight: 700; letter-spacing: 2px; cursor: pointer; text-transform: uppercase; }
.action-btn:hover { filter: brightness(1.1); }
.back-link { background: none; border: none; color: var(--text-dim); cursor: pointer; display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }

.dashboard-wrapper { position: relative; z-index: 20; width: 100%; height: 100vh; display: flex; flex-direction: column; background: transparent; }
.dash-nav { display: flex; justify-content: space-between; align-items: center; padding: 1rem 2rem; border-bottom: 1px solid var(--border-light); background: rgba(0,0,0,0.6); backdrop-filter: blur(5px); }
.dash-logo { display: flex; align-items: center; gap: 0.5rem; font-size: 1.5rem; font-weight: 700; }
.dash-user { display: flex; align-items: center; gap: 1rem; }
.icon-btn { background: none; border: none; color: var(--text-dim); cursor: pointer; }
.icon-btn:hover { color: var(--cyan); }

.dash-toolbar { display: grid; grid-template-columns: 200px 1fr auto; align-items: center; padding: 1rem 2rem; background: rgba(255,255,255,0.02); gap: 2rem; }
.path-display { display: flex; align-items: center; gap: 0.5rem; color: var(--text-dim); font-family: monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toolbar-right-group { display: flex; justify-content: flex-end; align-items: center; gap: 1rem; }
.search-wrapper { position: relative; width: 100%; max-width: 600px; margin: 0 auto; }
.search-container { position: relative; display: flex; align-items: center; width: 100%; }
.search-container i { position: absolute; left: 15px; width: 20px; color: var(--cyan); }
.search-container input { width: 100%; background: rgba(0, 0, 0, 0.6); border: 1px solid var(--border-light); color: var(--cyan); padding: 0.8rem 0.8rem 0.8rem 3rem; font-family: monospace; font-size: 1rem; transition: all 0.3s ease; border-radius: 4px; }
.search-container input:focus { border-color: var(--cyan); box-shadow: 0 0 15px rgba(0, 240, 255, 0.2); outline: none; background: rgba(0, 0, 0, 0.8); }

.local-search-wrapper { position: relative; width: 180px; }
.local-search-wrapper i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; color: var(--purple); }
.local-search-wrapper input { width: 100%; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--border-light); color: white; padding: 0.5rem 0.5rem 0.5rem 2.2rem; font-size: 0.85rem; border-radius: 4px; font-family: monospace; }
.local-search-wrapper input:focus { border-color: var(--purple); outline: none; }

.search-results-dropdown { position: absolute; top: 100%; left: 0; width: 100%; background: #0a0a0f; border: 1px solid var(--cyan); border-top: none; max-height: 400px; overflow-y: auto; z-index: 100; box-shadow: 0 10px 30px rgba(0,0,0,0.8); display: none; }
.search-results-dropdown.active { display: block; }
.search-result-item { padding: 1rem; border-bottom: 1px solid var(--border-light); display: flex; align-items: center; gap: 1rem; cursor: pointer; transition: 0.2s; }
.search-result-item:hover { background: rgba(0, 240, 255, 0.1); }

.action-buttons { display: flex; gap: 0.5rem; }
.tool-btn { background: transparent; border: 1px solid var(--cyan); color: var(--cyan); padding: 0.5rem 1rem; display: flex; align-items: center; gap: 0.5rem; cursor: pointer; font-weight: 600; font-size: 0.8rem; transition: 0.2s; white-space: nowrap; }
.tool-btn:hover { background: rgba(0, 240, 255, 0.1); }
.tool-btn.primary { background: var(--cyan); color: black; }
.tool-btn.primary:hover { background: #fff; }

.file-system-grid { flex: 1; padding: 2rem; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1.5rem; align-content: start; transition: background 0.3s; }
.file-system-grid.drag-over { background: rgba(0, 240, 255, 0.1); border: 2px dashed var(--cyan); }

.file-item { background: var(--card-bg); border: 1px solid var(--border-light); padding: 1rem; border-radius: 4px; display: flex; flex-direction: column; align-items: center; text-align: center; cursor: pointer; transition: all 0.3s ease; backdrop-filter: blur(10px); min-height: 160px; position: relative; }
.file-item:hover { border-color: var(--cyan); transform: translateY(-5px); box-shadow: 0 5px 20px rgba(0, 240, 255, 0.2); }
.file-icon { width: 50px; height: 50px; background: rgba(255,255,255,0.05); border-radius: 4px; display: flex; align-items: center; justify-content: center; margin-bottom: 0.5rem; color: var(--text-white); overflow: hidden; }
.file-item:hover .file-icon { background: var(--cyan); color: #000; }
.folder .file-icon i, .file .file-icon i { width: 24px; height: 24px; }
.file-name { font-size: 0.9rem; word-break: break-word; color: #fff; margin-bottom: 0.2rem; font-weight: 600; }
.file-meta { font-size: 0.7rem; color: var(--text-dim); }

.favorite-badge { position: absolute; top: 5px; right: 5px; color: var(--yellow); filter: drop-shadow(0 0 2px var(--yellow)); animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
@keyframes popIn { from { transform: scale(0); } to { transform: scale(1); } }

#contextMenu { position: absolute; background: #0a0a0f; border: 1px solid var(--cyan); z-index: 5000; display: none; flex-direction: column; min-width: 180px; box-shadow: 0 0 20px rgba(0, 240, 255, 0.3); border-radius: 4px; overflow: hidden; }
.ctx-item { padding: 12px 15px; cursor: pointer; display: flex; align-items: center; gap: 10px; color: var(--text-white); font-size: 0.9rem; transition: 0.2s; border-left: 2px solid transparent; }
.ctx-item:hover { background: rgba(0, 240, 255, 0.15); border-left-color: var(--cyan); color: var(--cyan); }
.ctx-divider { height: 1px; background: var(--border-light); margin: 0; }

.hidden { display: none !important; }
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); display: flex; align-items: center; justify-content: center; z-index: 100; backdrop-filter: blur(5px); }
.modal-box { background: #0a0a0f; border: 1px solid var(--cyan); padding: 2rem; width: 90%; max-width: 400px; text-align: center; box-shadow: 0 0 40px rgba(0, 240, 255, 0.15); }
.modal-header h4 { color: var(--cyan); letter-spacing: 2px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 1rem; margin-bottom: 1rem; }
.modal-input { width: 100%; background: #1a1a20; border: 1px solid var(--border-light); padding: 0.8rem; color: white; margin-top: 1rem; outline: none; font-family: monospace; }
.modal-input:focus { border-color: var(--cyan); box-shadow: 0 0 10px rgba(0, 240, 255, 0.2); }
.modal-actions { margin-top: 1.5rem; display: flex; justify-content: center; gap: 1rem; }
.modal-btn { background: transparent; border: 1px solid var(--cyan); color: var(--cyan); padding: 0.5rem 1.5rem; cursor: pointer; font-weight: bold; transition: 0.2s; }
.modal-btn:hover { background: var(--cyan); color: black; box-shadow: 0 0 15px var(--cyan); }
.modal-btn.secondary { border-color: var(--text-dim); color: var(--text-dim); }
.modal-btn.secondary:hover { background: var(--text-dim); color: black; box-shadow: none; }

@media (max-width: 768px) {
    .dash-toolbar { grid-template-columns: 1fr; gap: 1rem; height: auto; }
    .search-wrapper { order: 2; width: 100%; }
    .path-display { order: 1; justify-content: center; }
    .toolbar-right-group { order: 3; justify-content: center; flex-wrap: wrap; }
    .local-search-wrapper { width: 100%; }
    .main-wrapper { grid-template-columns: 1fr; gap: 2rem; }
}