/*!
 * NCERT Solutions Layout Fix CSS
 * Comprehensive fixes for layout issues on NCERT Solutions pages
 * Version: 1.0.0
 * Author: Layout Fix Team
 */

/* ==========================================================================
   1. RESPONSIVE GRID FIXES
   ========================================================================== */

/* Fix Bootstrap grid system conflicts */
.blog-details-page .container {
    max-width: 100%;
    padding-left: 15px;
    padding-right: 15px;
    margin-left: auto;
    margin-right: auto;
}

.blog-details-page .row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -15px;
    margin-right: -15px;
}

.blog-details-page .col-lg-8 {
    flex: 0 0 66.666667%;
    max-width: 66.666667%;
    padding-left: 15px;
    padding-right: 15px;
    position: relative;
    width: 100%;
}

.blog-details-page .col-lg-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
    padding-left: 15px;
    padding-right: 15px;
    position: relative;
    width: 100%;
}

/* Responsive breakpoints */
@media (max-width: 1199.98px) {
    .blog-details-page .col-lg-8 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .blog-details-page .col-lg-4 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-top: 30px;
    }
}

@media (max-width: 991.98px) {
    .blog-details-page .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .blog-details-page .row {
        margin-left: -10px;
        margin-right: -10px;
    }
    
    .blog-details-page .col-lg-8,
    .blog-details-page .col-lg-4 {
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* ==========================================================================
   2. HEADER AND NAVIGATION FIXES
   ========================================================================== */

/* Fix header layout on mobile */
.header-area {
    position: relative;
    z-index: 1000;
}

.navigation {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Mobile navigation improvements */
@media (max-width: 767px) {
    .navigation .nav-menus-wrapper {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background: #fff;
        z-index: 9999;
        transition: left 0.3s ease;
        overflow-y: auto;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }
    
    .navigation .nav-menus-wrapper.nav-menus-wrapper-open {
        left: 0;
    }
    
    .navigation .nav-toggle {
        display: block;
        position: relative;
        width: 30px;
        height: 30px;
        cursor: pointer;
        z-index: 10000;
    }
    
    .header-search {
        width: 100%;
        margin-top: 10px;
    }
    
    .header-search input {
        width: 100%;
        padding: 8px 12px;
        border: 1px solid #ddd;
        border-radius: 4px;
    }
}

/* ==========================================================================
   3. SIDEBAR LAYOUT FIXES
   ========================================================================== */

/* Enhanced sidebar container fixes */
.enhanced-sidebar-container {
    position: relative;
    width: 100%;
}

.blog-sidebar {
    width: 100%;
    padding: 0;
}

.blog-sidebar.right-sidebar {
    padding-left: 0;
    padding-right: 0;
}

/* Sidebar widget improvements */
.sidebar-widget {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 25px;
    border: 1px solid #e8ecef;
    transition: all 0.3s ease;
}

.sidebar-widget:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

/* Widget header fixes */
.widget-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    border-bottom: none;
}

.widget-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    color: white;
    line-height: 1.4;
}

.widget-title i {
    margin-right: 8px;
    font-size: 0.9rem;
    color: #ffd700;
    flex-shrink: 0;
}

/* Mobile sidebar fixes */
@media (max-width: 991.98px) {
    .enhanced-sidebar-container {
        margin-top: 30px;
    }
    
    .sidebar-widget {
        margin-bottom: 20px;
    }
    
    .widget-header {
        padding: 10px 15px;
    }
    
    .widget-title {
        font-size: 0.9rem;
    }
}

@media (max-width: 767px) {
    .sidebar-widget {
        margin-bottom: 15px;
        border-radius: 6px;
    }
    
    .widget-header {
        padding: 8px 12px;
    }
    
    .widget-title {
        font-size: 0.85rem;
    }
}

/* ==========================================================================
   4. CONTENT LAYOUT FIXES
   ========================================================================== */

/* Main content area improvements */
.blog-details-content {
    width: 100%;
    padding: 0;
}

.details-content {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* Title and heading fixes */
.title-hd {
    font-weight: 600;
    font-size: 28px;
    color: #07294d;
    margin: 20px 0;
    line-height: 1.3;
}

h2.title-hd {
    font-size: 24px;
    padding: 20px 0 0 0;
}

h3.title-hd {
    font-size: 18px;
    font-weight: 600;
    color: #07294d;
    margin-bottom: 10px;
}

/* Content section improvements */
.sec-containter {
    width: 100%;
    overflow: hidden;
}

.sec-containter p {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 15px;
    text-align: justify;
}

.sec-containter h2,
.sec-containter h3 {
    color: #494677;
    font-family: 'Lora', sans-serif;
    font-weight: 700;
    line-height: 1.4;
    margin: 20px 0 15px 0;
    text-align: left;
}

/* Class list section fixes */
.cls-section {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.cls-section h3 {
    color: #007bff;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.cls-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cls-section > ul > li {
    margin-bottom: 20px;
    padding: 15px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.cls-section h4 {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.cls-section .hd_lnk {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.cls-section .hd_lnk:hover {
    color: #0056b3;
    text-decoration: none;
}

.cls-section .list_style_type {
    list-style-type: disc;
    padding-left: 20px;
    margin-top: 10px;
}

.cls-section .list_style_type li {
    margin-bottom: 8px;
    padding: 5px 0;
    background: none;
    box-shadow: none;
    border-radius: 0;
}

.cls-section .list_style_type a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.cls-section .list_style_type a:hover {
    color: #007bff;
    text-decoration: underline;
}

/* Mobile content fixes */
@media (max-width: 991.98px) {
    .details-content {
        padding: 15px;
    }
    
    .title-hd {
        font-size: 24px;
    }
    
    .cls-section {
        padding: 15px;
        margin: 15px 0;
    }
    
    .cls-section h3 {
        font-size: 18px;
    }
}

@media (max-width: 767px) {
    .details-content {
        padding: 12px;
        border-radius: 6px;
    }
    
    .title-hd {
        font-size: 22px;
        margin: 15px 0;
    }
    
    .sec-containter p {
        font-size: 15px;
        line-height: 1.5;
    }
    
    .cls-section {
        padding: 12px;
        margin: 12px 0;
    }
    
    .cls-section h3 {
        font-size: 16px;
    }
    
    .cls-section h4 {
        font-size: 16px;
    }
    
    .cls-section > ul > li {
        padding: 12px;
        margin-bottom: 15px;
    }
}

/* ==========================================================================
   5. FAQ SECTION FIXES
   ========================================================================== */

.faq-wrapper {
    border: 1px solid #ddd;
    padding: 20px;
    margin-top: 20px;
    border-radius: 8px;
    background: #fff;
}

.faq-wrapper .accordion .card {
    border: none;
    margin-bottom: 10px;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.faq-wrapper .accordion .card .card-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 15px 20px;
}

.faq-wrapper .accordion .card .card-header a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    display: block;
    width: 100%;
}

.faq-wrapper .accordion .card .card-header a:hover {
    color: #007bff;
}

.faq-wrapper .accordion .card .card-body {
    padding: 20px;
    background: #fff;
}

.faq-wrapper .accordion .card .card-body p {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: #666;
}

/* Mobile FAQ fixes */
@media (max-width: 767px) {
    .faq-wrapper {
        padding: 15px;
        margin-top: 15px;
    }
    
    .faq-wrapper .accordion .card .card-header {
        padding: 12px 15px;
    }
    
    .faq-wrapper .accordion .card .card-header a {
        font-size: 15px;
    }
    
    .faq-wrapper .accordion .card .card-body {
        padding: 15px;
    }
    
    .faq-wrapper .accordion .card .card-body p {
        font-size: 14px;
    }
}

/* ==========================================================================
   6. BREADCRUMB FIXES
   ========================================================================== */

.pbreadcrumb {
    margin-bottom: 20px;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.pbreadcrumb .meta {
    padding-bottom: 0;
    font-weight: 400;
    font-size: 14px;
    margin: 0;
}

.pbreadcrumb .meta li {
    display: inline;
    position: relative;
}

.pbreadcrumb .meta li + li {
    margin-left: 20px;
}

.pbreadcrumb .meta li + li::before {
    position: absolute;
    content: '>';
    left: -12px;
    color: #666;
    font-size: 12px;
}

.pbreadcrumb .meta li a {
    color: #007bff;
    text-decoration: none;
    font-size: 13px;
}

.pbreadcrumb .meta li a:hover {
    text-decoration: underline;
}

.pbreadcrumb .meta li a.active {
    color: #666;
    font-weight: 500;
}

/* Mobile breadcrumb fixes */
@media (max-width: 767px) {
    .pbreadcrumb {
        margin-bottom: 15px;
        padding: 8px 0;
    }
    
    .pbreadcrumb .meta {
        font-size: 12px;
    }
    
    .pbreadcrumb .meta li + li {
        margin-left: 15px;
    }
    
    .pbreadcrumb .meta li + li::before {
        left: -10px;
    }
    
    .pbreadcrumb .meta li a {
        font-size: 12px;
    }
}

/* ==========================================================================
   7. UTILITY CLASSES AND FIXES
   ========================================================================== */

/* Text utilities */
.font-14 { font-size: 14px !important; }
.font-16 { font-size: 16px !important; }
.font-18 { font-size: 18px !important; }

/* Spacing utilities */
.p-m { padding: 12px; }
.p-b-m { padding-bottom: 12px; }
.p-t-s { padding-top: 8px; }
.p-l-o { padding-left: 0 !important; }

/* Text weight utilities */
.txt-wt-b { font-weight: bold; }
.txt-wt-n { font-weight: normal; }

/* Float utilities */
.flt-l { float: left; }

/* Course active state */
.course-active {
    color: #f77112 !important;
    font-weight: bold;
}

/* List styles */
.title-list {
    list-style: disc;
    padding-left: 16px;
}

.ncerlist li {
    list-style: disc;
    margin-left: 15px;
}

/* ==========================================================================
   8. PERFORMANCE AND ACCESSIBILITY FIXES
   ========================================================================== */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus states for accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   9. PRINT STYLES
   ========================================================================== */

@media print {
    .enhanced-sidebar-container,
    .header-area,
    .footer-area,
    .navigation {
        display: none !important;
    }
    
    .blog-details-page .col-lg-8 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    
    .details-content {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    
    .title-hd {
        color: #000 !important;
    }
    
    .sec-containter p {
        color: #000 !important;
    }
}

/* ==========================================================================
   10. BROWSER COMPATIBILITY FIXES
   ========================================================================== */

/* IE11 flexbox fixes */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    .blog-details-page .row {
        display: -ms-flexbox;
        display: flex;
    }
    
    .blog-details-page .col-lg-8,
    .blog-details-page .col-lg-4 {
        -ms-flex: 0 0 auto;
    }
}

/* Safari flexbox fixes */
@supports (-webkit-appearance: none) {
    .blog-details-page .row {
        display: -webkit-flex;
        display: flex;
    }
}

/* ==========================================================================
   11. LOADING AND ANIMATION IMPROVEMENTS
   ========================================================================== */

/* Smooth transitions for layout changes */
.blog-details-page .col-lg-8,
.blog-details-page .col-lg-4,
.sidebar-widget,
.details-content {
    transition: all 0.3s ease;
}

/* Loading state improvements */
.loading-state {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading-state::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   12. FINAL RESPONSIVE ADJUSTMENTS
   ========================================================================== */

/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575.98px) {
    .blog-details-page {
        padding: 5px;
    }
    
    .blog-details-page .container {
        padding-left: 5px;
        padding-right: 5px;
    }
    
    .details-content {
        padding: 10px;
    }
    
    .title-hd {
        font-size: 20px;
    }
    
    .cls-section {
        padding: 10px;
    }
    
    .sidebar-widget {
        margin-bottom: 10px;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .blog-details-page .container {
        max-width: 1140px;
    }
    
    .details-content {
        padding: 30px;
    }
    
    .cls-section {
        padding: 25px;
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .blog-details-page .container {
        max-width: 1200px;
    }
}
