/* ========== GRAMMAR PAGE STYLES ========== */
.grammar-page-content {
    background: white;
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.7;
    color: #2c3e50;
}

/* Sections */
.grammar-section {
    margin-bottom: 3rem;
    padding: 20px;
    background: #f8f9fa;
    border-left: 4px solid #0073aa;
    border-radius: 5px;
}

.grammar-section h3 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0.5rem;
}

/* ========== PATHWAY END STYLING ========== */

.pathway-completion-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 30px;
    text-align: center;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.pathway-completion-header h2 {
    font-size: 2.5em;
    margin: 0 0 10px 0;
    color: white;
}

.pathway-completion-header p {
    font-size: 1.3em;
    opacity: 0.9;
}

/* Boxes */
.achievement-box,
.key-takeaways-box,
.next-steps-box,
.final-celebration {
    padding: 25px;
    margin: 25px 0;
    border-radius: 12px;
    color: white;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.achievement-box {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
}

.key-takeaways-box {
    background: linear-gradient(135deg, #55efc4, #00b894);
}

.next-steps-box {
    background: linear-gradient(135deg, #fdcb6e, #e17055);
}

.final-celebration {
    background: linear-gradient(135deg, #94D2BD, #6c5ce7);
    text-align: center;
}

.key-takeaways-box ul,
.next-steps-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.key-takeaways-box li,
.next-steps-box li {
    background: rgba(255, 255, 255, 0.2);
    padding: 12px 16px;
    border-radius: 8px;
    margin: 12px 0;
    border-left: 4px solid rgba(255, 255, 255, 0.5);
}

.final-celebration h3 {
    color: white;
    font-size: 2rem;
    margin-top: 0;
    border: none;
}

.final-celebration p {
    font-size: 1.2em;
    margin: 15px 0 0 0;
    opacity: 0.95;
}

/* ========== BREADCRUMB ========== */
.grammar-breadcrumb {
    background: none;
    color: #333;
    padding: 15px 25px;
    margin: -20px -20px 30px -20px;
    border: none;
    font-size: 0.9rem;
}

.grammar-breadcrumb a {
    color: #0073aa !important;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.grammar-breadcrumb a:hover {
    color: #005077 !important;
    text-decoration: underline;
}

.grammar-breadcrumb .separator {
    margin: 0 10px;
    opacity: 0.7;
}

.grammar-breadcrumb .current-page {
    font-weight: 600;
    color: #111;
    opacity: 1;
}

/* ========== ENHANCED PATHWAY NAVIGATION BAR ========== */
.ysp-grammar-pathway-navigation-enhanced {
    background: #1c5f73;
    color: white;
    border-radius: 8px;
    margin: 20px 0;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(28, 95, 115, 0.3);
}

.pathway-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: linear-gradient(135deg, #1c5f73, #2a7a8a);
}

.nav-button-container {
    min-width: 120px;
}

.nav-button {
    color: white !important;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: inline-block;
}

.nav-button:hover {
    background: rgba(255,255,255,0.15) !important;
    color: #ff6b35 !important;
    text-decoration: none;
}

.nav-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-completed {
    background: #28a745 !important;
    color: white !important;
}

.nav-center {
    flex-grow: 1;
    text-align: center;
    margin: 0 20px;
}

.nav-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.progress-bar {
    background: rgba(255,255,255,0.2);
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    margin: 5px 0;
}

.progress-fill {
    background: linear-gradient(90deg, #ff6b35, #ffa726);
    height: 100%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.85rem;
    opacity: 0.9;
}

.page-numbers-nav {
    background: rgba(0,0,0,0.1);
    padding: 12px 20px;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.page-number {
    color: white !important;
    text-decoration: none;
    padding: 6px 12px;
    margin: 0 2px;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: inline-block;
    min-width: 32px;
    text-align: center;
}

.page-number:hover {
    background: rgba(255,255,255,0.2) !important;
    color: #ff6b35 !important;
    text-decoration: none;
}

.page-number.current-page {
    background: #ff6b35 !important;
    color: white !important;
    font-weight: bold;
}

.page-number.page-unavailable {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-ellipsis {
    color: rgba(255,255,255,0.6);
    padding: 6px 8px;
}

/* ========== LEGACY NAVIGATION (Keep for backward compatibility) ========== */
.ysp-grammar-pathway-navigation {
    background: #1c5f73;
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: -20px -20px 0 -20px;
}
.ysp-grammar-pathway-navigation div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}
.ysp-grammar-pathway-navigation a,
.ysp-grammar-pathway-navigation span {
    color: white !important;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 15px;
    border-radius: 4px;
    transition: all 0.3s ease;
}
.ysp-grammar-pathway-navigation a:hover {
    color: #ff6b35 !important;
    background: rgba(255, 255, 255, 0.1) !important;
    text-decoration: none !important;
}
.ysp-grammar-pathway-navigation .path-info {
    text-align: center;
    flex-grow: 1;
    margin: 0 20px;
    font-weight: 600;
}

/* ========== MOBILE ========== */
@media (max-width: 768px) {
    .grammar-page-content {
        margin: 0 10px;
        padding: 15px;
    }
    .grammar-section,
    .achievement-box,
    .key-takeaways-box,
    .next-steps-box,
    .final-celebration,
    .pathway-completion-header {
        padding: 15px;
    }
    .pathway-completion-header h2 {
        font-size: 2em;
    }
    .grammar-breadcrumb {
        margin: -15px -15px 20px -15px;
        padding: 12px 15px;
        font-size: 0.8rem;
        border-radius: 8px 8px 0 0;
    }
    
    /* Enhanced navigation mobile styles */
    .pathway-nav-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .nav-button-container {
        min-width: auto;
    }
    
    .nav-center {
        margin: 0;
        order: -1;
    }
    
    .page-numbers-nav {
        padding: 10px;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .page-number {
        margin: 0 1px;
        padding: 6px 10px;
        min-width: 28px;
    }
    
    /* Legacy navigation mobile styles */
    .ysp-grammar-pathway-navigation {
        margin: -15px -15px 0 -15px;
        padding: 12px 15px;
        border-radius: 0 0 8px 8px;
    }
    .ysp-grammar-pathway-navigation div {
        flex-direction: column !important;
        gap: 10px;
        text-align: center;
    }
    .ysp-grammar-pathway-navigation .path-info {
        margin: 0;
    }
}

/* ========== ADD THESE MISSING SECTIONS TO YOUR CSS FILE ========== */

    /* Examples Section */
    .grammar-examples {
        margin: 25px 0;
    }

    .example {
        background: #f0f8ff;
        padding: 1.5rem;
        border-radius: 8px;
        margin: 1.5rem 0;
        border-left: 4px solid #0073aa;
        border: 1px solid #cbd5e1;
    }

    .example strong {
        color: #2c3e50;
        font-size: 1.1em;
        display: block;
        margin-bottom: 8px;
        font-weight: 600;
    }

    .example em {
        color: #666;
        font-style: italic;
        display: block;
        margin-top: 5px;
    }

    /* Common Mistakes Section */
    .common-mistakes {
        margin: 25px 0;
    }

    .common-mistakes h3 {
        color: #2c3e50;
        font-size: 1.5rem;
        margin-bottom: 1rem;
        border-bottom: 2px solid #e0e0e0;
        padding-bottom: 0.5rem;
    }

    .mistake {
        background: #fff;
        border: 1px solid #e1e1e1;
        margin: 20px 0;
        padding: 20px;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .mistake p {
        margin: 10px 0;
        line-height: 1.6;
    }

    /* Tips Section */
    .grammar-tips {
        background: #f0f8ff;
        padding: 20px;
        border-radius: 8px;
        border-left: 4px solid #0073aa;
        margin: 25px 0;
    }

    .grammar-tips h3 {
        color: #2c3e50;
        margin-top: 0;
        margin-bottom: 1rem;
        font-size: 1.5rem;
        border-bottom: 2px solid #e0e0e0;
        padding-bottom: 0.5rem;
    }

    .grammar-tips li {
        margin-bottom: 10px;
        color: #2c3e50;
        line-height: 1.6;
    }

    /* Pathway Notes Section */
    .pathway-notes {
        margin-top: 40px;
        padding: 25px;
        background: linear-gradient(135deg, #fff8e1 0%, #f3e5ab 100%);
        border: 2px solid #ffcc02;
        border-radius: 10px;
    }

    .pathway-notes h3,
    .pathway-notes h4 {
        color: #8b4513;
        margin-top: 0;
    }

    /* General heading styles for these sections */
    h3 {
        color: #2c3e50;
        font-size: 1.5rem;
        margin: 2rem 0 1rem 0;
        border-bottom: 2px solid #e0e0e0;
        padding-bottom: 0.5rem;
    }

    strong {
        color: #2c3e50;
        font-weight: 600;
    }
    
    
    /* Hide markdown asterisks on grammar pages */
.grammar-page-content strong::before,
.grammar-page-content strong::after,
.grammar-section strong::before, 
.grammar-section strong::after {
    content: '';
}

/* Remove literal asterisks around text */
.grammar-page-content,
.grammar-section,
.example,
.mistake,
.grammar-tips {
    /* This won't remove them but makes them less visible */
}


/**
 * ENHANCED GRAMMAR NAVIGATION WITH INTEGRATED TOC
 * Add this CSS to your theme or grammar plugin CSS file
 */

/**
 * ENHANCED GRAMMAR NAVIGATION WITH INTEGRATED TOC
 * Add this CSS to your theme or grammar plugin CSS file
 */

/* ============================================
   MAIN CONTAINER
   ============================================ */
.ysp-grammar-pathway-navigation-enhanced {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    margin: 30px 0;
    overflow: hidden;
}

/* ============================================
   PATHWAY TITLE & TOC HEADER SECTION
   ============================================ */
.pathway-header-section {
    background: #ffffff;
    border-bottom: 2px solid #dee2e6;
    padding: 20px;
}

.pathway-title-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.pathway-main-title {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: #2c3e50;
    flex: 1;
}

/* TOC Toggle Button */
.toc-toggle-btn {
    background: #34697d; /* Teal to match navigation */
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s ease;
}

.toc-toggle-btn:hover {
    background: #2c5f6f; /* Darker teal on hover */
}

.toc-toggle-btn.collapsed {
    background: #95a5a6;
}

.toc-toggle-btn.collapsed:hover {
    background: #7f8c8d;
}

.toggle-icon {
    font-size: 18px;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

/* ============================================
   INTEGRATED TOC LIST
   ============================================ */
.pathway-toc-list {
    margin-top: 20px;
    background: #f8f9fa;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    padding: 15px;
    max-height: 500px;
    overflow-y: auto;
}

.toc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    margin-bottom: 8px;
    background: white;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.toc-item:last-child {
    margin-bottom: 0;
}

.toc-item:hover {
    border-color: #34697d; /* Teal hover */
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Current page highlighting */
.toc-item.current-page {
    background: #e0f2f7; /* Light teal background */
    border-color: #34697d; /* Teal border */
    border-width: 2px;
    font-weight: 600;
}

/* Not published styling */
.toc-item.not-published {
    opacity: 0.6;
    background: #f5f5f5;
}

.toc-item.not-published:hover {
    border-color: #e1e4e8;
    box-shadow: none;
}

/* TOC Icons */
.toc-icon {
    font-size: 16px;
    min-width: 24px;
    text-align: center;
}

.toc-icon.completed {
    color: #27ae60;
}

.toc-item.current-page .toc-icon {
    color: #34697d; /* Teal icon for current page */
}

/* TOC Position Number */
.toc-position {
    font-weight: 600;
    color: #7f8c8d;
    min-width: 30px;
}

.toc-item.current-page .toc-position {
    color: #34697d; /* Teal position number */
}

/* TOC Title */
.toc-title {
    flex: 1;
    color: #2c3e50;
    text-decoration: none;
    font-size: 15px;
    line-height: 1.4;
}

a.toc-title:hover {
    color: #34697d; /* Teal hover */
    text-decoration: underline;
}

.toc-item.current-page .toc-title {
    color: #2c5f6f; /* Darker teal */
}

.toc-title em {
    color: #95a5a6;
    font-size: 13px;
}

/* Current Badge */
.current-badge {
    background: #ff5722; /* Orange badge to match page numbers */
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

/* ============================================
   MAIN NAVIGATION BAR (Previous/Next)
   ============================================ */
.pathway-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    gap: 20px;
    background: #34697d; /* Original teal color */
    color: white;
}

.nav-button-container {
    min-width: 120px;
}

/* Navigation Buttons */
.nav-button {
    display: inline-block;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: background 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.nav-button:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    text-decoration: none;
}

.nav-button.nav-disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.nav-button.nav-completed {
    background: #27ae60;
    border-color: #27ae60;
}

/* Center Section */
.nav-center {
    flex: 1;
    text-align: center;
}

.nav-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    max-width: 400px;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    margin: 10px auto;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #ff5722; /* Orange to match current page indicator */
    border-radius: 10px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 13px;
    margin-top: 5px;
    opacity: 0.9;
}

/* ============================================
   PAGE NUMBERS NAVIGATION
   ============================================ */
.page-numbers-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 15px 20px;
    background: #2c5f6f; /* Darker teal for contrast */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.page-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    background: transparent;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 15px;
    transition: background 0.3s ease, transform 0.2s ease;
    border: 2px solid transparent;
}

.page-number:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    color: white;
}

.page-number.current-page {
    background: #ff5722; /* Orange highlight */
    color: white;
    border-color: #ff5722;
    transform: scale(1.1);
}

.page-number.page-unavailable {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-number.page-unavailable:hover {
    background: transparent;
    transform: none;
}

.page-ellipsis {
    color: white;
    font-size: 18px;
    font-weight: bold;
    padding: 0 5px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    .pathway-title-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .pathway-main-title {
        font-size: 18px;
    }
    
    .toc-toggle-btn {
        width: 100%;
        justify-content: center;
    }
    
    .pathway-nav-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-button-container {
        width: 100%;
        text-align: center;
    }
    
    .nav-button {
        width: 100%;
    }
    
    .nav-center {
        width: 100%;
    }
    
    .toc-item {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .current-badge {
        width: 100%;
        text-align: center;
        margin-top: 5px;
    }
    
    .page-numbers-nav {
        padding: 10px;
        gap: 4px;
        overflow-x: auto;
        justify-content: flex-start;
    }
    
    .page-number {
        min-width: 35px;
        height: 35px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .pathway-header-section {
        padding: 15px;
    }
    
    .pathway-main-title {
        font-size: 16px;
    }
    
    .toc-item {
        padding: 10px;
        font-size: 14px;
    }
    
    .pathway-toc-list {
        padding: 10px;
        max-height: 400px;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .toc-toggle-btn {
        display: none;
    }
    
    .pathway-toc-list {
        display: block !important;
        max-height: none;
    }
    
    .nav-button {
        display: none;
    }
}