/* ============================================
   Presentación de Proyecto — EMA Group
   HINAPSYS | Mejoras Generales 2026
   ============================================ */

:root {
    --primary: #0f2b46;
    --primary-light: #1a4a7a;
    --primary-soft: #2563eb;
    --accent: #10b981;
    --accent-light: #34d399;
    --accent-glow: rgba(16, 185, 129, 0.15);
    --bg: #f8f9fb;
    --bg-sidebar: #0c1e30;
    --bg-card: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --text-muted: #94a3b8;
    --text-sidebar: #8ba4be;
    --text-sidebar-active: #ffffff;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --radius: 10px;
    --radius-lg: 16px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --transition: 0.2s ease;
    --header-h: 56px;
    --sidebar-w: 290px;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

/* ---- Header ---- */
.app-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-h);
    background: linear-gradient(135deg, var(--primary) 0%, #0a1f33 100%);
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 20px;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.brand-icon {
    color: var(--accent-light);
    font-size: 18px;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.brand-sep { opacity: 0.3; font-weight: 300; }
.brand-client { color: var(--accent-light); font-weight: 500; }

.header-progress {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 400px;
}

#progress-label {
    font-size: 12px;
    opacity: 0.7;
    white-space: nowrap;
    font-weight: 500;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.12);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-light) 100%);
    border-radius: 2px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: background var(--transition);
}

.sidebar-toggle:hover { background: rgba(255,255,255,0.1); }

.sidebar-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: #fff;
    border-radius: 1px;
    transition: all var(--transition);
}

/* ---- Layout ---- */
.app-layout {
    display: flex;
    margin-top: var(--header-h);
    min-height: calc(100vh - var(--header-h));
}

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-sidebar);
    position: fixed;
    top: var(--header-h);
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 50;
    padding: 16px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.module-group { margin-bottom: 2px; }

.module-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    color: var(--text-sidebar);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    cursor: pointer;
    user-select: none;
    transition: all var(--transition);
    border-left: 3px solid transparent;
}

.module-header:hover {
    color: #c8ddf0;
    background: rgba(255,255,255,0.03);
}

.module-header .arrow {
    font-size: 10px;
    transition: transform 0.3s ease;
    margin-left: auto;
    opacity: 0.5;
}

.module-header.collapsed .arrow { transform: rotate(-90deg); }

.module-steps { padding: 0; }
.module-steps.hidden { display: none; }

.step-link {
    display: block;
    padding: 8px 20px 8px 36px;
    color: var(--text-sidebar);
    text-decoration: none;
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition);
    border-left: 3px solid transparent;
    position: relative;
}

.step-link:hover {
    background: rgba(255,255,255,0.04);
    color: #dde8f4;
}

.step-link.active {
    background: rgba(16, 185, 129, 0.08);
    color: var(--text-sidebar-active);
    border-left-color: var(--accent-light);
    font-weight: 500;
}

.step-link.completed { color: var(--accent-light); }
.step-link.completed::before {
    content: '✓ ';
    font-size: 11px;
    font-weight: 600;
}

/* ---- Main Content ---- */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    padding: 40px 48px 120px;
    max-width: 860px;
}

.step-content {
    animation: fadeSlideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.step-content h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
    line-height: 1.3;
    letter-spacing: -0.3px;
}

.step-content .step-module-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent);
    background: var(--accent-glow);
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 20px;
}

.step-content h2 {
    font-size: 19px;
    font-weight: 600;
    color: var(--primary);
    margin: 32px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.step-content h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-light);
    margin: 24px 0 8px;
}

.step-content h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
    margin: 16px 0 6px;
}

.step-content p {
    margin-bottom: 14px;
    color: var(--text);
}

.step-content ul, .step-content ol {
    margin: 8px 0 16px 24px;
}

.step-content li { margin-bottom: 6px; }

.step-content strong { color: var(--primary); }
.step-content em { color: var(--text-light); }

.step-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 32px 0;
}

/* Info boxes */
.info-box {
    padding: 16px 20px;
    border-radius: var(--radius);
    margin: 18px 0;
    font-size: 14px;
    line-height: 1.65;
    position: relative;
}

