/* Creative Table of Contents Styles */
.toc {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: none;
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(43, 147, 118, 0.08);
}

.toc:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: linear-gradient(to bottom, #2196F3, #015061);
    border-radius: 16px 0 0 16px;
}

.toc-title {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #00a3c8;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: none;
    position: relative;
}

.toc-title:before {
    content: '📌';
    font-size: 1.2rem;
}

.toc-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(to bottom, #2196F3, #015061);
    border-radius: 2px;
}

.toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: toc-counter;
}

.toc li {
    margin-bottom: 1rem;
    position: relative;
    padding-left: 2.5rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    counter-increment: toc-counter;
}

.toc li:before {
    content: counter(toc-counter);
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    background: linear-gradient(to bottom, #2196F3, #015061);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(43, 147, 118, 0.2);
}

.toc li:hover {
    background-color: rgba(43, 147, 118, 0.05);
    padding-left: 3rem;
}

.toc li:hover:before {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 12px rgba(43, 147, 118, 0.3);
}

.toc li.h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.toc li.h2:before {
    background: linear-gradient(135deg, #00a3c8, #015061);
}

.toc li.h3 {
    margin-left: 1rem;
    font-size: 1rem;
    font-weight: 500;
}

.toc li.h3:before {
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
    background: linear-gradient(to bottom, #2196F3, #015061);
}

.toc li.h4 {
    margin-left: 2rem;
    font-size: 0.95rem;
    font-weight: 400;
}

.toc li.h4:before {
    width: 22px;
    height: 22px;
    font-size: 0.75rem;
    background: linear-gradient(to bottom, #2196F3, #015061);
}

.toc a {
    color: #2d3748;
    text-decoration: none;
    font-size: 1rem;
    margin-right: 36px;
    line-height: 1.6;
    display: block;
    transition: all 0.3s ease;
    position: relative;
}

.toc a:after {
    content: '→';
    position: absolute;
    right: 0;
    opacity: 0;
    transform: translateX(-10px);
    color: #2196F3;
    font-weight: bold;
    transition: all 0.3s ease;
}

.toc li:hover a:after {
    opacity: 1;
    transform: translateX(0);
}

.toc a:hover {
    color: #2196F3;
    background: none;
    transform: none;
}

/* Decorative elements */
.toc:after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(43, 147, 118, 0.05) 0%, transparent 70%);
    z-index: 0;
}

.toc > * {
    position: relative;
    z-index: 1;
}
.toc li:before {
    padding-top: 4px;
}
/* Responsive Design */
@media (max-width: 768px) {
    .toc {
        padding: 1.5rem;
        margin: 1.5rem 0;
        border-radius: 12px;
    }

    .toc-title {
        font-size: 1.2rem;
    }

    .toc li {
        padding-left: 2rem;
    }

    .toc li:before {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }

    .toc li.h3 {
        margin-left: 0.5rem;
    }

    .toc li.h4 {
        margin-left: 1rem;
    }
}

/* Animation on page load */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.toc {
    animation: fadeInUp 0.6s ease-out;
}

/* Individual item animation */
.toc li {
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
}

.toc li:nth-child(1) { animation-delay: 0.1s; }
.toc li:nth-child(2) { animation-delay: 0.2s; }
.toc li:nth-child(3) { animation-delay: 0.3s; }
.toc li:nth-child(4) { animation-delay: 0.4s; }
.toc li:nth-child(5) { animation-delay: 0.5s; }

/* Focus states for accessibility */
.toc a:focus {
    outline: 2px solid #2196F3;
    outline-offset: 4px;
    border-radius: 4px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .toc {
        background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }

    .toc:before {
         background: linear-gradient(to bottom, #2196F3, #015061);
    }

    .toc-title {
        color: #2196F3;
    }

    .toc-title:after {
         background: linear-gradient(to bottom, #2196F3, #015061);
    }

    .toc a {
        color: #e2e8f0;
    }

    .toc li:hover {
        background-color: rgba(79, 209, 199, 0.1);
    }

    .toc li:before {
        background: linear-gradient(to bottom, #2196F3, #015061);
        color: #1a202c;
    }

    .toc li.h2:before {
        background: linear-gradient(135deg, #00a3c8, #015061);
    }
}
