/*!
 * Home Page Layout & Design Fixes
 * Fixes for desktop and mobile responsiveness
 * Version: 1.0.0
 */

/* ==========================================================================
   1. CRITICAL LAYOUT FIXES
   ========================================================================== */

/* Fix body and html overflow issues */
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
    font-family: 'Exo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
}

/* Container fixes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

@media (max-width: 767px) {
    .container {
        padding: 0 10px;
    }
}

/* ==========================================================================
   2. HEADER FIXES
   ========================================================================== */

/* Fix header layout issues */
.header-area {
    position: relative;
    z-index: 1000;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Logo fixes */
.header-logo img {
    max-width: 180px;
    height: auto;
    transition: all 0.3s ease;
}

@media (max-width: 767px) {
    .header-logo {
        text-align: center;
        margin-bottom: 10px;
    }
    
    .header-logo img {
        max-width: 150px;
    }
}

/* Navigation fixes */
.navigation {
    padding: 15px 0;
}

@media (max-width: 767px) {
    .navigation {
        padding: 10px 0;
    }
}

/* Mobile menu toggle fixes */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    position: relative;
    z-index: 1001;
}

@media (max-width: 767px) {
    .nav-toggle {
        display: block;
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
    }
}

.nav-toggle::before {
    content: "";
    position: absolute;
    width: 24px;
    height: 2px;
    background-color: #07294d;
    border-radius: 10px;
    box-shadow: 0 0.5em 0 0 #07294d, 0 1em 0 0 #07294d;
    transition: all 0.3s ease;
}

.nav-toggle.active::before {
    transform: rotate(45deg);
    box-shadow: 0 0 0 0 transparent, 0 0 0 0 transparent;
}

.nav-toggle.active::after {
    content: "";
    position: absolute;
    width: 24px;
    height: 2px;
    background-color: #07294d;
    border-radius: 10px;
    transform: rotate(-45deg);
}

/* Search fixes */
.header-search {
    position: relative;
    width: 100%;
    max-width: 400px;
}

@media (max-width: 767px) {
    .header-search {
        margin: 10px 0;
        max-width: 100%;
    }
}

.header-search input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.header-search input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.header-search button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: #007bff;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.header-search button:hover {
    background: #0056b3;
}

/* ==========================================================================
   3. SLIDER SECTION FIXES
   ========================================================================== */

.slider-area {
    position: relative;
    overflow: hidden;
}