.info-box.note {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    color: #1e3a5f;
}

.info-box.tip {
    background: #ecfdf5;
    border-left: 4px solid var(--accent);
    color: #064e3b;
}

.info-box.warning {
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    color: #78350f;
}

.info-box.important {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    color: #7f1d1d;
}

/* Tables */
.step-content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 14px 0 22px;
    font-size: 14px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.step-content th, .step-content td {
    padding: 11px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.step-content th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--primary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.step-content tr:last-child td { border-bottom: none; }
.step-content tr:hover td { background: #fafbfd; }

/* Flow diagram */
.flow-diagram {
    background: linear-gradient(135deg, #f0f4ff 0%, #f5f3ff 100%);
    border: 1px solid #e0e7ff;
    border-radius: var(--radius);
    padding: 22px;
    text-align: center;
    margin: 18px 0;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
    color: var(--primary);
    line-height: 1.8;
}

/* Architecture diagram */
.architecture-diagram {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 28px 20px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    margin: 20px 0;
}

.node {
    padding: 14px 24px;
    border-radius: var(--radius);
    text-align: center;
    min-width: 140px;
}

.entity-main {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(15, 43, 70, 0.3);
}

.entity-sub {
    background: white;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.node-title {
    display: block;
    font-weight: 700;
    font-size: 14px;
}

.node-desc {
    display: block;
    font-size: 11px;
    opacity: 0.7;
    margin-top: 2px;
}

.diagram-arrows {
    display: flex;
    gap: 40px;
    justify-content: center;
}

.arrow {
    width: 2px;
    height: 24px;
    background: var(--primary-soft);
    position: relative;
}

.arrow::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--primary-soft);
}

.nodes-row {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Module cards */
.module-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin: 16px 0;
}

.mod-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.mod-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.mod-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.mod-card h4 {
    margin: 0 0 6px;
    font-size: 14px;
    color: var(--primary);
}

.mod-card p {
    font-size: 13px;
    color: var(--text-light);
    margin: 0;
    line-height: 1.5;
}

/* Glass panel mockup — Light Mode */
.glass-panel {
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.mockup-panel {
    background: #ffffff;
    box-shadow: 0 2px 16px rgba(0,0,0,0.08), 0 0 0 1px var(--border);
    margin: 20px 0;
}

.mockup-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}

.dots {
    display: flex;
    gap: 6px;
}

.dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e2e8f0;
}

.dots span:first-child { background: #ef4444; }
.dots span:nth-child(2) { background: #f59e0b; }
.dots span:last-child { background: #22c55e; }

.mockup-title {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 500;
}

.mockup-body {
    padding: 20px;
}

.data-grid-mock {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 0;
    font-size: 13px;
    color: var(--text);
}

.dg-header {
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
}

.data-grid-mock > div:not(.dg-header) {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-light);
}

.tag-editable {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    background: #ecfdf5;
    color: #059669;
    font-size: 12px;
    font-weight: 600;
}

.tag-fixed {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    background: #f1f5f9;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
}

/* ---- Step Navigation ---- */
.step-nav {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-w);
    right: 0;
    max-width: 860px;
    display: flex;
    justify-content: space-between;
    padding: 16px 48px 20px;
    background: linear-gradient(transparent 0%, var(--bg) 40%);
    z-index: 10;
}

.btn {
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(15, 43, 70, 0.25);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 4px 16px rgba(15, 43, 70, 0.35);
    transform: translateY(-1px);
}

.btn-secondary {
    background: white;
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.btn-secondary:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .sidebar-toggle { display: flex; }
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,0.3);
    }
    .main-content { margin-left: 0; padding: 32px 24px 120px; }
    .step-nav { left: 0; padding: 16px 24px 20px; }
    .header-progress { display: none; }
    .module-cards { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .main-content { padding: 24px 16px 120px; }
    .step-nav { padding: 12px 16px 16px; }
    .step-content h1 { font-size: 22px; }
    .nodes-row { flex-direction: column; align-items: center; }
}
