/* ============================================
   Table of Contents Widget - Base Styles
   ============================================ */

/* Disable ALL animations and transitions */
.unlockafe-toc,
.unlockafe-toc * {
    transition: none !important;
    animation: none !important;
    -webkit-transition: none !important;
    -moz-transition: none !important;
    -ms-transition: none !important;
    -o-transition: none !important;
    -webkit-animation: none !important;
    -moz-animation: none !important;
    -ms-animation: none !important;
    -o-animation: none !important;
}

/* Disable ALL hover animations */
.unlockafe-toc:hover,
.unlockafe-toc *:hover {
    transform: none !important;
    transition: none !important;
    animation: none !important;
}

.unlockafe-toc {
    position: relative;
    width: 100%;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
}

.unlockafe-toc.sticky {
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    z-index: 100;
}

.unlockafe-toc .toc-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.unlockafe-toc .toc-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.unlockafe-toc .toc-toggle {
    cursor: pointer;
    transition: none !important;
    color: #6b7280;
    font-size: 0.875rem;
}

.unlockafe-toc.collapsible.collapsed .toc-toggle {
    transform: rotate(-90deg);
    transition: none !important;
}

.unlockafe-toc.collapsible.collapsed .toc-content {
    display: none;
}

.unlockafe-toc .toc-content {
    padding: 1rem 1.5rem;
    max-height: 600px;
    overflow-y: auto;
}

.unlockafe-toc.sticky .toc-content {
    max-height: calc(100vh - 120px);
}

.unlockafe-toc .toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.unlockafe-toc .toc-item {
    margin: 0;
    padding: 0;
    list-style: none;
}

.unlockafe-toc .toc-item a {
    display: block;
    text-decoration: none;
    color: #4b5563;
    position: relative;
    padding: 0.5rem 0;
    line-height: 1.5;
    transition: none !important;
    animation: none !important;
}

.unlockafe-toc .toc-item a:hover {
    color: #667eea;
    transform: none !important;
    transition: none !important;
    animation: none !important;
}

.unlockafe-toc .toc-item.active > a {
    color: #667eea;
    font-weight: 600;
}

.unlockafe-toc .toc-item.active > a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background-color: #667eea;
    border-radius: 0 2px 2px 0;
}

/* Remove default active indicator for style-specific ones */
.unlockafe-toc.toc-style-1 .toc-item.active > a::before,
.unlockafe-toc.toc-style-3 .toc-item.active > a::before,
.unlockafe-toc.toc-style-4 .toc-item.active > a::before,
.unlockafe-toc.toc-style-5 .toc-item.active > a::before {
    display: none;
}

.unlockafe-toc .toc-loading {
    color: #9ca3af;
    font-style: italic;
    padding: 1rem 0;
}

/* ============================================
   Style 1 - Orange Header
   ============================================ */

.unlockafe-toc.toc-style-1 {
    background: #ffffff;
    border: 1px solid #e5e7eb;
}

.unlockafe-toc.toc-style-1 .toc-header {
    background: #ff6b35;
    border-bottom: none;
    padding: 1rem 1.5rem;
}

.unlockafe-toc.toc-style-1 .toc-title {
    color: #ffffff;
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.unlockafe-toc.toc-style-1 .toc-content {
    background: #fef5e7;
    padding: 1rem 1.5rem;
}

.unlockafe-toc.toc-style-1 .toc-item {
    position: relative;
    padding-left: 1.5rem;
}

.unlockafe-toc.toc-style-1 .toc-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #9ca3af;
}

.unlockafe-toc.toc-style-1 .toc-item a {
    color: #374151;
    padding: 0.5rem 0;
    display: block;
}

.unlockafe-toc.toc-style-1 .toc-item.active::before {
    background-color: #ff6b35;
}

.unlockafe-toc.toc-style-1 .toc-item.active > a {
    color: #ff6b35;
    font-weight: 600;
}

