/* Modern content section container */
.content-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Dark theme support for content sections */
body.dark-theme .content-section {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2);
}

.content-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px 16px 0 0;
}

.content-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Dark theme hover effects */
body.dark-theme .content-section:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3);
}

.subtopic-title {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 1.5rem 0;
    color: #1e293b;
    letter-spacing: -0.025em;
}

/* Dark theme support for subtopic title */
body.dark-theme .subtopic-title {
    color: var(--text-primary);
}

.subtopic-content {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text-primary);
    line-height: 1.8;
    font-size: 1.125rem; /* Increased from 1.05rem for better readability */
}

.subtopic-content p {
    margin-bottom: 1.25rem;
    color: #374151;
    text-align: justify;
    font-size: 1.125rem; /* Explicit font size for paragraphs */
    line-height: 1.8;
}

/* Responsive font sizes for subtopic content */
@media (max-width: 480px) {
    .subtopic-title {
        font-size: 1.5rem;
        line-height: 1.75rem;
    }
    
    .subtopic-content {
        font-size: 1.1rem; /* Larger than before for mobile */
    }
    
    .subtopic-content p {
        font-size: 1.1rem;
        line-height: 1.7;
    }
    
    .subtopic-content li {
        font-size: 1.1rem;
        line-height: 1.7;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .subtopic-title {
        font-size: 1.625rem;
    }
    
    .subtopic-content {
        font-size: 1.125rem;
    }
    
    .subtopic-content p {
        font-size: 1.125rem;
    }
    
    .subtopic-content li {
        font-size: 1.125rem;
    }
}

/* Dark theme support for content text */
body.dark-theme .subtopic-content p {
    color: var(--text-secondary);
}

.subtopic-content p:last-child {
    margin-bottom: 0;
}

/* Enhanced list styling within content sections */
.subtopic-content ul,
.subtopic-content ol {
    margin: 1.5rem 0;
    padding-left: 1.5rem;
}

.subtopic-content li {
    margin-bottom: 0.75rem;
    color: #374151;
    line-height: 1.7;
    font-size: 1.125rem; /* Explicit font size for list items */
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Dark theme support for list items */
body.dark-theme .subtopic-content li {
    color: var(--text-secondary);
}

.subtopic-content li::marker {
    color: #667eea;
    font-weight: 600;
}

/* Enhanced table styling within content sections */
.subtopic-content .table-responsive-wrapper {
    margin: 2rem 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
}

/* Dark theme support for table wrapper */
body.dark-theme .subtopic-content .table-responsive-wrapper {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.subtopic-content .grammar-table {
    background: white;
    border-radius: 0;
}

/* Dark theme support for tables */
body.dark-theme .subtopic-content .grammar-table {
    background: var(--surface-color);
}

.subtopic-content .grammar-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    padding: 1rem;
}

.subtopic-content .grammar-table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    color: #374151;
}

/* Dark theme support for table cells */
body.dark-theme .subtopic-content .grammar-table td {
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.subtopic-content .grammar-table tr:hover {
    background: #f8fafc;
}

/* Dark theme support for table row hover */
body.dark-theme .subtopic-content .grammar-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Modern blockquote styling */
.subtopic-content blockquote {
    border-left: 4px solid #667eea;
    background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%);
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 12px 12px 0;
    font-style: italic;
    color: #4338ca;
    position: relative;
}

/* Dark theme support for blockquotes */
body.dark-theme .subtopic-content blockquote {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: #a5b4fc;
}

.subtopic-content blockquote::before {
    content: '"';
    font-size: 3rem;
    color: #667eea;
    position: absolute;
    top: -0.5rem;
    left: 1rem;
    font-family: serif;
    opacity: 0.3;
}

/* Code styling within content sections */
.subtopic-content code {
    background: #f1f5f9;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.9rem;
    color: #e11d48;
    border: 1px solid #e2e8f0;
}

/* Dark theme support for inline code */
body.dark-theme .subtopic-content code {
    background: #334155;
    color: #fbbf24;
    border: 1px solid var(--border-color);
}

.subtopic-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 12px;
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid #334155;
}

.subtopic-content pre code {
    background: transparent;
    padding: 0;
    border: none;
    color: inherit;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .content-section {
        padding: 1.5rem;
        margin: 1.5rem 0;
        border-radius: 12px;
    }
    
    .subtopic-title {
        font-size: 1.25rem;
    }
    
    .subtopic-content {
        font-size: 1rem;
    }
}

/* Additional responsive typography for subtopic content */
@media (max-width: 480px) {
    .subtopic-title {
        font-size: 1.25rem;
    }
    
    .subtopic-content {
        font-size: 0.95rem;
        line-height: 1.7;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .subtopic-title {
        font-size: 1.375rem;
    }
    
    .subtopic-content {
        font-size: 1rem;
        line-height: 1.75;
    }
}

@media (min-width: 1440px) {
    .subtopic-title {
        font-size: 1.625rem;
    }
    
    .subtopic-content {
        font-size: 1.125rem;
        line-height: 1.85;
    }
}

/* Optimize content width for better readability on large screens */
@media (min-width: 1200px) {
    .content-section {
        max-width: 900px;
        margin: 2rem auto;
    }
    
    .content-section .card-body {
        max-width: 800px;
        margin: 0 auto;
    }
}

/* Ensure good spacing and readability for legal/content pages */
.content-section .card-body h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.25rem;
    line-height: 1.4;
}

.content-section .card-body h2:first-child {
    margin-top: 0;
}

.content-section .card-body p {
    margin-bottom: 1.5rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.content-section .card-body p:last-child {
    margin-bottom: 0;
}