.single-slider {
    min-height: 500px;
    display: flex;
    align-items: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

@media (max-width: 767px) {
    .single-slider {
        min-height: 400px;
        padding: 40px 0;
    }
}

.single-slider::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.slider-content {
    position: relative;
    z-index: 2;
    color: white;
    max-width: 600px;
}

.slider-content .title {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
}

@media (max-width: 991px) {
    .slider-content .title {
        font-size: 36px;
    }
}

@media (max-width: 767px) {
    .slider-content .title {
        font-size: 28px;
        text-align: center;
    }
}

.slider-btn {
    margin-top: 30px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

@media (max-width: 767px) {
    .slider-btn {
        justify-content: center;
        flex-direction: column;
        align-items: center;
    }
}

.slider-btn .main-btn {
    padding: 12px 30px;
    background: #f77112;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-block;
}

.slider-btn .main-btn:hover {
    background: #0c8b51;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

@media (max-width: 767px) {
    .slider-btn .main-btn {
        width: 200px;
        text-align: center;
        margin-bottom: 10px;
    }
}

/* ==========================================================================
   4. CLASS SECTION FIXES
   ========================================================================== */

.top-courses-area {
    padding: 80px 0;
    background: #f8f9fa;
}

@media (max-width: 767px) {
    .top-courses-area {
        padding: 40px 0;
    }
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title .title {
    font-size: 36px;
    font-weight: 700;
    color: #07294d;
    margin-bottom: 15px;
}

@media (max-width: 767px) {
    .section-title .title {
        font-size: 28px;
    }
}

.section-title .section-description {
    font-size: 16px;
    color: #6c757d;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

/* New Class Cards */
.classes-wrapper {
    margin-top: 50px;
}

.classes-grid {
    display: flex;
    flex-wrap: wrap;
    margin: -15px;
}

.class-item {
    padding: 15px;
}

.single-class-card {
    background: white;
    border-radius: 20px;
    padding: 25px 20px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transition: all 0.4s ease;
    height: 100%;
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
}

.single-class-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    border-color: #f77112;
}

.class-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #f77112 0%, #0c8b51 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    font-weight: 700;
    margin: 0 auto 20px;
    transition: all 0.3s ease;
}

.single-class-card:hover .class-number {
    transform: scale(1.1);
}

.class-content {
    position: relative;
    z-index: 2;
}

.class-title {
    margin-bottom: 10px;
}

.class-title a {
    color: #07294d;
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
    transition: color 0.3s ease;
}

.class-title a:hover {
    color: #f77112;
}

.class-level {
    color: #6c757d;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
}

.class-subjects {
    margin-bottom: 20px;
}

.class-subjects small {
    color: #6c757d;
    font-size: 11px;
    line-height: 1.4;
}

.class-resources {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.resource-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    flex: 1;
    min-width: 60px;
}

.resource-item i {
    color: #f77112;
    font-size: 16px;
}

.resource-item span {
    font-size: 10px;
    color: #6c757d;
    text-align: center;
    line-height: 1.2;
}

.class-actions {
    margin-top: 20px;
}

.btn-explore {
    background: linear-gradient(135deg, #f77112 0%, #0c8b51 100%);
    color: white;
    text-decoration: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.btn-explore:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(247, 113, 18, 0.3);
    color: white;
    text-decoration: none;
}

.btn-explore i {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.btn-explore:hover i {
    transform: translateX(3px);
}

/* Class Overlay */
.class-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(247, 113, 18, 0.95) 0%, rgba(12, 139, 81, 0.95) 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    z-index: 3;
}

.single-class-card:hover .class-overlay {
    opacity: 1;
    visibility: visible;
}

.overlay-content {
    text-align: center;
    color: white;
    padding: 20px;
}

.overlay-content h4 {
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
}

.resource-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.resource-list li {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 12px;
}

.resource-list i {
    color: #28a745;
    font-size: 12px;
}

.btn-start-learning {
    background: white;
    color: #f77112;
    text-decoration: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-start-learning:hover {
    background: #f8f9fa;
    color: #0c8b51;
    text-decoration: none;
    transform: translateY(-2px);
}

/* Info Stats Section */
.classes-info-section {
    margin-top: 60px;
    padding: 40px 0;
}

.info-stats {
    margin-bottom: 40px;
}

.stat-item {
    text-align: center;
    margin-bottom: 30px;
}

.stat-number {
    font-size: 36px;
    font-weight: 700;
    color: #f77112;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
}

.cta-section h3 {
    color: #07294d;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 15px;
}

.cta-section p {
    color: #6c757d;
    font-size: 16px;
    margin-bottom: 25px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Mobile Responsive Adjustments */
@media (max-width: 767px) {
    .classes-grid {
        margin: -10px;
    }
    
    .class-item {
        padding: 10px;
    }
    
    .single-class-card {
        padding: 20px 15px;
    }
    
    .class-number {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .class-title a {
        font-size: 16px;
    }
    
    .resource-item {
        min-width: 50px;
    }
    
    .resource-item i {
        font-size: 14px;
    }
    
    .resource-item span {
        font-size: 9px;
    }
    
    .btn-explore {
        padding: 6px 15px;
        font-size: 11px;
    }
    
    .stat-number {
        font-size: 28px;
    }
    
    .cta-section h3 {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .resource-item span {
        display: none;
    }
    
    .class-resources {
        justify-content: center;
        gap: 15px;
    }
    
    .resource-item {
        min-width: auto;
    }
}

/* ==========================================================================
   5. FEATURES SECTION FIXES
   ========================================================================== */

.features-area {
    padding: 80px 0;
    background: white;
}

@media (max-width: 767px) {
    .features-area {
        padding: 40px 0;
    }
}

.features-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

@media (max-width: 767px) {
    .features-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-top: 30px;
    }
}

.single-features-item {
    text-align: center;
    padding: 30px 20px;
    background: #f8f9fa;
    border-radius: 15px;
    transition: all 0.3s ease;
}

.single-features-item:hover {
    background: white;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    transform: translateY(-5px);
}

.item-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #f77112 0%, #0c8b51 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: white;
    font-size: 32px;
}

.item-content h4 {
    color: #07294d;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
}

.item-content p {
    color: #6c757d;
    font-size: 14px;
    line-height: 1.6;
}

/* ==========================================================================
   6. TESTIMONIAL SECTION FIXES
   ========================================================================== */

.testimonials-area {
    padding: 80px 0;
    background: #f8f9fa;
}

@media (max-width: 767px) {
    .testimonials-area {
        padding: 40px 0;
    }
}

.single-testimonial-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    position: relative;
}

.single-testimonial-content::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 30px;
    font-size: 60px;
    color: #f77112;
    font-family: serif;
}

.content-text p {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 20px;
    font-style: italic;
}

.content-meta {
    display: flex;
    align-items: center;
    gap: 15px;
}

.content-meta .name {
    font-weight: 600;
    color: #07294d;
    font-size: 16px;
}

.content-meta .designation {
    color: #6c757d;
    font-size: 14px;
}

/* ==========================================================================
   7. FOOTER FIXES
   ========================================================================== */

.footer-area {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 50px 0 20px;
}

.footer-widget {
    margin-bottom: 30px;
}

.footer-title {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: #f77112;
}

.footer-link .link-list li {
    margin-bottom: 8px;
}

.footer-link .link-list li a {
    color: #bdc3c7;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-link .link-list li a:hover {
    color: #f77112;
}

/* ==========================================================================
   8. RESPONSIVE UTILITIES
   ========================================================================== */

/* Hide on mobile */
@media (max-width: 767px) {
    .d-none-mobile {
        display: none !important;
    }
}

/* Show only on mobile */
.d-block-mobile {
    display: none !important;
}

@media (max-width: 767px) {
    .d-block-mobile {
        display: block !important;
    }
}

/* Text alignment utilities */
@media (max-width: 767px) {
    .text-center-mobile {
        text-align: center !important;
    }
}

/* Spacing utilities */
@media (max-width: 767px) {
    .mb-mobile-20 {
        margin-bottom: 20px !important;
    }
    
    .mt-mobile-20 {
        margin-top: 20px !important;
    }
    
    .p-mobile-15 {
        padding: 15px !important;
    }
}

/* ==========================================================================
   9. PERFORMANCE OPTIMIZATIONS
   ========================================================================== */

/* Optimize animations for better performance */
* {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-perspective: 1000;
    perspective: 1000;
}

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

/* Optimize images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* ==========================================================================
   10. ACCESSIBILITY IMPROVEMENTS
   ========================================================================== */

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

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .single-library,
    .single-features-item,
    .single-testimonial-content {
        border: 2px solid #000;
    }
}

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