/* MetalSoftWeb - Manual de usuario */

body {
    font-size: 0.95rem;
}

/* Sidebar lateral fijo */
.sidebar-doc {
    min-height: calc(100vh - 56px);
    border-right: 1px solid var(--bs-border-color);
    overflow-y: auto;
    max-height: calc(100vh - 56px);
    position: sticky;
    top: 56px;
}

.sidebar-doc .nav-link {
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.sidebar-doc .nav-link:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}

.sidebar-doc .nav-link.active {
    background: var(--bs-primary);
    color: #fff !important;
}

.sidebar-doc .nav-link.active::before {
    content: "\F285";
    font-family: 'bootstrap-icons';
    margin-right: 0.5em;
    font-size: 0.75em;
}

/* Contenido principal */
main h1 {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

main h2 {
    margin-top: 2rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--bs-border-color);
    font-size: 1.5rem;
}

main h2:first-of-type {
    border-top: none;
}

main p, main li {
    line-height: 1.6;
}

/* Capturas de pantalla */
figure.figure {
    margin: 1.5rem 0;
}

figure.figure img {
    max-width: 100%;
    border: 1px solid var(--bs-border-color);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

figure.figure figcaption {
    color: var(--bs-secondary-color);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    text-align: center;
}

/* Placeholder para capturas pendientes */
.screenshot-placeholder {
    border: 2px dashed var(--bs-border-color);
    border-radius: 6px;
    padding: 3rem;
    text-align: center;
    color: var(--bs-secondary-color);
    background: rgba(255,255,255,0.02);
}

/* Bloques de codigo */
pre {
    background: #1a1a1a;
    border: 1px solid var(--bs-border-color);
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
}

code {
    color: #f8a978;
    background: rgba(255,255,255,0.05);
    padding: 0.1em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
}

pre code {
    background: transparent;
    padding: 0;
    color: #e8e8e8;
}

/* Tablas */
main table {
    width: 100%;
    margin: 1rem 0;
}

main table th {
    background: rgba(255,255,255,0.05);
}

/* Resaltado de seccion ancla cuando navegas con # */
:target {
    scroll-margin-top: 70px;
    animation: highlight 2s ease-out;
}

@keyframes highlight {
    from { background: rgba(255,193,7,0.2); }
    to { background: transparent; }
}

/* Buscador */
#docs-search {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
    color: #fff;
}

#docs-search::placeholder {
    color: rgba(255,255,255,0.5);
}

/* Resultados de busqueda */
.search-results {
    position: absolute;
    top: 100%;
    right: 0;
    width: 400px;
    max-height: 70vh;
    overflow-y: auto;
    background: var(--bs-dark);
    border: 1px solid var(--bs-border-color);
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 1050;
    display: none;
}

.search-results.show {
    display: block;
}

.search-results .result-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--bs-border-color);
    cursor: pointer;
    color: var(--bs-light);
    text-decoration: none;
    display: block;
}

.search-results .result-item:hover {
    background: rgba(255,255,255,0.05);
}

.search-results .result-item .result-area {
    color: var(--bs-secondary-color);
    font-size: 0.75rem;
    text-transform: uppercase;
}

.search-results .empty {
    padding: 1rem;
    color: var(--bs-secondary-color);
    text-align: center;
}

/* Mejoras de UX */
.breadcrumb {
    background: transparent;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
}

.breadcrumb-item a {
    color: var(--bs-info);
    text-decoration: none;
}

/* =========================================================================
   PORTADA (index.html con clase .home-page)
   ========================================================================= */

.home-page {
    background: #0d1117;
}

/* HERO */
.home-hero {
    position: relative;
    overflow: hidden;
    padding: 5rem 0 4rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.home-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 30%, rgba(91,143,249,0.18), transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 70%, rgba(196,109,255,0.12), transparent 60%),
        linear-gradient(180deg, #0d1117 0%, #11151c 100%);
    z-index: 0;
}

.home-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(91,143,249,0.12);
    color: #8ab4ff;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(138,180,255,0.25);
}

