@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

/* ============================================================
   Variables CSS — Específicas de Whitepaper
   ============================================================ */
:root {
    --bg-sidebar: #0c0c12;
    --bg-content: #09090f;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --bg-callout: rgba(0, 230, 118, 0.05);
    --border-active: rgba(0, 230, 118, 0.5);
    --sidebar-width: 248px;
    --toc-width: 200px;
    --header-height: 56px;
}

html {
    scroll-behavior: smooth;
}

a {
    color: var(--accent-turquoise);
    text-decoration: none;
    transition: opacity 0.2s;
}

a:hover {
    opacity: 0.8;
}

/* --- Adaptación de Nav Header para Whitepaper --- */
.nav-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    padding: 0 24px;
    gap: 24px;
}

.wp-header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.wp-header-logo img {
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 0 6px rgba(255, 170, 0, 0.5));
}

.wp-header-logo span {
    font-size: 1.1rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff, #ffe082);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.wp-header-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.wp-header-tab {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-gray);
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    border: none;
    background: transparent;
    text-decoration: none;
}

.wp-header-tab:hover,
.wp-header-tab.active {
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.06);
}

.wp-header-tab.active {
    border-bottom: 2px solid var(--accent-green);
    border-radius: 8px 8px 0 0;
}

.wp-header-right {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: auto;
}

.wp-back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-gray);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.wp-back-btn:hover {
    color: var(--text-white);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
    opacity: 1;
}

.wp-roadmap-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 10px;
    border: 1px solid rgba(0, 230, 118, 0.3);
    background: rgba(0, 230, 118, 0.05);
    color: var(--accent-green);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.wp-roadmap-btn:hover {
    color: var(--accent-green);
    border-color: rgba(0, 230, 118, 0.6);
    background: rgba(0, 230, 118, 0.1);
    box-shadow: 0 0 12px rgba(0, 230, 118, 0.15);
    opacity: 1;
}

.wp-social-link {
    color: var(--text-gray);
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.wp-social-link:hover {
    color: var(--text-white);
    opacity: 1;
}

.wp-hamburger {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-gray);
    padding: 6px;
}

/* ============================================================
   Layout Principal: Sidebar + Contenido + TOC
   ============================================================ */
.wp-layout {
    display: flex;
    padding-top: var(--header-height);
    min-height: 100vh;
}

/* --- Sidebar Izquierda --- */
.wp-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px 0 40px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
    z-index: 50;
    transition: transform 0.3s ease;
}

.wp-sidebar::-webkit-scrollbar {
    width: 4px;
}

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

.wp-sidebar-section {
    margin-bottom: 8px;
}

.wp-sidebar-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px;
    cursor: pointer;
    user-select: none;
}

.wp-sidebar-section-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
}

.wp-sidebar-section-icon {
    color: var(--text-muted);
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.wp-sidebar-section.open .wp-sidebar-section-icon {
    transform: rotate(180deg);
}

.wp-sidebar-items {
    overflow: hidden;
    transition: max-height 0.25s ease;
}

.wp-sidebar-item {
    display: block;
    padding: 7px 20px 7px 24px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-gray);
    text-decoration: none;
    transition: color 0.15s, background 0.15s;
    border-left: 2px solid transparent;
    margin: 1px 0;
}

.wp-sidebar-item:hover {
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.04);
    opacity: 1;
}

.wp-sidebar-item.active {
    color: var(--accent-green);
    border-left-color: var(--accent-green);
    background: rgba(0, 230, 118, 0.05);
}

/* --- Contenido Central --- */
.wp-content {
    margin-left: var(--sidebar-width);
    margin-right: var(--toc-width);
    min-height: calc(100vh - var(--header-height));
    padding: 48px 64px;
    max-width: 900px;
}

.wp-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
}

.wp-page-title {
    font-size: 2.4rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    background: linear-gradient(to bottom, #ffffff 60%, #cfd8dc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.15;
}

.wp-actions-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-gray);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s;
}

.wp-actions-btn:hover {
    color: var(--text-white);
    border-color: rgba(255, 255, 255, 0.2);
    opacity: 1;
}

.wp-intro {
    font-size: 1.05rem;
    color: var(--text-gray);
    line-height: 1.75;
    margin-bottom: 20px;
}

.wp-intro strong,
.wp-intro b {
    color: var(--text-white);
    font-weight: 700;
}

.wp-callout {
    background: var(--bg-callout);
    border-left: 3px solid var(--accent-green);
    border-radius: 0 10px 10px 0;
    padding: 16px 20px;
    margin-bottom: 40px;
    font-size: 0.95rem;
    color: var(--text-gray);
    line-height: 1.6;
}

.wp-callout a {
    color: var(--accent-green);
    font-weight: 600;
}

/* --- Secciones --- */
.wp-section {
    margin-bottom: 56px;
    scroll-margin-top: 80px;
}

.wp-section-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.wp-section-title {
    font-size: 1.7rem;
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--text-white);
    scroll-margin-top: 80px;
}

.wp-section-body {
    font-size: 0.97rem;
    color: var(--text-gray);
    line-height: 1.75;
    margin-bottom: 20px;
}

.wp-section-body strong,
.wp-section-body b {
    color: var(--text-white);
    font-weight: 700;
}

.wp-section-body ul {
    margin: 12px 0 12px 20px;
}

.wp-section-body li {
    margin-bottom: 6px;
}

.wp-section-body code {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 1px 7px;
    font-size: 0.88em;
    color: var(--accent-blue);
    font-family: 'Courier New', monospace;
}

