/* Mobile Responsive CSS for Academic Platform */
/* This file should be included in all pages for consistent mobile experience */

/* Mobile Navigation Styles */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-menu {
    display: flex;
    gap: 2.2rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Mobile Responsive Breakpoints */
@media (max-width: 768px) {
    /* General Layout */
    .main-section, footer > div, .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Mobile Navigation */
    .mobile-nav-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #14236a;
        flex-direction: column;
        gap: 0;
        padding: 1rem 0;
        box-shadow: 0 4px 8px rgba(0,0,0,0.2);
        z-index: 1000;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu a {
        display: block;
        padding: 1rem 2rem;
        border-bottom: 1px solid #2a3a5a;
    }

    /* Header/Navbar */
    header, .main-navbar {
        padding: 0.7rem 1rem;
    }

    .logo {
        font-size: 1.3rem;
    }

    .logo img {
        height: 60px;
        width: auto;
    }

    /* Sidebar Mobile */
    .sidebar {
        min-width: 100%;
        box-shadow: none;
        padding: 1rem 0.5rem;
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        border-radius: 0;
        margin: 0 0 1.5rem 0;
        background: #eaf6fa;
    }

    .sidebar ul {
        display: flex;
        flex-direction: row;
        gap: 0.5rem;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 0;
        margin: 0;
    }

    .sidebar li {
        margin-bottom: 0;
        white-space: nowrap;
    }

    .sidebar a {
        padding: 0.5rem 0.8rem;
        font-size: 0.9rem;
        border-radius: 4px;
    }

    /* Main Content */
    main {
        padding: 1rem 0.5rem;
    }

    section {
        padding: 1rem 0.7rem;
        margin-bottom: 1.5rem;
    }

    h1 {
        font-size: 1.8rem;
    }

    /* Hero Section Mobile */
    .hero-banner {
        height: 60vh;
        min-height: 400px;
    }

    .hero-banner h1 {
        font-size: 2rem;
        margin-bottom: 1rem;
        padding: 0 1rem;
    }

    .hero-banner .subtitle {
        font-size: 1.2rem;
        padding: 0 1rem;
    }

    /* Hero Buttons Mobile */
    .hero-banner .hero-buttons {
        position: absolute;
        top: 20px;
        left: 20px;
        right: 20px;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        z-index: 3;
    }

    .hero-banner .hero-buttons a {
        padding: 0.5rem 1rem;
        font-size: 1rem;
        text-align: center;
    }

    /* Row Sections Mobile */
    .row-section {
        flex-direction: column;
        gap: 1rem;
    }

    .row-section .col-text {
        padding: 1.5rem 1rem;
        font-size: 1rem;
    }

    .row-section .col-text h2 {
        font-size: 1.2rem;
    }

    /* Feature Cards Mobile */
    .feature-cards {
        gap: 1rem;
    }

    .feature-card {
        min-width: 150px;
        max-width: 200px;
        padding: 1rem;
    }

    .feature-card .icon {
        font-size: 1.8rem;
    }

    .feature-card h3 {
        font-size: 1rem;
    }

    .feature-card p {
        font-size: 0.9rem;
    }

    /* Sample Cards Mobile */
    .sample-row {
        gap: 1rem;
    }

    .sample-card {
        min-width: 150px;
        max-width: 180px;
        padding: 1rem;
    }

    .sample-thumb {
        width: 80px;
        height: 80px;
    }

    .sample-title {
        font-size: 0.95rem;
    }

    /* Lessons Cards Mobile */
    .lessons-cards {
        gap: 1.2rem;
        justify-content: center;
        flex-wrap: wrap;
    }

    .lesson-card {
        min-width: 140px;
        max-width: 200px;
        padding: 1rem 0.7rem;
        flex: 1 1 140px;
    }

    .lesson-thumb {
        width: 110px;
        height: 110px;
    }

    .lesson-title {
        font-size: 0.95rem;
    }

    .lesson-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .lesson-actions .download, 
    .lesson-actions .watch {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }

    /* Videos Grid Mobile */
    .videos-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .video-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem 0.7rem;
    }

    .video-thumb {
        margin-bottom: 0.5rem;
        width: 90px;
        height: 90px;
    }

    .video-title {
        font-size: 0.95rem;
    }

    .video-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .video-actions .watch {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }

    /* Forms Mobile */
    form.filter, form.ask-question {
        flex-direction: column;
        gap: 1rem;
    }

    form.filter select, 
    form.ask-question textarea {
        width: 100%;
        padding: 0.8rem;
        font-size: 1rem;
    }

    form.filter button, 
    form.ask-question button {
        width: 100%;
        padding: 0.8rem;
        font-size: 1rem;
    }

    /* Footer Mobile */
    footer > div {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }

    footer > div > div {
        min-width: auto;
    }

    /* Progress Bar Mobile */
    .progress-bar {
        height: 28px;
    }

    .progress-value {
        line-height: 28px;
        font-size: 1rem;
    }

    /* Points and Badges Mobile */
    .points-badges span, 
    .my-points span {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }

    .my-badges li, 
    .points-badges h3 {
        font-size: 0.95rem;
    }

    /* Leaderboard Mobile */
    .leaderboard li {
        padding: 0.8rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .main-section, footer > div {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .hero-banner {
        height: 50vh;
        min-height: 350px;
    }

    .hero-banner h1 {
        font-size: 1.5rem;
    }

    .hero-banner .subtitle {
        font-size: 1rem;
    }

    .feature-card {
        min-width: 120px;
        max-width: 150px;
        padding: 0.8rem;
    }

    .sample-card {
        min-width: 120px;
        max-width: 150px;
        padding: 0.8rem;
    }

    .sample-thumb {
        width: 60px;
        height: 60px;
    }

    .sample-title {
        font-size: 0.9rem;
    }

    .sample-actions a {
        padding: 0.2rem 0.8rem;
        font-size: 0.9rem;
    }

    .lesson-card {
        min-width: 120px;
        max-width: 150px;
        padding: 0.8rem;
    }

    .lesson-thumb {
        width: 80px;
        height: 80px;
    }

    .video-thumb {
        width: 70px;
        height: 70px;
    }
}

/* Specific fixes for phone dimensions 400×704 */
@media (max-width: 400px) {
    .main-section, footer > div {
        padding-left: 0.3rem;
        padding-right: 0.3rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Navigation fixes for narrow screens */
    .main-navbar {
        padding: 0.5rem 0.5rem;
    }

    .logo img {
        height: 60px !important;
        width: auto !important;
    }

    .mobile-nav-toggle {
        font-size: 1.2rem;
        padding: 0.3rem;
    }

    /* Hero section fixes */
    .hero-banner {
        width: 100vw !important;
        min-width: 100vw !important;
        height: 45vh !important;
        min-height: 300px !important;
    }

    .hero-banner h1 {
        font-size: 1.3rem !important;
        margin-bottom: 0.8rem !important;
        padding: 0 0.5rem !important;
        line-height: 1.3 !important;
    }

    .hero-banner .subtitle {
        font-size: 0.9rem !important;
        padding: 0 0.5rem !important;
    }

    /* Hero buttons fixes */
    .hero-banner .hero-buttons {
        top: 15px !important;
        left: 10px !important;
        right: 10px !important;
        gap: 0.3rem !important;
    }

    .hero-banner .hero-buttons a {
        padding: 0.4rem 0.8rem !important;
        font-size: 0.9rem !important;
        border-radius: 6px !important;
    }

    /* Row sections fixes */
    .row-section {
        gap: 0.8rem !important;
        margin-bottom: 1.5rem !important;
    }

    .row-section .col-text {
        padding: 1rem 0.8rem !important;
        font-size: 0.9rem !important;
        min-width: auto !important;
        flex: 1 1 auto !important;
    }

    .row-section .col-text h2 {
        font-size: 1.1rem !important;
        margin-bottom: 0.8rem !important;
    }

    .row-section .col-img {
        min-width: auto !important;
        flex: 1 1 auto !important;
    }

    .row-section .col-img img {
        max-height: 250px !important;
    }

    /* Feature section fixes */
    .feature-section {
        padding: 1.5rem 0 !important;
        margin-bottom: 1.5rem !important;
    }

    .feature-section h2 {
        font-size: 1.2rem !important;
        margin-bottom: 1rem !important;
    }

    .feature-cards {
        gap: 0.8rem !important;
        justify-content: center !important;
    }

    .feature-card {
        min-width: 100px !important;
        max-width: 130px !important;
        padding: 0.6rem !important;
        flex: 1 1 100px !important;
    }

    .feature-card .icon {
        font-size: 1.5rem !important;
        margin-bottom: 0.3rem !important;
    }

    .feature-card h3 {
        font-size: 0.9rem !important;
        margin: 0.3rem 0 0.1rem 0 !important;
    }

    .feature-card p {
        font-size: 0.8rem !important;
        line-height: 1.3 !important;
    }

    /* Sample section fixes */
    .sample-section {
        padding: 1.5rem 0 !important;
        margin-bottom: 1.5rem !important;
    }

    .sample-section h2 {
        font-size: 1.2rem !important;
        margin-bottom: 1rem !important;
    }

    .sample-row {
        gap: 0.8rem !important;
        justify-content: center !important;
    }

    .sample-card {
        min-width: 100px !important;
        max-width: 130px !important;
        padding: 0.6rem !important;
        flex: 1 1 100px !important;
        gap: 0.5rem !important;
    }

    .sample-thumb {
        width: 50px !important;
        height: 50px !important;
        margin: 0 auto 0.3rem auto !important;
    }

    .sample-title {
        font-size: 0.85rem !important;
        line-height: 1.2 !important;
    }

    .sample-actions {
        gap: 0.3rem !important;
    }

    .sample-actions a {
        padding: 0.15rem 0.6rem !important;
        font-size: 0.8rem !important;
    }

    /* Lessons cards fixes */
    .lesson-card {
        min-width: 100px !important;
        max-width: 130px !important;
        padding: 0.6rem !important;
        flex: 1 1 100px !important;
    }

    .lesson-thumb {
        width: 60px !important;
        height: 60px !important;
    }

    .lesson-title {
        font-size: 0.85rem !important;
    }

    .lesson-actions .download, 
    .lesson-actions .watch {
        padding: 0.3rem 0.6rem !important;
        font-size: 0.8rem !important;
    }

    /* Video cards fixes */
    .video-card {
        padding: 0.6rem !important;
    }

    .video-thumb {
        width: 50px !important;
        height: 50px !important;
    }

    .video-title {
        font-size: 0.85rem !important;
    }

    .video-actions .watch {
        padding: 0.3rem 0.6rem !important;
        font-size: 0.8rem !important;
    }

    /* Footer fixes */
    footer {
        padding: 2rem 0 1rem 0 !important;
        font-size: 0.9rem !important;
    }

    footer > div {
        padding: 0 0.3rem !important;
        gap: 1rem !important;
    }

    footer > div > div {
        min-width: auto !important;
        flex: 1 1 auto !important;
    }

    footer h3 {
        font-size: 1.1rem !important;
        margin-bottom: 0.8rem !important;
    }

    footer ul li {
        margin-bottom: 0.3rem !important;
    }

    footer a {
        font-size: 0.85rem !important;
    }

    /* Ensure no horizontal scroll */
    body {
        overflow-x: hidden !important;
        width: 100% !important;
    }

    /* Fix any potential width issues */
    * {
        box-sizing: border-box !important;
    }

    /* Ensure images don't overflow */
    img {
        max-width: 100% !important;
        height: auto !important;
    }
}

/* Additional fixes for very narrow screens */
@media (max-width: 360px) {
    .main-section, footer > div {
        padding-left: 0.2rem;
        padding-right: 0.2rem;
    }

    .hero-banner h1 {
        font-size: 1.1rem !important;
    }

    .hero-banner .subtitle {
        font-size: 0.8rem !important;
    }

    .feature-card, .sample-card, .lesson-card {
        min-width: 90px !important;
        max-width: 110px !important;
        padding: 0.5rem !important;
    }

    .sample-thumb, .lesson-thumb {
        width: 40px !important;
        height: 40px !important;
    }

    .video-thumb {
        width: 40px !important;
        height: 40px !important;
    }
}

/* JavaScript for mobile menu functionality */
.mobile-menu-active {
    overflow: hidden;
}

/* Additional mobile optimizations */
@media (max-width: 900px) {
    .row-section, .sample-row {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .main-section {
        padding: 0 0 1.5rem 0;
    }
    
    /* Table responsive */
    table {
        font-size: 0.9rem;
    }
    
    th, td {
        padding: 0.5rem 0.3rem;
    }
    
    /* Form responsive */
    input[type="text"], 
    input[type="email"], 
    input[type="password"], 
    input[type="number"],
    textarea,
    select {
        font-size: 1rem;
        padding: 0.8rem;
    }
    
    /* Button responsive */
    button, 
    input[type="submit"], 
    input[type="button"] {
        font-size: 1rem;
        padding: 0.8rem 1.2rem;
    }
} 