/* Responsive CSS for all pages */

/* Mobile First Approach - Base styles for mobile */
/* Then progressively enhance for larger screens */

/* ============================================
   BREAKPOINTS:
   - Mobile: < 576px (default)
   - Tablet: 576px - 768px
   - Desktop: 768px - 992px
   - Large Desktop: > 992px
   ============================================ */

/* ============================================
   GLOBAL RESPONSIVE STYLES
   ============================================ */

/* Ensure all images are responsive */
img {
    max-width: 100%;
    height: auto;
}

/* Responsive tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
}

/* Responsive containers */
.container-fluid {
    padding-left: 15px;
    padding-right: 15px;
}

/* ============================================
   NAVBAR RESPONSIVE
   ============================================ */

@media (max-width: 991.98px) {
    .navbar-nav {
        text-align: center;
        padding: 1rem 0;
    }
    
    .navbar-nav .nav-item {
        margin: 0.25rem 0;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem !important;
    }
    
    .navbar-brand {
        font-size: 1.25rem !important;
    }
    
    .btn-login,
    .btn-signup {
        margin: 0.5rem 0 !important;
        width: 100%;
        text-align: center;
        display: block;
    }
    
    .btn-signup {
        margin-left: 0 !important;
    }
}

@media (max-width: 575.98px) {
    .navbar-brand {
        font-size: 1.1rem !important;
    }
    
    .navbar-toggler {
        padding: 0.2rem 0.4rem;
        font-size: 0.9rem;
    }
}

/* ============================================
   HERO SECTION RESPONSIVE
   ============================================ */

@media (max-width: 991.98px) {
    .hero-section {
        padding: 3rem 0 4rem !important;
        min-height: 400px !important;
    }
    
    .hero-title {
        font-size: 2.5rem !important;
    }
    
    .hero-subtitle {
        font-size: 1.1rem !important;
    }
    
    .search-box {
        max-width: 100% !important;
        padding: 0 1rem;
    }
    
    .slider-arrows {
        width: 40px !important;
        height: 40px !important;
        font-size: 1.2rem !important;
    }
    
    .slider-prev {
        left: 10px !important;
    }
    
    .slider-next {
        right: 10px !important;
    }
}

