/* SEO Enhancement Styles - Phase 2 */

/* ============================================
   BREADCRUMBS
   ============================================ */

.breadcrumbs {
    padding: 1rem 0;
    font-size: 0.875rem;
    color: #6b7280;
}

.breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 0.5rem;
}

.breadcrumb-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumb-list a {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-list a:hover {
    color: #3b82f6;
    text-decoration: underline;
}

.breadcrumb-separator {
    color: #d1d5db;
}

.breadcrumb-current {
    color: #1f2937;
    font-weight: 500;
}

.breadcrumb-series {
    color: #3b82f6;
    font-weight: 500;
}

/* Responsive breadcrumbs */
@media (max-width: 640px) {
    .breadcrumbs {
        font-size: 0.75rem;
        padding: 0.75rem 0;
    }
}


/* ============================================
   TABLE OF CONTENTS
   ============================================ */

.table-of-contents {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin: 2rem 0;
    transition: all 0.3s ease;
}

.toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

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

.toc-toggle {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.25rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toc-toggle:hover {
    background: #e5e7eb;
    color: #1f2937;
}

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

.table-of-contents.collapsed .toc-toggle-icon {
    transform: rotate(180deg);
}

.table-of-contents.collapsed .toc-list {
    display: none;
}

.table-of-contents.collapsed .toc-header {
    justify-content: center;
    margin-bottom: 0;
}

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

.toc-list li {
    margin-bottom: 0.5rem;
    list-style: none !important;
    list-style-type: none !important;
}

.toc-link {
    color: #3b82f6;
    text-decoration: none;
    transition: color 0.2s;
}

.toc-link:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* Mobile/Tablet - Hide fixed sidebar, show TOC at top of content */
@media (max-width: 1023px) {
    .guide-sidebar-fixed {
        display: none; /* Hide fixed sidebar on mobile */
    }

    .guide-main-content {
        width: 100%;
    }

    /* TOC appears in mobile layout at top */
    .toc-toggle {
        display: flex; /* Show collapse button on mobile */
    }
}

/* Desktop Layout - Centered Container with Sidebar */
@media (min-width: 1024px) {
    .guide-content.container {
        max-width: 1400px;
        margin: 0 auto;
        padding: 0 2rem;
    }

    .guide-content-wrapper {
        display: flex;
        gap: 3rem;
        align-items: flex-start;
        padding-top: 2rem;
    }

    .guide-sidebar {
        flex: 0 0 500px;
        min-width: 500px;
        position: sticky;
        top: 120px;
        align-self: flex-start;
    }

    .guide.toc-collapsed .guide-sidebar {
        flex: 0 0 48px;
        min-width: 48px;
    }

    .table-of-contents {
        transition: all 0.3s ease;
    }

    /* Collapsed state */
    .table-of-contents.collapsed {
        width: 48px;
    }

    .table-of-contents.collapsed .toc-title {
        display: none;
    }

    .table-of-contents.collapsed .toc-toggle {
        display: flex;
        justify-content: center;
        padding: 0.5rem;
    }

    .guide-main-content {
        flex: 1;
        max-width: 800px;
        min-width: 0;
    }

    /* Ensure no icons on individual TOC links */
    .toc-link::before,
    .toc-link::after {
        content: none !important;
        display: none !important;
    }

    .toc-list li::marker {
        content: none;
    }

    .table-of-contents {
        margin: 0;
        background: #ffffff;
        border: 1px solid #e5e7eb;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        border-radius: 0.5rem;
    }

    .toc-header {
        border-bottom: 1px solid #e5e7eb;
        padding-bottom: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .table-of-contents.collapsed .toc-header {
        border-bottom: none;
        padding-bottom: 0;
    }

    .toc-title {
        font-size: 1rem;
        font-weight: 600;
        text-transform: none;
        letter-spacing: normal;
        color: #1f2937;
    }

    /* Collapsed state - show arrow icon */
    .table-of-contents.collapsed .toc-toggle-icon {
        width: 24px;
        height: 24px;
        color: #3b82f6;
    }

    .toc-list li {
        font-size: 0.9375rem;
        margin-bottom: 0.5rem;
        line-height: 1.6;
    }

    .toc-list li {
        font-size: 0.875rem;
        margin-bottom: 0.375rem;
        line-height: 1.5;
    }

    .toc-link {
        display: block;
        padding: 0.375rem 0;
        line-height: 1.4;
    }

    /* Highlight active section */
    .toc-link.active {
        color: #2563eb;
        font-weight: 600;
        background: #eff6ff;
        margin: 0 -0.5rem;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        border-radius: 0.25rem;
    }
}

/* Tablet - keep at top */
@media (min-width: 768px) and (max-width: 1023px) {
    .table-of-contents {
        max-width: 600px;
        margin: 2rem auto;
    }
}

/* Mobile TOC */
@media (max-width: 767px) {
    .table-of-contents {
        padding: 1rem;
        margin: 1.5rem 0;
    }

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

    .toc-list li {
        font-size: 0.875rem;
        margin-bottom: 0.375rem;
    }
}


/* ============================================
   PREREQUISITES & LEARNING OBJECTIVES
   ============================================ */

.guide-prerequisites,
.guide-learning-objectives {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    border-radius: 0.25rem;
    padding: 1.25rem;
    margin: 1.5rem 0;
}

.guide-prerequisites h3,
.guide-learning-objectives h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1e40af;
    margin: 0 0 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.guide-prerequisites h3::before {
    content: "📚";
}

.guide-learning-objectives h3::before {
    content: "🎯";
}

.guide-prerequisites ul,
.guide-learning-objectives ul {
    margin: 0;
    padding-left: 1.5rem;
}

.guide-prerequisites li,
.guide-learning-objectives li {
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.guide-prerequisites a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.guide-prerequisites a:hover {
    text-decoration: underline;
}


/* ============================================
   READING PROGRESS BAR
   ============================================ */

.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    z-index: 1000;
}

.reading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    width: 0%;
    transition: width 0.1s ease-out;
}


/* ============================================
   ENHANCED GUIDE METADATA
   ============================================ */

.guide-meta-enhanced {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 0.5rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.meta-item-icon {
    font-size: 1.125rem;
}

.meta-item-label {
    font-weight: 500;
    color: #1f2937;
}


/* ============================================
   FAQ SECTION STYLES
   ============================================ */

.faq-section {
    margin: 2rem 0;
}

.faq-item {
    border-bottom: 1px solid #e5e7eb;
    padding: 1.5rem 0;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.75rem;
}

.faq-question::before {
    content: "Q: ";
    color: #3b82f6;
    font-weight: 700;
}

.faq-answer {
    color: #4b5563;
    line-height: 1.6;
}

.faq-answer::before {
    content: "A: ";
    color: #10b981;
    font-weight: 700;
}


/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .breadcrumbs,
    .table-of-contents,
    .reading-progress {
        display: none;
    }

    .guide-content {
        max-width: 100%;
    }
}
