/* ==================== BASE ==================== */
html, body {
    height: 100vh;
    overflow: hidden;
    margin: 0;
    font-size: 0.9em;
}

html {
    scroll-behavior: smooth;
}

.container-fluid {
    padding: 0;
    height: 100vh;
}

.row {
    margin-right: 0px;
}

.row:after {
    content: "";
    display: table;
    clear: both;
}

/* ==================== LAYOUT PRINCIPAL ==================== */
.column-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.content-title {
    padding: 0px;
    background-color: #333;
    color: #EEE;
    flex-shrink: 0;
}

.content-title > h4 {
    line-height: 50px;
    margin: 0px;
    padding-left: 20px;
}

.content-main {
    flex: 1;
    overflow: auto;
    padding: 20px;
    background-color: #f8f9fa;
}

.menu-show, .content-title {
    display: none;
}

.menu-close {
    display: none;
}

/* ==================== MENÚ LATERAL ==================== */
.column-menu {
    width: 250px;
    background-color: #222;
    box-shadow: 0px 0px 10px rgba(0,0,0,0.2);
    white-space: nowrap;
    z-index: 1500;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

.logo-content {
    flex-shrink: 0;
    text-align: center;
    width: 244px;
    background-color: #222;
}

.directory-list > .d-grid {
    flex-shrink: 0;
}

.wiki-tree-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    width: 250px;
    transition: width 0.3s ease;
}

.wiki-tree-container:hover {
    width: fit-content;
    min-width: 250px;
    max-width: 450px;
    overflow-x: visible;
    position: relative;
    z-index: 2000;
    background-color: #222;
    padding-right: 10px;
}

.directory-list {
    padding: 0px;
    color: #EEE;
    cursor: pointer;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin: 0;
    overflow: visible;
}

.directory-list ul {
    display: none;
    margin-left: 10px;
    padding-left: 10px;
    border-left: 1px dashed #CCC;
}

.directory-list li {
    list-style: none;
    color: #CCC;
    font-weight: normal;
}

.directory-list a {
    color: #CCC;
    text-decoration: none;
    transition: all 0.2s ease;
}

.directory-list a:hover {
    color: #eff99e;
}

.directory-list .folder, .directory-list .folder > a {
    color: #FFF;
    font-weight: bold;
}

.directory-list li:before {
    margin-right: 4px;
    content: "";
    height: 20px;
    vertical-align: middle;
    width: 20px;
    background-repeat: no-repeat;
    display: inline-block;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><path fill='lightgrey' d='M85.714,42.857V87.5c0,1.487-0.521,2.752-1.562,3.794c-1.042,1.041-2.308,1.562-3.795,1.562H19.643 c-1.488,0-2.753-0.521-3.794-1.562c-1.042-1.042-1.562-2.307-1.562-3.794v-75c0-1.487,0.521-2.752,1.562-3.794 c1.041-1.041,2.306-1.562,3.794-1.562H50V37.5c0,1.488,0.521,2.753,1.562,3.795s2.307,1.562,3.795,1.562H85.714z M85.546,35.714 H57.143V7.311c3.05,0.558,5.505,1.767,7.366,3.627l17.41,17.411C83.78,30.209,84.989,32.665,85.546,35.714z' /></svg>");
    background-position: center 2px;
    background-size: 60% auto;
}

.directory-list li.file:before {
    margin-right: 4px;
    content: "";
    height: 20px;
    vertical-align: middle;
    width: 20px;
    background-repeat: no-repeat;
    display: inline-block;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><path fill='lightgrey' d='M85.714,42.857V87.5c0,1.487-0.521,2.752-1.562,3.794c-1.042,1.041-2.308,1.562-3.795,1.562H19.643 c-1.488,0-2.753-0.521-3.794-1.562c-1.042-1.042-1.562-2.307-1.562-3.794v-75c0-1.487,0.521-2.752,1.562-3.794 c1.041-1.041,2.306-1.562,3.794-1.562H50V37.5c0,1.488,0.521,2.753,1.562,3.795s2.307,1.562,3.795,1.562H85.714z M85.546,35.714 H57.143V7.311c3.05,0.558,5.505,1.767,7.366,3.627l17.41,17.411C83.78,30.209,84.989,32.665,85.546,35.714z' /></svg>");
    background-position: center 2px;
    background-size: 60% auto;
}

