/**
 * YooToc Frontend Styles
 */

/* Desktop TOC Container */
.yootoc-container {
    margin: 30px 0;
    padding: 20px;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.95);
}

.yootoc-title {
    margin-bottom: 15px !important;
    font-size: 1.25rem;
    font-weight: 500;
}

/* TOC List */
.yootoc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.yootoc-list ul {
    list-style: none;
    padding-left: 20px;
    margin: 5px 0;
}

.yootoc-list li {
    margin: 5px 0;
    position: relative;
}

/* Numbered list option */
.yootoc-numbered .yootoc-list {
    counter-reset: toc-counter;
}

.yootoc-numbered .yootoc-list > li {
    counter-increment: toc-counter;
}

.yootoc-numbered .yootoc-list > li::before {
    content: counter(toc-counter) ". ";
    font-weight: 500;
    margin-right: 5px;
}

/* Links */
.yootoc-list a {
    text-decoration: none;
    display: inline-block;
    padding: 3px 0;
    transition: color 0.2s ease;
}

.yootoc-list a:hover {
    text-decoration: underline;
}

/* Active link */
.yootoc-list a.active {
    font-weight: 600;
}

/* Heading level indentation */
.yootoc-list .toc-h2 {
    font-weight: 500;
}

.yootoc-list .toc-h3 {
    padding-left: 20px;
    font-size: 0.95em;
}

.yootoc-list .toc-h4 {
    padding-left: 40px;
    font-size: 0.9em;
}

/* Mobile TOC Container */
.yootoc-mobile-container {
    display: none;
    position: fixed;
    top: 80px;
    left: 15px;
    right: 15px;
    border-radius: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
}

.yootoc-mobile-container.show {
    opacity: 1;
    visibility: visible;
}

/* TOC Header - Always visible */
.yootoc-mobile-container .toc-header {
    padding: 12px 15px;
    cursor: pointer;
    border-radius: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.yootoc-mobile-container .toc-title {
    font-weight: 500;
    font-size: 1rem;
}

.yootoc-mobile-container .toc-toggle-icon {
    transition: transform 0.3s ease;
}

.yootoc-mobile-container.open .toc-toggle-icon {
    transform: rotate(180deg);
}

/* TOC Body - Hidden by default */
.yootoc-mobile-container .toc-body {
    display: none;
    padding: 15px;
    max-height: 60vh;
    overflow-y: auto;
    border-radius: 0 0 15px 15px;
}

.yootoc-mobile-container.open .toc-body {
    display: block;
}

/* Mobile TOC Links */
.yootoc-mobile-container a {
    display: block;
    padding: 8px 0;
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.yootoc-mobile-container a:last-child {
    border-bottom: none;
}

.yootoc-mobile-container a:hover {
    text-decoration: underline;
}

/* Mobile heading levels */
.yootoc-mobile-container .toc-h3 {
    padding-left: 15px;
    font-size: 0.95em;
}

.yootoc-mobile-container .toc-h4 {
    padding-left: 30px;
    font-size: 0.9em;
}

/* Responsive styles */
@media (max-width: 959px) {
    .yootoc-desktop {
        display: none !important;
    }
    
    .yootoc-mobile-container {
        display: block;
    }
    
    .yootoc-container {
        display: none !important;
    }
}

/* Smooth scroll behavior */
html.yootoc-scrolling {
    scroll-behavior: auto !important;
}

/* Loading state */
.yootoc-loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Empty state */
.yootoc-empty {
    display: none;
}

/* UIkit Integration */
.uk-light .yootoc-container {
    background-color: rgba(0, 0, 0, 0.8);
}

.uk-light .yootoc-list a {
    color: rgba(255, 255, 255, 0.8);
}

.uk-light .yootoc-list a:hover {
    color: #fff;
}

/* Print styles */
@media print {
    .yootoc-mobile-container {
        display: none !important;
    }
}