.unlockafe-toc.toc-style-1 .toc-item.active > a::before {
    display: none;
}

/* ============================================
   Style 2 - Numbered
   ============================================ */

.unlockafe-toc.toc-style-2 .toc-item {
    counter-increment: toc-counter;
    position: relative;
    padding-left: 2rem;
}

.unlockafe-toc.toc-style-2 .toc-list {
    counter-reset: toc-counter;
}

.unlockafe-toc.toc-style-2 .toc-item::before {
    content: counter(toc-counter) '.';
    position: absolute;
    left: 0;
    top: 0.5rem;
    font-weight: 600;
    color: #667eea;
    min-width: 1.5rem;
}

.unlockafe-toc.toc-style-2 .toc-item.toc-level-3::before {
    content: counter(toc-counter, lower-alpha) '.';
}

.unlockafe-toc.toc-style-2 .toc-item.toc-level-4::before {
    content: counter(toc-counter, lower-roman) '.';
}

/* ============================================
   Style 3 - Clean Lines
   ============================================ */

.unlockafe-toc.toc-style-3 {
    background: #ffffff;
    border: 1px solid #e5e7eb;
}

.unlockafe-toc.toc-style-3 .toc-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 1.5rem;
}

.unlockafe-toc.toc-style-3 .toc-title {
    color: #1f2937;
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.unlockafe-toc.toc-style-3 .toc-content {
    padding: 0;
}

.unlockafe-toc.toc-style-3 .toc-item {
    border-bottom: 1px solid #e5e7eb;
}

.unlockafe-toc.toc-style-3 .toc-item:last-child {
    border-bottom: none;
}

.unlockafe-toc.toc-style-3 .toc-item a {
    color: #374151;
    padding: 0.75rem 1.5rem;
    display: block;
}

.unlockafe-toc.toc-style-3 .toc-item a:hover {
    background-color: #f9fafb;
    transition: none !important;
    transform: none !important;
    animation: none !important;
}

.unlockafe-toc.toc-style-3 .toc-item.active > a {
    color: #2563eb;
    font-weight: 600;
    background-color: #eff6ff;
}

.unlockafe-toc.toc-style-3 .toc-item.active > a::before {
    display: none;
}

/* ============================================
   Style 4 - Numbered with Icons
   ============================================ */

.unlockafe-toc.toc-style-4 {
    background: #ffffff;
    border: 1px solid #e5e7eb;
}

.unlockafe-toc.toc-style-4 .toc-header {
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 1.5rem;
}

.unlockafe-toc.toc-style-4 .toc-title {
    color: #1f2937;
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.unlockafe-toc.toc-style-4 .toc-content {
    padding: 0;
    background: #ffffff;
}

.unlockafe-toc.toc-style-4 .toc-item {
    counter-increment: toc-counter;
    position: relative;
    padding-left: 2.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.unlockafe-toc.toc-style-4 .toc-list {
    counter-reset: toc-counter;
}

.unlockafe-toc.toc-style-4 .toc-item::before {
    content: counter(toc-counter) '.';
    position: absolute;
    left: 1.5rem;
    top: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    min-width: 1.5rem;
}

.unlockafe-toc.toc-style-4 .toc-item a {
    color: #374151;
    padding: 0.75rem 1.5rem 0.75rem 0;
    display: block;
    position: relative;
}

.unlockafe-toc.toc-style-4 .toc-item.active > a {
    color: #10b981;
    font-weight: 600;
}

.unlockafe-toc.toc-style-4 .toc-item.active > a::after {
    content: '\f04b'; /* Font Awesome play icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: #10b981;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.unlockafe-toc.toc-style-4 .toc-item.active > a::before {
    display: none;
}

.unlockafe-toc.toc-style-4 .toc-item:last-child {
    border-bottom: none;
}

/* ============================================
   Style 5 - Dark Theme
   ============================================ */

.unlockafe-toc.toc-style-5 {
    background: #1e293b;
    border: 1px solid #334155;
    color: #ffffff;
}

.unlockafe-toc.toc-style-5 .toc-header {
    background: #1e293b;
    border-bottom: 1px solid #334155;
    padding: 1rem 1.5rem;
}

.unlockafe-toc.toc-style-5 .toc-title {
    color: #ffffff;
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.unlockafe-toc.toc-style-5 .toc-toggle {
    color: #94a3b8;
}

.unlockafe-toc.toc-style-5 .toc-content {
    padding: 1rem 1.5rem;
    background: #1e293b;
}

.unlockafe-toc.toc-style-5 .toc-item {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.unlockafe-toc.toc-style-5 .toc-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #64748b;
}

.unlockafe-toc.toc-style-5 .toc-item a {
    color: #cbd5e1;
    padding: 0.5rem 0;
    display: block;
}

.unlockafe-toc.toc-style-5 .toc-item a:hover {
    color: #ffffff;
    transition: none !important;
    transform: none !important;
    animation: none !important;
}

.unlockafe-toc.toc-style-5 .toc-item.active::before {
    background-color: #3b82f6;
}

.unlockafe-toc.toc-style-5 .toc-item.active > a {
    color: #ffffff;
    font-weight: 500;
}

.unlockafe-toc.toc-style-5 .toc-item.active > a::before {
    display: none;
}

/* Add separator line for nested items in Style 5 */
.unlockafe-toc.toc-style-5 .toc-item.toc-level-3 {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed #475569;
}

.unlockafe-toc.toc-style-5 .toc-item.toc-level-3::before {
    background-color: #3b82f6;
    width: 8px;
    height: 8px;
}

/* ============================================
   Scrollbar Styling
   ============================================ */

.unlockafe-toc .toc-content::-webkit-scrollbar {
    width: 6px;
}

.unlockafe-toc .toc-content::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 3px;
}

.unlockafe-toc .toc-content::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.unlockafe-toc .toc-content::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
    transition: none !important;
}

/* ============================================
   Responsive Design - Tablet (≤768px)
   ============================================ */

@media (max-width: 768px) {
    .unlockafe-toc.sticky {
        position: relative;
        top: 0;
        max-height: none;
    }

    .unlockafe-toc .toc-header {
        padding: 0.875rem 1.25rem;
    }

    .unlockafe-toc .toc-title {
        font-size: 1.125rem;
    }

    .unlockafe-toc .toc-content {
        padding: 0.875rem 1.25rem;
        max-height: 400px;
    }

    .unlockafe-toc .toc-item a {
        font-size: 0.95rem;
        padding: 0.45rem 0;
    }
}

/* ============================================
   Responsive Design - Mobile (≤480px)
   ============================================ */

@media (max-width: 480px) {
    .unlockafe-toc {
        border-radius: 6px;
    }

    .unlockafe-toc .toc-header {
        padding: 0.75rem 1rem;
    }

    .unlockafe-toc .toc-title {
        font-size: 1rem;
    }

    .unlockafe-toc .toc-content {
        padding: 0.75rem 1rem;
        max-height: 300px;
    }

    .unlockafe-toc .toc-item a {
        font-size: 0.9rem;
        padding: 0.4rem 0;
    }

    .unlockafe-toc.toc-style-2 .toc-item {
        padding-left: 1.75rem;
    }

    .unlockafe-toc.toc-style-3 .toc-item a {
        padding-left: 0.75rem;
        margin-left: 0.25rem;
    }
}

/* ============================================
   No Animations - Simple List Only
   ============================================ */

.unlockafe-toc .toc-item.active > a {
    /* No animation */
}

/* ============================================
   Collapsible (No Animation)
   ============================================ */

.unlockafe-toc.collapsible .toc-content {
    overflow: hidden;
}

.unlockafe-toc.collapsible.collapsed .toc-content {
    display: none;
}