.directory-list li.folder:before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><path fill='khaki' d='M96.429,37.5v39.286c0,3.423-1.228,6.361-3.684,8.817c-2.455,2.455-5.395,3.683-8.816,3.683H16.071 c-3.423,0-6.362-1.228-8.817-3.683c-2.456-2.456-3.683-5.395-3.683-8.817V23.214c0-3.422,1.228-6.362,3.683-8.817 c2.455-2.456,5.394-3.683,8.817-3.683h17.857c3.422,0,6.362,1.228,8.817,3.683c2.455,2.455,3.683,5.395,3.683,8.817V25h37.5 c3.422,0,6.361,1.228,8.816,3.683C95.201,31.138,96.429,34.078,96.429,37.5z' /></svg>");
    background-position: center top;
    background-size: 75% auto;
}

/* ==================== TABLE OF CONTENTS (TOC) ==================== */
#toc-container {
    position: fixed;
    right: 20px;
    top: 90px;
    width: 290px;
    max-height: calc(100vh - 140px);
    overflow: hidden;
    z-index: 1000;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#toc-container:not(.toc-collapsed) {
    animation: slideInRight 0.3s ease-out;
}

.toc-header {
    color: #666;
    padding: 12px 15px;
    font-weight: 600;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #CCC;
}

.toc-header i {
    margin-right: 8px;
}

#toc-toggle {
    background: transparent;
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    padding: 0;
}

#toc-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

#toc-toggle i {
    margin: 0;
}

.toc-content {
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 200px);
    padding: 8px 0;
}

.toc-content::-webkit-scrollbar {
    width: 5px;
}

.toc-content::-webkit-scrollbar-track {
    background: transparent;
}

.toc-content::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.toc-content::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

.toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.toc-item {
    margin: 0;
    padding: 0;
    border-left: 2px solid transparent;
    transition: border-color 0.2s ease;
}

.toc-item:hover {
    border-left-color: #d75700;
}

.toc-item.active {
    border-left-color: #d75700;
    background: rgba(215, 87, 0, 0.05);
}

.toc-item + .toc-item {
    border-top: 1px solid #f5f5f5;
}

.toc-link {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    color: #555;
    text-decoration: none;
    line-height: 1.4;
    text-wrap: nowrap;
    transition: all 0.2s ease;
    gap: 8px;
}

.toc-link i {
    font-size: 0.9em;
    color: #888;
    flex-shrink: 0;
    width: 16px;
    text-align: center;
}

.toc-link span {
    flex: 1;
}

.toc-link:hover {
    color: #d75700;
    background: rgba(215, 87, 0, 0.05);
    padding-left: 20px;
}

.toc-link:hover i {
    color: #d75700;
}

.toc-link.active {
    color: #d75700;
    font-weight: 600;
    background: rgba(215, 87, 0, 0.08);
}

.toc-link.active i {
    color: #d75700;
}

.toc-empty {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 0.85em;
}

/* ==================== BREADCRUMB ==================== */
.breadcrumb-container {
    background: #ececec;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0px 0px 10px rgba(0,0,0,0.2);
}

.breadcrumb-modern {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #dee2e6 transparent;
}

.breadcrumb-modern::-webkit-scrollbar {
    height: 4px;
}

.breadcrumb-modern::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 4px;
}