@media (max-width: 767.98px) {
    .hero-section {
        padding: 2rem 0 3rem !important;
        min-height: 350px !important;
    }
    
    .hero-title {
        font-size: 2rem !important;
        line-height: 1.3 !important;
    }
    
    .hero-subtitle {
        font-size: 1rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    .search-box input {
        padding: 0.875rem 3rem 0.875rem 1.25rem !important;
        font-size: 0.9rem !important;
    }
    
    .search-btn {
        padding: 0 1.25rem !important;
        height: calc(100% - 8px) !important;
    }
}

@media (max-width: 575.98px) {
    .hero-section {
        padding: 1.5rem 0 2.5rem !important;
        min-height: 300px !important;
    }
    
    .hero-title {
        font-size: 1.75rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .hero-subtitle {
        font-size: 0.9rem !important;
        margin-bottom: 1.25rem !important;
    }
    
    .slider-arrows {
        width: 35px !important;
        height: 35px !important;
        font-size: 1rem !important;
    }
    
    .slider-nav {
        bottom: 10px !important;
    }
    
    .slider-dot {
        width: 8px !important;
        height: 8px !important;
    }
    
    .slider-dot.active {
        width: 20px !important;
    }
}

/* ============================================
   COURSE CARDS RESPONSIVE
   ============================================ */

@media (max-width: 991.98px) {
    .course-card {
        margin-bottom: 1.5rem;
    }
    
    .course-image {
        height: 180px !important;
    }
}

@media (max-width: 767.98px) {
    .courses-section {
        padding: 3rem 0 !important;
    }
    
    .section-title {
        font-size: 1.75rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    .course-image {
        height: 160px !important;
    }
    
    .course-content {
        padding: 1.25rem !important;
    }
    
    .course-title {
        font-size: 1rem !important;
        min-height: 2.5em !important;
    }
}

@media (max-width: 575.98px) {
    .courses-section {
        padding: 2rem 0 !important;
    }
    
    .section-title {
        font-size: 1.5rem !important;
        margin-bottom: 1.25rem !important;
    }
    
    .course-image {
        height: 140px !important;
    }
    
    .course-content {
        padding: 1rem !important;
    }
    
    .course-title {
        font-size: 0.95rem !important;
        min-height: 2.25em !important;
    }
    
    .price-current {
        font-size: 1.25rem !important;
    }
    
    .btn-enroll {
        padding: 0.625rem !important;
        font-size: 0.9rem !important;
    }
}

/* ============================================
   FORMS RESPONSIVE
   ============================================ */

@media (max-width: 767.98px) {
    .form-control,
    .form-select {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .btn {
        width: 100%;
        padding: 0.75rem 1rem !important;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        margin: 0.25rem 0;
    }
}

@media (max-width: 575.98px) {
    .form-control,
    .form-select {
        padding: 0.625rem 0.875rem !important;
    }
    
    .btn {
        padding: 0.625rem 0.875rem !important;
        font-size: 0.9rem !important;
    }
}

/* ============================================
   TABLES RESPONSIVE
   ============================================ */

@media (max-width: 991.98px) {
    .table {
        font-size: 0.9rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem !important;
    }
}

@media (max-width: 767.98px) {
    .table-responsive {
        border: none;
    }
    
    .table {
        font-size: 0.85rem;
        min-width: 600px; /* Force horizontal scroll on very small screens */
    }
    
    .table th,
    .table td {
        padding: 0.4rem 0.5rem !important;
        white-space: nowrap;
    }
    
    /* Stack table on very small screens */
    .table-stacked {
        display: block;
    }
    
    .table-stacked thead {
        display: none;
    }
    
    .table-stacked tbody,
    .table-stacked tr,
    .table-stacked td {
        display: block;
        width: 100%;
    }
    
    .table-stacked tr {
        border: 1px solid #dee2e6;
        margin-bottom: 1rem;
        padding: 0.5rem;
        border-radius: 4px;
    }
    
    .table-stacked td {
        border: none;
        padding: 0.5rem 0 !important;
        text-align: left !important;
    }
    
    .table-stacked td::before {
        content: attr(data-label) ": ";
        font-weight: 700;
        display: inline-block;
        width: 40%;
    }
}

/* ============================================
   CARDS RESPONSIVE
   ============================================ */

@media (max-width: 991.98px) {
    .card {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 767.98px) {
    .card-body {
        padding: 1rem !important;
    }
    
    .card-title {
        font-size: 1.1rem !important;
    }
    
    .card-text {
        font-size: 0.9rem !important;
    }
}

@media (max-width: 575.98px) {
    .card-body {
        padding: 0.875rem !important;
    }
    
    .card-title {
        font-size: 1rem !important;
    }
    
    .card-text {
        font-size: 0.85rem !important;
    }
}

/* ============================================
   DASHBOARD RESPONSIVE
   ============================================ */

@media (max-width: 991.98px) {
    .sidebar {
        min-height: auto !important;
        margin-bottom: 2rem;
    }
    
    .main-content {
        padding: 1.5rem !important;
    }
    
    .dashboard-header {
        margin-bottom: 1.5rem !important;
    }
    
    .dashboard-header h1 {
        font-size: 1.75rem !important;
    }
    
    .stat-card {
        margin-bottom: 1rem;
    }
}

@media (max-width: 767.98px) {
    .main-content {
        padding: 1rem !important;
    }
    
    .dashboard-header h1 {
        font-size: 1.5rem !important;
    }
    
    .stat-card {
        margin-bottom: 1rem;
    }
    
    .stat-value {
        font-size: 1.75rem !important;
    }
    
    .stat-label {
        font-size: 0.85rem !important;
    }
}

@media (max-width: 575.98px) {
    .main-content {
        padding: 0.75rem !important;
    }
    
    .dashboard-header {
        margin-bottom: 1rem !important;
    }
    
    .dashboard-header h1 {
        font-size: 1.25rem !important;
    }
    
    .stat-value {
        font-size: 1.5rem !important;
    }
    
    .stat-label {
        font-size: 0.8rem !important;
    }
}

/* ============================================
   MODALS RESPONSIVE
   ============================================ */

@media (max-width: 767.98px) {
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-content {
        border-radius: 0.5rem;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem !important;
    }
    
    .modal-title {
        font-size: 1.1rem !important;
    }
}

@media (max-width: 575.98px) {
    .modal-dialog {
        margin: 0.25rem;
        max-width: calc(100% - 0.5rem);
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 0.75rem !important;
    }
    
    .modal-title {
        font-size: 1rem !important;
    }
}

/* ============================================
   GRID SYSTEM RESPONSIVE
   ============================================ */

@media (max-width: 767.98px) {
    .row {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }
    
    .row > * {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    /* Force single column on mobile for certain grids */
    .row.mobile-single-column > * {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* ============================================
   UTILITIES RESPONSIVE
   ============================================ */

@media (max-width: 767.98px) {
    .text-center-mobile {
        text-align: center !important;
    }
    
    .d-none-mobile {
        display: none !important;
    }
    
    .d-block-mobile {
        display: block !important;
    }
    
    .w-100-mobile {
        width: 100% !important;
    }
    
    .mb-mobile {
        margin-bottom: 1rem !important;
    }
    
    .mt-mobile {
        margin-top: 1rem !important;
    }
}

@media (min-width: 768px) {
    .d-none-desktop {
        display: none !important;
    }
}

/* ============================================
   FEATURES SECTION RESPONSIVE
   ============================================ */

@media (max-width: 991.98px) {
    .features-section {
        padding: 3rem 0 !important;
    }
    
    .feature-item {
        padding: 1.5rem !important;
        margin-bottom: 1.5rem;
    }
    
    .feature-icon {
        font-size: 2.5rem !important;
    }
    
    .feature-title {
        font-size: 1.1rem !important;
    }
}

@media (max-width: 767.98px) {
    .features-section {
        padding: 2.5rem 0 !important;
    }
    
    .feature-item {
        padding: 1.25rem !important;
        margin-bottom: 1.25rem;
    }
    
    .feature-icon {
        font-size: 2rem !important;
    }
    
    .feature-title {
        font-size: 1rem !important;
    }
    
    .feature-text {
        font-size: 0.9rem !important;
    }
}

@media (max-width: 575.98px) {
    .features-section {
        padding: 2rem 0 !important;
    }
    
    .feature-item {
        padding: 1rem !important;
        margin-bottom: 1rem;
    }
    
    .feature-icon {
        font-size: 1.75rem !important;
    }
    
    .feature-title {
        font-size: 0.95rem !important;
    }
    
    .feature-text {
        font-size: 0.85rem !important;
    }
}

/* ============================================
   VIDEO EMBED RESPONSIVE
   ============================================ */

.video-responsive {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.video-responsive iframe,
.video-responsive video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

@media (max-width: 767.98px) {
    .video-responsive {
        padding-bottom: 56.25%;
    }
}

/* ============================================
   ADMIN SPECIFIC RESPONSIVE
   ============================================ */

@media (max-width: 991.98px) {
    .sidebar {
        position: relative !important;
        min-height: auto !important;
        margin-bottom: 1.5rem;
    }
    
    .sidebar-menu-item a {
        padding: 0.625rem 1.25rem;
    }
    
    .stat-card {
        margin-bottom: 1rem;
    }
}

@media (max-width: 767.98px) {
    .admin-table-wrapper {
        overflow-x: auto;
    }
    
    .admin-table {
        min-width: 600px;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .action-buttons .btn {
        width: 100%;
        margin: 0.25rem 0;
    }
}

/* ============================================
   COURSE DETAILS RESPONSIVE
   ============================================ */

@media (max-width: 991.98px) {
    .course-details-hero {
        padding: 2rem 0 !important;
    }
    
    .course-details-title {
        font-size: 2rem !important;
    }
    
    .course-details-sidebar {
        margin-top: 2rem;
    }
}

@media (max-width: 767.98px) {
    .course-details-hero {
        padding: 1.5rem 0 !important;
    }
    
    .course-details-title {
        font-size: 1.75rem !important;
    }
    
    .course-details-content {
        padding: 1rem 0 !important;
    }
    
    .course-details-sidebar {
        margin-top: 1.5rem;
    }
    
    .course-price-section {
        text-align: center;
    }
    
    .course-enroll-btn {
        width: 100%;
        margin-top: 1rem;
    }
}

@media (max-width: 575.98px) {
    .course-details-title {
        font-size: 1.5rem !important;
    }
    
    .course-modules-list {
        padding: 0.5rem !important;
    }
    
    .module-item {
        padding: 0.75rem !important;
    }
}

/* ============================================
   CHECKOUT PAGE RESPONSIVE
   ============================================ */

@media (max-width: 767.98px) {
    .checkout-container {
        flex-direction: column;
    }
    
    .checkout-form,
    .checkout-summary {
        width: 100% !important;
        margin-bottom: 1.5rem;
    }
    
    .checkout-summary {
        order: -1;
    }
}

/* ============================================
   LANDING PAGE RESPONSIVE
   ============================================ */

@media (max-width: 991.98px) {
    .landing-hero {
        padding: 3rem 0 !important;
    }
    
    .landing-title {
        font-size: 2.5rem !important;
    }
}

@media (max-width: 767.98px) {
    .landing-hero {
        padding: 2rem 0 !important;
    }
    
    .landing-title {
        font-size: 2rem !important;
    }
    
    .landing-subtitle {
        font-size: 1rem !important;
    }
    
    .landing-features {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 575.98px) {
    .landing-title {
        font-size: 1.75rem !important;
    }
    
    .landing-subtitle {
        font-size: 0.9rem !important;
    }
}

/* ============================================
   STUDENT DASHBOARD RESPONSIVE
   ============================================ */

@media (max-width: 767.98px) {
    .student-course-card {
        margin-bottom: 1.5rem;
    }
    
    .progress-bar-wrapper {
        margin-top: 0.5rem;
    }
    
    .course-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .course-actions .btn {
        width: 100%;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.mobile-hidden {
    display: block;
}

.desktop-hidden {
    display: none;
}

@media (max-width: 767.98px) {
    .mobile-hidden {
        display: none !important;
    }
    
    .desktop-hidden {
        display: block !important;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .navbar,
    .sidebar,
    .btn,
    .footer,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        padding: 0 !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
}