/* --- Tarjetas de Conceptos --- */
.wp-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    margin-top: 20px;
}

.wp-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
    position: relative;
    overflow: hidden;
}

.wp-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-green), var(--accent-blue));
    opacity: 0;
    transition: opacity 0.2s;
}

.wp-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(0, 230, 118, 0.2);
    transform: translateY(-2px);
    opacity: 1;
}

.wp-card:hover::before {
    opacity: 1;
}

.wp-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.wp-card-icon {
    font-size: 1.4rem;
}

.wp-card-arrow {
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: color 0.2s, transform 0.2s;
}

.wp-card:hover .wp-card-arrow {
    color: var(--accent-green);
    transform: translate(3px, -3px);
}

.wp-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-white);
}

.wp-card-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.45;
}

/* --- Tabla de datos --- */
.wp-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.9rem;
}

.wp-table th {
    text-align: left;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 700;
}

.wp-table td {
    padding: 11px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-gray);
    vertical-align: top;
}

.wp-table tr:last-child td {
    border-bottom: none;
}

.wp-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.wp-table td strong {
    color: var(--text-white);
    font-weight: 600;
}

/* --- Badge --- */
.wp-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.4px;
}

.wp-badge.green {
    background: rgba(0, 230, 118, 0.12);
    color: var(--accent-green);
    border: 1px solid rgba(0, 230, 118, 0.25);
}

.wp-badge.blue {
    background: rgba(0, 176, 255, 0.12);
    color: var(--accent-blue);
    border: 1px solid rgba(0, 176, 255, 0.25);
}

.wp-badge.yellow {
    background: rgba(255, 224, 130, 0.12);
    color: var(--accent-yellow);
    border: 1px solid rgba(255, 224, 130, 0.25);
}

/* --- Dirección del contrato --- */
.wp-contract-box {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 16px 0;
}

.wp-contract-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 700;
    margin-bottom: 4px;
}

.wp-contract-addr {
    font-family: 'Courier New', monospace;
    font-size: 0.88rem;
    color: var(--text-white);
    word-break: break-all;
}

.wp-copy-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 7px 12px;
    cursor: pointer;
    color: var(--text-gray);
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s;
    flex-shrink: 0;
}

.wp-copy-btn:hover {
    color: var(--text-white);
    border-color: rgba(255, 255, 255, 0.2);
}

/* --- Separador --- */
.wp-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 40px 0;
}

/* --- Footer --- */
.wp-footer {
    margin-top: 60px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.82rem;
    text-align: center;
}

/* ============================================================
   TOC — Tabla de Contenidos Derecha
   ============================================================ */
.wp-toc {
    position: fixed;
    top: calc(var(--header-height) + 32px);
    right: 24px;
    width: calc(var(--toc-width) - 24px);
    max-height: calc(100vh - var(--header-height) - 64px);
    overflow-y: auto;
    scrollbar-width: none;
}

.wp-toc::-webkit-scrollbar {
    display: none;
}

.wp-toc-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.wp-toc-item {
    display: block;
    padding: 4px 0 4px 12px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    border-left: 2px solid rgba(255, 255, 255, 0.06);
    transition: color 0.15s, border-color 0.15s;
    line-height: 1.4;
    margin-bottom: 2px;
}

.wp-toc-item:hover {
    color: var(--text-gray);
    opacity: 1;
}

.wp-toc-item.active {
    color: var(--accent-green);
    border-left-color: var(--accent-green);
}

/* ============================================================
   Diagrama de Ciclo de Vida (CSS Art)
   ============================================================ */
.wp-lifecycle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin: 24px 0;
    flex-wrap: wrap;
}

.wp-lifecycle-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.wp-lifecycle-node {
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.wp-lifecycle-node.pending {
    background: rgba(255, 224, 130, 0.1);
    border: 1px solid rgba(255, 224, 130, 0.3);
    color: var(--accent-yellow);
}

.wp-lifecycle-node.active {
    background: rgba(0, 230, 118, 0.1);
    border: 1px solid rgba(0, 230, 118, 0.3);
    color: var(--accent-green);
}

.wp-lifecycle-node.resting {
    background: rgba(0, 176, 255, 0.1);
    border: 1px solid rgba(0, 176, 255, 0.3);
    color: var(--accent-blue);
}

.wp-lifecycle-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
    max-width: 100px;
}

.wp-lifecycle-arrow {
    color: var(--text-muted);
    font-size: 1.2rem;
    margin: 0 8px;
    margin-bottom: 18px;
}

/* ============================================================
   Responsive — Móvil y Tablet
   ============================================================ */
@media (max-width: 1200px) {
    .wp-toc {
        display: none;
    }

    .wp-content {
        margin-right: 0;
    }
}

@media (max-width: 900px) {
    .wp-sidebar {
        transform: translateX(-100%);
    }

    .wp-sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
    }

    .wp-content {
        margin-left: 0;
        padding: 32px 24px;
    }

    .wp-hamburger {
        display: flex;
    }

    .wp-header-tabs {
        display: none;
    }

    .wp-page-title {
        font-size: 1.8rem;
    }

    .wp-cards-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .wp-content {
        padding: 24px 16px;
    }

    .wp-page-header {
        flex-direction: column;
        gap: 16px;
    }

    .wp-contract-box {
        flex-direction: column;
        align-items: flex-start;
    }

    .wp-lifecycle {
        flex-direction: column;
    }

    .wp-lifecycle-arrow {
        transform: rotate(90deg);
        margin: 4px 0;
    }
}