.breadcrumb-item-modern {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    color: #495057;
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.breadcrumb-item-modern i {
    font-size: 0.95rem;
    color: #6c757d;
}

.breadcrumb-item-modern.active {
    background: #d75700;
    color: #ffffff;
    font-weight: 600;
    border-color: #d75700;
}

.breadcrumb-item-modern.active i {
    color: #ffffff;
}

.separator {
    color: #adb5bd;
    font-size: 0.7rem;
    margin: 0 0.5rem;
    flex-shrink: 0;
}

/* ==================== SEARCH (BÚSQUEDA) ==================== */
.search-input-container .input-group-text {
    background-color: #f8f9fa;
    border-right: none;
}

.search-input-container .form-control:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.search-results {
    max-height: 400px;
    overflow-y: auto;
}

.search-results::-webkit-scrollbar {
    width: 6px;
}

.search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.search-results::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

.search-result-item {
    padding: 1rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
    cursor: pointer;
    background: #fff;
}

.search-result-item:hover {
    border-color: #ff7b3d;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.15);
}

.search-result-title {
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.search-result-title .badge {
    margin-left: auto;
    font-size: 0.7em;
}

.search-result-excerpt {
    color: #6c757d;
    font-size: 0.9em;
    line-height: 1.4;
}

.search-highlight {
    background-color: #fff3cd;
    border-radius: 3px;
    font-weight: 500;
}

.search-highlight-found {
    background-color: #fff3cd;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.search-highlight-found.highlight-pulse {
    animation: highlightPulse 1.5s ease-in-out 2;
}

.search-filters {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
}

.breadcrumb-path {
    font-size: 0.8em;
    color: #6c757d;
    margin-top: 0.25rem;
}

.breadcrumb-path i {
    margin: 0 0.25rem;
}

/* ==================== WIKI CONTENT ==================== */
.wiki-content {
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-radius: 12px;
    margin: 20px 0;
}

.skill-section {
    border-bottom: 1px solid #e9ecef;
    padding: 2rem 0;
    scroll-margin-top: 100px;
}

.skill-section:last-child {
    border-bottom: none;
}

.code-content {
    overflow: auto; 
    max-height: 350px; 
    border: #CCC solid 1px; 
    tab-size: 4;
    padding: 5px;
}

h1 {
    color: #2c3e50;
    border-bottom: 3px solid #ff7b3d;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

h2 {
    color: #34495e;
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

iframe, img {
    max-width: 100%;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.video-box {
    position: relative;
    height: 300px;
    overflow: hidden;
    max-width: 600px;
    margin: 0 auto;
    background: #000;
    border-radius: 8px;
}

.video-box iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.formula-box {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-left: 4px solid #2196f3;
    padding: 1.5rem;
    margin: 1rem 0;
    border-radius: 6px;
}

.example-box, .example-calc {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 1rem;
    margin: 1rem 0;
}

.class-multipliers {
    background: #d1ecf1;
    border-radius: 6px;
    padding: 1rem;
}

.skill-id {
    color: #6c757d;
    font-size: 0.9em;
    font-weight: normal;
}

.info-alert {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left: 4px solid #2196f3;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
}

.alert-info {
    border-left: 4px solid #17a2b8;
}

/* ==================== NAVIGATION CARDS ==================== */
.navigation-card {
    background: linear-gradient(135deg, #ff7b3d 0%, #ff9500 100%);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(255, 123, 61, 0.3);
}

.navigation-card h5 {
    color: white;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

.nav-item {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 12px 16px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.nav-item:hover::before {
    left: 100%;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.nav-link {
    color: white !important;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1;
}

.nav-link i {
    margin-right: 10px;
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.index-link {
    transition: all 0.3s ease;
    padding: 2px 6px;
    border-radius: 4px;
}

.index-link:hover {
    background-color: rgba(255, 123, 61, 0.1);
    transform: translateX(5px);
}

/* ==================== TABLAS ==================== */
.table {
    cursor: pointer;
}

.config-table, .config-table-2, .config-table-3 {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    min-width: 1000px;
}

.config-table tbody tr:hover,
.config-table-2 tbody tr:hover,
.config-table-3 tbody tr:hover {
    background-color: rgba(255, 123, 61, 0.05);
    transform: scale(1.01);
    transition: all 0.2s ease;
}

.config-table th, .config-table-2 th, .config-table-3 th {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    color: white;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.config-table td:first-child,
.config-table-2 td:first-child,
.config-table-3 td:first-child {
    font-weight: 600;
    color: #495057;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.config-table th:nth-child(1), .config-table td:nth-child(1) {
    width: 35%;
}

.config-table th:nth-child(2), .config-table td:nth-child(2) {
    width: 20%;
    text-align: center;
}

.config-table th:nth-child(3), .config-table td:nth-child(3) {
    width: 45%;
}

.config-table-2 th:nth-child(1), .config-table-2 td:nth-child(1) {
    width: 40%;
}

.config-table-2 th:nth-child(2), .config-table-2 td:nth-child(2) {
    width: 60%;
    text-align: center;
}

/* ==================== BOOTSTRAP OVERRIDES ==================== */
.badge {
    font-size: 11px;
    padding: 6px 10px;
    border-radius: 20px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.selected {
    color: #fbff00 !important;
    font-weight: bold;
    transition: all 0s !important;
}

.modal {
    z-index: 9000;
}

/* ==================== SCROLLBARS ==================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #999;
}

::-webkit-scrollbar-thumb:hover {
    background: #444;
}

/* ==================== LOADER ==================== */
#loadingDiv {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    opacity: 0.95;
    overflow: hidden;
    z-index: 9999;
}

.loader {
    font-size: 10px;
    margin: 150px auto;
    text-indent: -9999em;
    width: 6em;
    height: 6em;
    border-radius: 50%;
    background: #ffffff;
    background: linear-gradient(to right, #ffffff 10%, rgba(255, 255, 255, 0) 42%);
    position: relative;
    animation: load3 1.4s infinite linear;
    transform: translateZ(0);
}

.loader:before {
    width: 50%;
    height: 50%;
    background: #ffffff;
    border-radius: 100% 0 0 0;
    position: absolute;
    top: 0;
    left: 0;
    content: '';
}

.loader:after {
    background: #000;
    width: 75%;
    height: 75%;
    border-radius: 50%;
    content: '';
    margin: auto;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
}

/* ==================== ANIMATIONS ==================== */
@keyframes load3 {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes highlightPulse {
    0%, 100% {
        background-color: #fff3cd;
    }
    50% {
        background-color: #ffc107;
    }
}

/* ==================== SCROLL INDICATOR ==================== */
.scroll-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, #ff7b3d 0%, #ff9500 100%);
    z-index: 9999;
    transition: width 0.1s ease;
}

/* ==================== RESPONSIVE ==================== */
@media (min-width: 1400px) {
    .content-main {
        padding-right: 300px;
    }
}

@media (min-width: 1200px) and (max-width: 1399px) {
    .content-main {
        padding-right: 260px;
    }
}

@media (max-width: 1400px) {
    #toc-container {
        width: 250px;
        right: 10px;
        top: 90px;
    }
}

@media (max-width: 1200px) {
    #toc-container {
        background-color: white;
        position: fixed;
        right: 0;
        top: 0;
        bottom: 0;
        width: 260px;
        max-height: 100vh;
        border-radius: 0;
        border-right: none;
        transform: translateX(0);
        opacity: 1;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    }

    #toc-container.toc-collapsed {
        transform: translateX(100%);
        opacity: 0;
        pointer-events: none;
    }

    #toc-toggle {
        display: flex;
    }

    .toc-header {
        padding: 15px;
    }

    .toc-content {
        max-height: calc(100vh - 60px);
        padding: 12px 0;
    }

    #toc-container::before {
        content: '';
        position: fixed;
        right: 15px;
        top: 70px;
        width: 50px;
        height: 50px;
        background: #d75700;
        border-radius: 50%;
        box-shadow: 0 4px 12px rgba(215, 87, 0, 0.3);
        cursor: pointer;
        display: none;
        align-items: center;
        justify-content: center;
        z-index: 999;
        transition: all 0.3s ease;
    }

    #toc-container.toc-collapsed::before {
        display: flex;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512' fill='white'%3E%3Cpath d='M0 96C0 78.3 14.3 64 32 64H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: center;
        background-size: 20px;
    }

    body::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    body.toc-open::after {
        opacity: 1;
        pointer-events: auto;
    }
}

@media (max-width: 800px) {
    .column-menu {
        position: fixed;
        top: 0;
        left: -250px;
        height: 100vh;
    }

    .column-content {
        width: 100%;
    }

    .content-title {
        display: block;
    }

    .menu-show {
        display: inline-block;
    }

    .menu-close {
        display: block;
    }
}

@media (max-width: 768px) {
    .breadcrumb-container {
        padding: 0.625rem 0.875rem;
    }

    .breadcrumb-text {
        display: none;
    }

    .breadcrumb-item-modern {
        padding: 0.4rem 0.5rem;
        gap: 0;
    }

    .separator {
        margin: 0 0.25rem;
    }

    .nav-grid {
        grid-template-columns: 1fr;
    }

    .navigation-card {
        padding: 20px;
        margin: 15px;
    }
}

@media (max-width: 640px) {
    #toc-container {
        width: 280px;
    }

    img {
        max-width: 100%;
        max-height: 100%;
    }
}

@media (max-width: 480px) {
    #toc-container {
        width: 100%;
        max-width: 300px;
    }
}