/* ========================================
   EDUALL.VN - Responsive Stylesheet
   ======================================== */

/* ========== Large Desktop (1200px+) ========== */
@media (max-width: 1200px) {
    .container {
        max-width: 1025px;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .system-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .new-courses-section .courses-grid,
    .bestseller-courses-section .courses-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .courses-simple-grid,
    .related-courses-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .featured-course {
        flex-direction: column;
    }

    .featured-image {
        width: 100%;
        min-height: 300px;
    }

    .featured-info {
        width: 100%;
    }
}

/* ========== Desktop/Tablet (1024px) ========== */
@media (max-width: 1024px) {
    .nav-menu > li > a {
        padding: 10px 12px;
        font-size: 13px;
    }

    .courses-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .why-us-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
    }

    .books-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .partners-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ========== Tablet (768px) ========== */
@media (max-width: 768px) {
    /* Top Bar */
    .top-bar .container {
        flex-direction: column;
        gap: 10px;
    }

    .top-bar-left {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }

    .top-bar-right {
        justify-content: center;
    }

    /* Header */
    .main-header {
        min-height: 70px;
    }

    .header-wrapper {
        padding: 10px 0;
    }

    .main-nav {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .logo h1 {
        font-size: 24px;
    }

    .logo .slogan {
        font-size: 10px;
    }

    .cart-total {
        display: none;
    }

    /* Hero Slider */
    .hero-slider {
        height: 400px;
    }

    .slide-content h2 {
        font-size: 32px;
    }

    .slide-content p {
        font-size: 16px;
    }

    .slider-controls button {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    /* Eduall System Section */
    .eduall-system-section {
        padding: 50px 0;
    }

    .system-heading {
        font-size: 26px;
    }

    .system-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .system-card-inner {
        padding: 25px 15px;
    }

    .system-image {
        width: 100px;
        height: 100px;
    }

    .system-content h3 {
        font-size: 16px;
    }

    /* Course Categories Section */
    .course-categories-section {
        padding: 50px 0;
    }

    .categories-heading {
        font-size: 26px;
    }

    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }

    .category-card {
        padding: 25px 15px;
        min-height: 130px;
    }

    .category-card i {
        font-size: 32px;
    }

    .category-card h4 {
        font-size: 12px;
    }

    /* Sections */
    .features-section,
    .courses-section,
    .why-us-section,
    .stats-section,
    .testimonials-section,
    .books-section,
    .partners-section {
        padding: 50px 0;
    }

    .new-courses-wrapper,
    .bestseller-wrapper {
        padding: 40px 0;
    }

    .section-title-italic {
        font-size: 28px;
    }

    .courses-simple-grid,
    .related-courses-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .bestseller-slider {
        flex-direction: column;
    }

    .slider-arrow {
        display: none;
    }

    .featured-course {
        flex-direction: column;
    }

    .featured-image {
        width: 100%;
        min-height: 250px;
    }

    .featured-info {
        width: 100%;
        padding: 20px;
    }

    .featured-title {
        font-size: 20px;
    }

    .featured-price {
        font-size: 22px;
    }

    .featured-actions {
        flex-direction: column;
        gap: 10px;
    }

    .btn-register-course {
        width: 100%;
    }

    .section-header h2 {
        font-size: 26px;
    }

    /* Features */
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .feature-item {
        padding: 20px;
    }

    .feature-icon {
        width: 60px;
        height: 60px;
    }

    .feature-icon i {
        font-size: 24px;
    }

    /* Courses */
    .course-tabs {
        gap: 8px;
    }

    .tab-btn {
        padding: 8px 18px;
        font-size: 13px;
    }

    .courses-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    /* Why Us */
    .why-us-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    /* Stats */
    .stat-number {
        font-size: 36px;
    }

    .stat-label {
        font-size: 14px;
    }

    /* CTA */
    .cta-section {
        padding: 60px 0;
    }

    .cta-content h2 {
        font-size: 28px;
    }

    .cta-content p {
        font-size: 16px;
    }

    /* Books */
    .books-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    /* Partners */
    .partners-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    /* Newsletter */
    .newsletter-form {
        flex-direction: column;
    }

    .newsletter-form input,
    .btn-submit {
        width: 100%;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }

    .footer-bottom-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

/* ========== Mobile (576px) ========== */
@media (max-width: 576px) {
    /* Typography */
    h1 { font-size: 27px; }
    h2 { font-size: 24px; }
    h3 { font-size: 16px; }

    /* Top Bar */
    .top-bar {
        font-size: 11px;
        padding: 6px 0;
    }

    .top-bar-left span {
        font-size: 11px;
    }

    /* Header */
    .header-wrapper {
        padding: 8px 0;
    }

    .logo h1 {
        font-size: 20px;
    }

    .logo .slogan {
        display: none;
    }

    .header-actions {
        gap: 10px;
    }

    .cart-box a {
        padding: 6px 10px;
        font-size: 12px;
    }

    /* Hero Slider */
    .hero-slider {
        height: 350px;
    }

    .slide-content h2 {
        font-size: 24px;
        margin-bottom: 15px;
    }

    .slide-content p {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .btn-primary,
    .btn-accent {
        padding: 10px 20px;
        font-size: 13px;
    }

    .slider-controls {
        display: none;
    }

    /* Eduall System Section */
    .system-heading {
        font-size: 22px;
    }

    .system-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .system-card-inner {
        padding: 20px 15px;
    }

    .system-image {
        width: 80px;
        height: 80px;
    }

    .system-content h3 {
        font-size: 15px;
    }

    .system-content p {
        font-size: 13px;
    }

    .btn-system {
        padding: 8px 20px;
        font-size: 12px;
    }

    /* Course Categories Section */
    .categories-heading {
        font-size: 22px;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .category-card {
        padding: 20px 10px;
        min-height: 110px;
    }

    .category-card i {
        font-size: 28px;
        margin-bottom: 10px;
    }

    .category-card h4 {
        font-size: 11px;
    }

    /* Features */
    .features-grid {
        grid-template-columns: 1fr;
    }

    /* Courses */
    .course-tabs {
        flex-wrap: wrap;
    }

    .tab-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .courses-grid {
        grid-template-columns: 1fr;
    }

    .course-image {
        height: 180px;
    }

    .course-content {
        padding: 15px;
    }

    .current-price {
        font-size: 18px;
    }

    /* New Courses & Bestseller Sections */
    .new-courses-wrapper,
    .bestseller-wrapper {
        padding: 30px 0;
    }

    .section-title-italic {
        font-size: 22px;
        margin-bottom: 20px;
    }

    .filter-bar {
        margin-bottom: 20px;
    }

    .filter-dropdown {
        width: 100%;
    }

    .filter-dropdown select {
        width: 100%;
        padding: 10px 15px;
        font-size: 13px;
    }

    .courses-simple-grid,
    .related-courses-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .course-simple-card {
        border-radius: 10px;
    }

    .card-simple-image {
        height: 180px;
    }

    .card-simple-content {
        padding: 12px;
    }

    .card-simple-category {
        font-size: 11px;
    }

    .card-simple-title {
        font-size: 14px;
    }

    .card-simple-views {
        font-size: 11px;
    }

    .card-simple-price {
        font-size: 16px;
    }

    .btn-load-more {
        padding: 12px 30px;
        font-size: 13px;
    }

    .bestseller-content {
        padding: 0;
    }

    .featured-course {
        border-radius: 10px;
    }

    .featured-image {
        min-height: 200px;
        border-radius: 10px 10px 0 0;
    }

    .featured-info {
        padding: 15px;
    }

    .featured-author {
        font-size: 12px;
        margin-bottom: 8px;
    }

    .featured-category {
        font-size: 10px;
        padding: 4px 10px;
    }

    .featured-title {
        font-size: 18px;
        margin-bottom: 10px;
    }

    .featured-meta {
        font-size: 11px;
        gap: 10px;
        flex-wrap: wrap;
    }

    .featured-price {
        font-size: 20px;
    }

    .course-options select {
        padding: 8px 12px;
        font-size: 12px;
    }

    .btn-register-course {
        padding: 12px 20px;
        font-size: 13px;
    }

    .btn-wishlist {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .related-courses-grid {
        margin-top: 20px;
    }

    /* Why Us */
    .why-us-grid {
        grid-template-columns: 1fr;
    }

    .why-us-item {
        padding: 20px 15px;
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }

    .stat-number {
        font-size: 30px;
    }

    .stat-label {
        font-size: 13px;
    }

    /* Testimonials */
    .testimonial-card {
        padding: 25px 20px;
    }

    .testimonial-content p {
        font-size: 15px;
    }

    .testimonial-author {
        flex-direction: column;
        text-align: center;
    }

    /* CTA */
    .cta-section {
        padding: 50px 0;
    }

    .cta-content h2 {
        font-size: 22px;
    }

    .cta-content p {
        font-size: 14px;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .cta-buttons a {
        width: 100%;
        max-width: 250px;
    }

    /* Books */
    .books-grid {
        grid-template-columns: 1fr;
    }

    .book-image {
        height: 250px;
    }

    /* Partners */
    .partners-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .partner-logo {
        padding: 15px;
    }

    .partner-logo img {
        max-height: 40px;
    }

    /* Newsletter */
    .newsletter-content h2 {
        font-size: 22px;
    }

    .newsletter-form input {
        padding: 12px 15px;
    }

    .btn-submit {
        padding: 12px 20px;
    }

    /* Footer */
    .footer-top {
        padding: 40px 0 30px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .footer-widget h3 {
        font-size: 16px;
        margin-bottom: 15px;
    }

    .footer-widget p,
    .footer-widget ul li a,
    .contact-info li {
        font-size: 13px;
    }

    .social-links a {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }

    .footer-bottom {
        padding: 15px 0;
    }

    .footer-bottom-content p {
        font-size: 12px;
    }

    .payment-methods img {
        height: 25px;
        padding: 3px 8px;
    }

    /* Back to Top */
    .back-to-top {
        width: 40px;
        height: 40px;
        font-size: 16px;
        bottom: 20px;
        right: 20px;
    }

    /* Search Modal */
    .close-search {
        top: 20px;
        right: 20px;
        font-size: 24px;
    }

    .search-form input {
        padding: 15px;
        font-size: 14px;
    }

    .search-form button {
        padding: 15px 20px;
        font-size: 16px;
    }
}

/* ========== Extra Small Mobile (400px) ========== */
@media (max-width: 400px) {
    .container {
        padding: 0 10px;
    }

    .top-bar-left {
        flex-direction: column;
        gap: 5px;
    }

    .top-bar-right a {
        font-size: 11px;
        padding: 4px 10px;
    }

    .hero-slider {
        height: 300px;
    }

    .slide-content h2 {
        font-size: 20px;
    }

    .slide-content p {
        font-size: 13px;
    }

    .section-header h2 {
        font-size: 22px;
    }

    .stats-grid {
        gap: 20px;
    }

    .stat-number {
        font-size: 26px;
    }

    /* New Courses & Bestseller Sections */
    .section-title-italic {
        font-size: 20px;
    }

    .featured-title {
        font-size: 16px;
    }

    .featured-price {
        font-size: 18px;
    }

    .featured-actions {
        flex-direction: column;
        gap: 8px;
    }

    .btn-register-course {
        width: 100%;
        text-align: center;
    }

    .testimonial-content p {
        font-size: 14px;
    }

    .cta-content h2 {
        font-size: 20px;
    }
}

/* ========== Landscape Mobile ========== */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-slider {
        height: 100vh;
        min-height: 300px;
    }

    .slide-content h2 {
        font-size: 24px;
        margin-bottom: 10px;
    }

    .slide-content p {
        font-size: 14px;
        margin-bottom: 15px;
    }
}

/* ========== Print Styles ========== */
@media print {
    .top-bar,
    .main-header,
    .hero-slider,
    .cta-section,
    .newsletter-section,
    .back-to-top,
    .mobile-menu,
    .mobile-menu-overlay,
    .search-modal {
        display: none !important;
    }

    body {
        font-size: 12pt;
        color: #000000;
    }

    .container {
        max-width: 100%;
    }

    a {
        color: #000000;
        text-decoration: underline;
    }
}

/* ========== Animation Keyframes ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* ========== Animation Classes ========== */
.animate-fade-in {
    animation: fadeIn 0.6s ease forwards;
}

.animate-slide-left {
    animation: slideInLeft 0.6s ease forwards;
}

.animate-slide-right {
    animation: slideInRight 0.6s ease forwards;
}

/* ========== Utility Classes ========== */
.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.pt-20 { padding-top: 20px; }
.pb-20 { padding-bottom: 20px; }

/* ========== Focus States for Accessibility ========== */
a:focus,
button:focus,
input:focus {
    outline: 2px solid #39B6FF;
    outline-offset: 2px;
}

/* ========== High Contrast Mode ========== */
@media (prefers-contrast: high) {
    .btn-primary,
    .btn-secondary,
    .btn-accent {
        border: 2px solid currentColor;
    }

    .course-card,
    .book-card,
    .feature-item {
        border: 2px solid #333333;
    }
}

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

    html {
        scroll-behavior: auto;
    }
}