.home-hero-title {
    font-size: clamp(2rem, 4.5vw, 3.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 1.25rem;
    background: linear-gradient(135deg, #fff 0%, #c5d0e0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.home-hero-lead {
    font-size: 1.15rem;
    color: #b8c2d0;
    max-width: 640px;
    line-height: 1.55;
    margin-bottom: 2rem;
}

.home-hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.home-hero-cta .btn {
    padding: 0.65rem 1.4rem;
    font-weight: 500;
    border-radius: 8px;
}

.home-hero-cta .btn-primary {
    background: linear-gradient(135deg, #4a8df0, #3b6fc0);
    border: none;
    box-shadow: 0 6px 20px rgba(74,141,240,0.35);
}

.home-hero-cta .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(74,141,240,0.5);
}

.home-hero-stats {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    color: #99a3b3;
    font-size: 0.9rem;
}

.home-hero-stats div {
    display: flex;
    flex-direction: column;
}

.home-hero-stats strong {
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
}

.home-hero-stats span {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c7787;
    margin-top: 0.25rem;
}

.home-hero-stats .sep {
    width: 1px;
    height: 32px;
    background: rgba(255,255,255,0.1);
}

.home-hero-art {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.home-hero-art i {
    font-size: 12rem;
    background: linear-gradient(135deg, #4a8df0, #c46dff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    opacity: 0.9;
    filter: drop-shadow(0 0 30px rgba(74,141,240,0.4));
}

/* QUICK START */
.home-quick-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    color: #d8dee9;
    text-decoration: none;
    transition: all 0.2s ease;
    height: 100%;
}

.home-quick-card:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(74,141,240,0.5);
    color: #fff;
    transform: translateY(-2px);
}

.home-quick-card .num {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a8df0, #6f5af0);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.home-quick-card div {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.home-quick-card strong {
    font-size: 0.95rem;
}

.home-quick-card small {
    color: #8893a3;
    font-size: 0.78rem;
}

/* AREAS FUNCIONALES */
.home-area-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: linear-gradient(180deg, #161b24 0%, #11151c 100%);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    padding: 1.5rem;
    color: #d8dee9;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.home-area-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--area-color, #4a8df0);
    opacity: 0.7;
    transition: opacity 0.25s ease;
}

.home-area-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255,255,255,0.15);
    box-shadow: 0 12px 32px rgba(0,0,0,0.4),
                0 0 0 1px var(--area-color, #4a8df0);
}

.home-area-card:hover::before { opacity: 1; }

.home-area-head {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
    color: inherit;
    margin-bottom: 1rem;
}

.home-area-head:hover { color: #fff; }
.home-area-head:hover .home-area-title { color: var(--area-color, #4a8df0); }

.home-area-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 10px;
    background: var(--area-bg, rgba(74,141,240,0.15));
    color: var(--area-color, #4a8df0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.home-area-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
    color: #fff;
    transition: color 0.2s ease;
}

.home-area-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.7;
}

.home-area-list li {
    color: #a8b3c4;
}

.home-area-list a {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.home-area-list a:hover {
    color: #fff;
}

.home-area-list .bi-chevron-right {
    font-size: 0.65rem;
    opacity: 0.5;
}

.home-area-list .more-link a {
    color: #6c7787;
    font-style: italic;
    font-size: 0.8rem;
}

/* Tints por area */
.home-area-blue   { --area-color: #5b8ff9; --area-bg: rgba(91,143,249,0.15); }
.home-area-cyan   { --area-color: #4dd0e1; --area-bg: rgba(77,208,225,0.15); }
.home-area-purple { --area-color: #b388ff; --area-bg: rgba(179,136,255,0.15); }
.home-area-indigo { --area-color: #7c83fd; --area-bg: rgba(124,131,253,0.15); }
.home-area-green  { --area-color: #66bb6a; --area-bg: rgba(102,187,106,0.15); }
.home-area-teal   { --area-color: #4db6ac; --area-bg: rgba(77,182,172,0.15); }
.home-area-orange { --area-color: #ffa726; --area-bg: rgba(255,167,38,0.15); }
.home-area-pink   { --area-color: #ec407a; --area-bg: rgba(236,64,122,0.15); }
.home-area-yellow { --area-color: #ffca28; --area-bg: rgba(255,202,40,0.15); }
.home-area-red    { --area-color: #ef5350; --area-bg: rgba(239,83,80,0.15); }
.home-area-rose   { --area-color: #f06292; --area-bg: rgba(240,98,146,0.15); }
.home-area-amber  { --area-color: #ffb74d; --area-bg: rgba(255,183,77,0.15); }
.home-area-slate  { --area-color: #90a4ae; --area-bg: rgba(144,164,174,0.15); }

/* DESTACADOS */
.home-feature-card {
    display: flex;
    gap: 1.25rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(255,193,7,0.06), rgba(255,255,255,0.02));
    border: 1px solid rgba(255,193,7,0.2);
    border-radius: 12px;
    color: #d8dee9;
    text-decoration: none;
    height: 100%;
    transition: all 0.2s ease;
}

.home-feature-card:hover {
    border-color: rgba(255,193,7,0.5);
    background: linear-gradient(135deg, rgba(255,193,7,0.1), rgba(255,255,255,0.03));
    color: #fff;
    transform: translateY(-2px);
}

.home-feature-badge {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: linear-gradient(135deg, #ffc107, #ff9800);
    color: #1a1d23;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow: 0 4px 12px rgba(255,193,7,0.3);
}

.home-feature-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 0.4rem 0;
    color: #fff;
}

.home-feature-card p {
    font-size: 0.85rem;
    color: #a8b3c4;
    margin: 0;
    line-height: 1.5;
}

/* FOOTER */
.home-footer {
    margin-top: 3rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    background: #0a0e14;
}

/* =========================================================================
   PAGINAS DE SECCION (body.section-page)
   Hereda los tonos por area (home-area-blue, home-area-orange...)
   ========================================================================= */

body.section-page {
    background: #0d1117;
    color: #c9d1d9;
}

/* Sidebar refinado */
body.section-page .sidebar-doc {
    background: #0a0e14 !important;
    border-right: 1px solid rgba(255,255,255,0.06);
    padding-top: 1.25rem !important;
}

body.section-page .sidebar-doc .nav-link {
    color: #a8b3c4 !important;
    font-size: 0.85rem;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    transition: all 0.15s ease;
}

body.section-page .sidebar-doc .nav-link:hover {
    background: rgba(255,255,255,0.04);
    color: #fff !important;
}

body.section-page .sidebar-doc .nav-link.active {
    background: var(--area-bg, rgba(74,141,240,0.15));
    color: var(--area-color, #4a8df0) !important;
    font-weight: 600;
}

body.section-page .sidebar-doc .nav-link.active::before {
    content: '';
    font-family: inherit;
    margin: 0;
}

body.section-page .sidebar-doc span.text-uppercase {
    color: #6c7787 !important;
    font-size: 0.7rem !important;
    letter-spacing: 0.08em;
    padding-left: 0.6rem;
}

/* Breadcrumb */
body.section-page .breadcrumb {
    font-size: 0.85rem;
}

body.section-page .breadcrumb-item {
    color: #6c7787;
}

body.section-page .breadcrumb-item a {
    color: var(--area-color, #4a8df0);
}

body.section-page .breadcrumb-item.active {
    color: #c9d1d9;
}

/* Eyebrow chip por area */
.section-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--area-bg, rgba(74,141,240,0.12));
    color: var(--area-color, #4a8df0);
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid var(--area-color, rgba(74,141,240,0.3));
    border-color: color-mix(in srgb, var(--area-color, #4a8df0) 30%, transparent);
    margin-bottom: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.section-eyebrow i { font-size: 0.85rem; }

/* H1 con gradiente */
body.section-page main h1 {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 0.85rem;
    background: linear-gradient(135deg, #fff 0%, #c5d0e0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

body.section-page main p.lead {
    font-size: 1.1rem;
    color: #b8c2d0 !important;
    line-height: 1.55;
    max-width: 820px;
}

/* HR del header del articulo: degradado fino con tono de area */
body.section-page main h1 ~ hr {
    border: 0;
    height: 1px;
    background: linear-gradient(90deg,
        var(--area-color, #4a8df0) 0%,
        rgba(255,255,255,0.06) 30%,
        rgba(255,255,255,0.06) 100%);
    opacity: 1;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

/* H2 con barra lateral coloreada */
body.section-page main h2 {
    position: relative;
    padding: 0.1rem 0 0.1rem 1rem;
    margin-top: 2.5rem;
    border-top: none;
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.01em;
}

body.section-page main h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.25rem;
    bottom: 0.25rem;
    width: 3px;
    background: var(--area-color, #4a8df0);
    border-radius: 2px;
}

body.section-page main h2:first-of-type {
    margin-top: 1.5rem;
}

body.section-page main h3 {
    color: #e6edf3;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

/* Code inline */
body.section-page code {
    background: rgba(110, 118, 129, 0.18);
    color: #ffa657;
    padding: 0.12em 0.4em;
    border-radius: 4px;
    font-size: 0.88em;
}

body.section-page pre code {
    background: transparent;
    color: #e8e8e8;
    padding: 0;
}

body.section-page pre {
    background: #0a0e14;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 1rem;
}

/* Alertas con un toque mas moderno */
body.section-page .alert {
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
}

body.section-page .alert-warning {
    border-left: 3px solid #ffc107;
    background: linear-gradient(90deg, rgba(255,193,7,0.08), rgba(255,255,255,0.01));
    color: #fce8b8;
}

body.section-page .alert-warning i.bi-exclamation-triangle-fill {
    color: #ffc107;
}

body.section-page .alert-info {
    border-left: 3px solid #4a8df0;
    background: linear-gradient(90deg, rgba(74,141,240,0.08), rgba(255,255,255,0.01));
    color: #cfe2ff;
}

body.section-page .alert-info i.bi-lightbulb-fill,
body.section-page .alert-info i.bi-info-circle-fill {
    color: #6db1ff;
}

/* Cards y tablas */
body.section-page .card.bg-dark {
    background: linear-gradient(180deg, #161b24 0%, #11151c 100%) !important;
    border-color: rgba(255,255,255,0.07) !important;
}

body.section-page main table {
    border-color: rgba(255,255,255,0.08);
}

body.section-page main table th {
    background: rgba(255,255,255,0.04);
    color: #e6edf3;
    border-color: rgba(255,255,255,0.08);
}

body.section-page main td {
    border-color: rgba(255,255,255,0.06);
}

/* Listas */
body.section-page main li {
    color: #c9d1d9;
    margin-bottom: 0.25rem;
}

body.section-page main strong { color: #fff; }
body.section-page main em { color: #b8c2d0; }

/* Enlaces (excepto los que ya tienen estilo propio) */
body.section-page main a:not(.btn):not(.help-link) {
    color: var(--area-color, #4a8df0);
    text-decoration: none;
    border-bottom: 1px dotted color-mix(in srgb, var(--area-color, #4a8df0) 40%, transparent);
    transition: border-color 0.15s ease;
}

body.section-page main a:not(.btn):not(.help-link):hover {
    border-bottom-color: var(--area-color, #4a8df0);
}

/* Captura placeholder mas elegante */
body.section-page .screenshot-placeholder {
    border: 1px dashed rgba(255,255,255,0.15);
    border-radius: 10px;
    padding: 3.5rem 2rem;
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    color: #6c7787;
}

body.section-page figure.figure img {
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

body.section-page figure.figure figcaption {
    color: #8893a3;
    font-style: italic;
    font-size: 0.85rem;
    padding-top: 0.5rem;
}

/* Footer del articulo */
body.section-page main hr.mt-5 {
    border: 0;
    height: 1px;
    background: rgba(255,255,255,0.06);
    margin-top: 3rem !important;
    margin-bottom: 1rem;
}

body.section-page main p.text-secondary.small:last-child {
    color: #6c7787 !important;
    font-size: 0.8rem;
}
