@media (max-width: 768px) {
    /* Header Adjustments */
    .menu-toggle {
        display: block; /* Show hamburger */
    }

    .nav-links {
        display: none; /* Hide links by default */
        position: absolute;
        top: 70px; /* Height of header */
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
        text-align: center;
        gap: 15px;
    }

    /* The class JS adds to show the menu */
    .nav-links.active {
        display: flex;
        animation: slideDown 0.3s ease forwards;
    }

    .auth-buttons {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
        margin-top: 15px;
        border-top: 1px solid #eee;
        padding-top: 15px;
    }

    .btn {
        width: 100%; /* Full width buttons on mobile */
    }

/* =========================================
   HERO RESPONSIVENESS
   ========================================= */
/* =========================================
   HERO RESPONSIVENESS
   ========================================= */

@media (max-width: 992px) {
    .hero-section {
        padding: 120px 0 80px;
        min-height: auto;
        text-align: center;
        background-position: center top;
    }

    .hero-container {
        display: flex;
        justify-content: center;
    }

    .hero-content {
        max-width: 100%;
    }

    .badge-pill {
        margin: 0 auto 25px;
    }

    .hero-content h1 {
        font-size: 3rem;
    }
    
    .hero-content p {
        margin-left: auto;
        margin-right: auto;
        font-size: 1.1rem;
    }

    .hero-buttons {
        justify-content: center;
    }

    .trust-row {
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 15px;
    }

    .hero-buttons .btn {
        width: 100%;
    }
}
    /* Certificate & Sidebar */
    .sidebar { display: none; } /* Hide sidebar on mobile lesson view */
    #cert-preview { width: 100%; height: auto; border-width: 5px; padding: 10px; }
    #s-name { font-size: 2.5rem; }
}
/* --- Mobile & Tablet Optimization --- */

@media screen and (max-width: 900px) {
    
    #testimonials-section {
        padding: 60px 20px;
        min-height: auto;
    }

    .testimonials-wrapper {
        flex-direction: column; /* Stack vertically */
        align-items: center;
    }

    /* Adjust Quote Card for Mobile */
    .testimonial-quote-card {
        width: 100%;
        max-width: 600px;
        flex: auto;
        padding: 40px 30px;
        text-align: center; /* Center align text on mobile for better balance */
        margin-bottom: -30px; /* Slight vertical overlap over the video */
        border-bottom-left-radius: 0; 
        border-bottom-right-radius: 0;
    }

    .testimonial-content {
        font-size: 1.25rem; /* Slightly smaller text */
    }

    /* Adjust Video Card for Mobile */
    .testimonial-video-card {
        width: 100%;
        max-width: 600px;
        flex: auto;
        margin-left: 0; /* Remove the horizontal overlap */
        border-radius: var(--card-radius);
        /* If using vertical overlap, ensure top corners are square or specific styling */
        z-index: 5;
    }
}

/* Very Small Screens */
@media screen and (max-width: 480px) {
    .testimonial-quote-card {
        padding: 30px 20px;
    }
    
    .play-button-wrapper {
        width: 60px;
        height: 60px;
    }
    
    .play-button-wrapper i {
        font-size: 18px;
    }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Tablet View (max-width: 992px) */
@media screen and (max-width: 992px) {
    .cpr-course-grid {
        grid-template-columns: repeat(2, 1fr); /* Change to 2 columns */
        gap: 25px;
    }

    .cpr-title {
        font-size: 24px;
    }
}

/* Mobile View (max-width: 576px) */
@media screen and (max-width: 576px) {
    #cpr-main-course {
        padding: 40px 0;
    }

    .cpr-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .cpr-course-grid {
        grid-template-columns: 1fr; /* Change to 1 column */
        gap: 20px;
    }

    .cpr-card-image-wrapper {
        height: 200px; /* Slightly taller images on mobile */
    }

    .cpr-course-title {
        font-size: 18px;
    }
}
/* =========================================
   MOBILE EXAM OPTIMIZATIONS
   ========================================= */

@media (max-width: 768px) {

    /* 1. Fix the Header Spacing */
    .exam-header {
        flex-direction: column; /* Stack vertically */
        height: auto;
        padding: 15px;
        gap: 15px; /* Space between Logo and Timer */
    }

    .logo-text {
        width: 100%;
        display: flex;
        justify-content: center; /* Center the logo */
        align-items: center;
        border-bottom: 1px solid #f0f0f0; /* Light divider */
        padding-bottom: 10px;
    }

    .exam-controls {
        width: 100%;
        justify-content: space-between; /* Spread Timer and Exit button */
        padding: 0 10px;
    }

    .timer {
        font-size: 1rem;
        background: #f8f9fa;
        padding: 5px 10px;
        border-radius: 4px;
    }

    /* 2. Fix the Question Area */
    .exam-container {
        padding: 15px;
        margin-top: 10px;
    }

    .question-bubble {
        padding: 20px;
        min-width: 100%;
    }
    
    .question-bubble h2 {
        font-size: 1.1rem; /* Slightly smaller text for mobile */
        line-height: 1.5;
    }

    /* 3. Fix the Buttons (Stack them for easier clicking) */
    .exam-footer {
        flex-direction: column-reverse; /* Put 'Next' on top, 'Previous' below */
        gap: 15px;
        padding-bottom: 30px; /* Extra space at bottom of screen */
    }

    .exam-footer button {
        width: 100%; /* Full width buttons */
        padding: 14px; /* Taller touch target */
        font-size: 1rem;
        justify-content: center;
    }

    /* 4. Fix Answer Pills */
    .options-grid {
        grid-template-columns: 1fr; /* Stack answers vertically */
        gap: 12px;
    }

    .option-pill {
        padding: 12px;
    }
}

/* =========================================
   FINAL MOBILE POLISH
   ========================================= */

@media (max-width: 480px) {
    
    /* 1. Dashboard Chart Scaling */
    .chart-container {
        height: 180px; /* Slightly smaller on tiny screens */
        width: 180px;
    }
    
    .chart-center-text { font-size: 1.5rem; }

    /* 2. Review Section Spacing */
    .review-card {
        padding: 15px; /* Less padding to save space */
    }

    .review-header {
        flex-direction: column; /* Stack Q# and Status */
        gap: 5px;
    }

    /* 3. Lesson Page Video Height */
    .video-container {
        margin-bottom: 20px;
    }

    /* 4. Modal Popups (Exam Result) */
    .modal-card {
        width: 95%;
        padding: 20px;
    }
    
    .modal-icon { font-size: 2.5rem; }
    
    .modal-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-actions button {
        width: 100%;
    }
}
/* =========================================
   MOBILE EXAM OPTIMIZATIONS
   (Add to bottom of css/responsive.css)
   ========================================= */

@media (max-width: 768px) {

    /* 1. Header Layout: Stack Logo and Controls */
    .exam-header {
        flex-direction: column;
        height: auto;
        padding: 15px;
        gap: 15px;
    }

    .logo-text {
        width: 100%;
        display: flex;
        justify-content: center;
        border-bottom: 1px solid #f0f0f0;
        padding-bottom: 10px;
    }

    .exam-controls {
        width: 100%;
        justify-content: space-between; /* Timer left, Exit right */
    }

    /* 2. Question Bubble: Full width */
    .exam-container {
        padding: 15px;
        margin-top: 10px;
    }

    .question-bubble {
        min-width: 100%;
        padding: 20px;
    }
    
    .question-bubble h2 {
        font-size: 1.1rem;
    }

    /* 3. Answer Options: Stack vertically */
    .options-grid {
        grid-template-columns: 1fr; /* 1 column instead of 2 */
        gap: 12px;
    }

    .option-pill {
        padding: 12px;
    }

    /* 4. Navigation Buttons: Side-by-Side with Spacing */
    .exam-footer {
        flex-direction: row; /* Force side-by-side alignment */
        gap: 15px; /* Add space between them */
        padding-bottom: 30px;
    }

    .exam-footer button {
        width: 48%; /* Each button takes slightly less than half width */
        flex: 1; /* Ensures they grow equally */
        padding: 12px; /* Comfortable height */
        font-size: 0.9rem; /* Slightly smaller text to fit single line */
        justify-content: center;
        white-space: nowrap; /* Prevent text from wrapping */
    }

    /* 5. Review Section Buttons: Side-by-Side */
    #review-container .text-center {
        display: flex;
        flex-direction: row;
        gap: 10px;
        justify-content: center;
    }

    #review-container button, 
    #review-container a {
        width: 48%;
        flex: 1;
        margin: 0 !important; /* Override inline margins */
        font-size: 0.9rem;
        padding: 12px;
    }
}

/* =========================================
   CHECKOUT MOBILE RESPONSIVENESS
   ========================================= */

@media (max-width: 768px) {
    
    .checkout-grid {
        grid-template-columns: 1fr; /* Stack columns */
        gap: 20px;
    }

    /* REORDER: Summary first, Payment second */
    .summary-card {
        order: 1;
    }
    
    .payment-card {
        order: 2;
    }

    .payment-tabs {
        font-size: 0.8rem;
    }
}

/* =========================================
   IMPROVED MOBILE CERTIFICATE RESPONSIVENESS
   (Add to bottom of css/responsive.css)
   ========================================= */

@media (max-width: 768px) {

    /* 1. Header Fix: Stack Logo and Back Button */
    header .nav-flex {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
        align-items: center;
    }

    header .nav-flex .btn-outline {
        width: 100%; /* Make button full width for easy tapping */
        text-align: center;
    }

    /* 2. Certificate Container: Use full width */
    .cert-page-container {
        padding: 15px 10px; /* Reduce outer padding */
        margin-top: 20px;
    }

    .cert-actions h1 { font-size: 1.8rem; }
    .cert-actions .btn-lg { width: 100%; font-size: 1.1rem; }

    /* 3. The Certificate Itself: Stop forcing landscape aspect ratio */
    .cert-wrapper {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: auto !important; /* Crucial: lets it grow vertically */
        padding: 5px;
        box-shadow: none; /* Optional: cleaner look on mobile */
    }

    .cert-border {
        height: auto; /* Let content dictate height */
        padding: 5px;
        border-width: 6px; /* Slightly thinner border for mobile */
    }

    .cert-content {
        padding: 25px 15px; /* Much less internal padding */
        height: auto;
    }

    /* 4. Typography Scaling: Make fonts fit better */
    .cert-header {
        flex-direction: column;
        gap: 10px;
        padding-bottom: 15px;
    }

    .cert-logo { font-size: 1.4rem; }
    .cert-id { font-size: 0.9rem; }

    .cert-body h2 {
        font-size: 1.3rem;
        letter-spacing: 1px;
    }

    .cert-subtitle {
        font-size: 1rem;
        margin-bottom: 15px;
    }

    /* Fix the Student Name crushing */
    .student-name {
        font-size: 1.8rem;
        padding: 0 10px 5px;
        margin: 15px 0;
        width: 100%;
        word-break: break-word; /* Ensure long names wrap */
    }

    .cert-text {
        font-size: 0.95rem;
        max-width: 100%; /* Use full width */
        line-height: 1.4;
    }

    /* Fix Course Title breaking awkwardly */
    .course-title {
        font-size: 1.4rem;
        line-height: 1.2;
        margin: 15px 0;
    }

    /* 5. Footer Adjustments */
    .cert-footer {
        flex-direction: column;
        gap: 25px; /* More space between signature lines */
        margin-top: 30px;
    }

    .footer-item { width: 100%; }
    .sign-line { font-size: 1.1rem; }

    /* Hide watermarks on small mobile to reduce clutter */
    .cert-badges { display: none; }
}

/* ABOUT PAGE RESPONSIVE */
@media (max-width: 768px) {
    .page-header h1 { font-size: 2.2rem; }
    
    .stats-grid { flex-direction: column; gap: 15px; }
    
    .instructor-card-large { flex-direction: column; }
    .inst-img-wrapper, .inst-content { width: 100%; }
    .inst-img-wrapper { height: 250px; }
    
    .values-grid { grid-template-columns: 1fr; }
}

/* =========================================
   FOOTER RESPONSIVENESS FIX
   ========================================= */

@media (max-width: 768px) {
    /* 1. Stack the footer columns vertically */
    .footer-grid {
        display: flex;
        flex-direction: column;
        gap: 40px; /* Space between each section */
        text-align: center; /* Center text for better mobile readability */
    }

    /* 2. Reset width for footer columns */
    .footer-col {
        width: 100%;
        padding: 0 20px; /* Add slight padding on sides */
    }

    /* 3. Style the headings */
    .footer-col h4 {
        font-size: 1.2rem;
        margin-bottom: 15px;
        color: white; /* Ensure visibility */
        text-transform: uppercase;
        letter-spacing: 1px;
    }

    /* 4. Style the lists */
    .footer-col ul {
        padding: 0;
        margin: 0;
        list-style: none;
    }

    .footer-col ul li {
        margin-bottom: 12px;
        font-size: 1rem;
        color: #bbb; /* Softer text color */
    }

    /* 5. Copyright Section spacing */
    footer .text-center {
        margin-top: 50px;
        padding-top: 20px;
        font-size: 0.9rem;
    }
}

/* =========================================
   ABOUT PAGE RESPONSIVE FIXES
   ========================================= */

@media (max-width: 768px) {

    /* 1. Fix "Who We Are" / Mission Section */
    /* The problem in your screenshot: Text was squished. This stacks them. */
    .feature-grid {
        display: flex;
        flex-direction: column-reverse; /* Puts image on top, text below (optional, remove '-reverse' if you want text first) */
        gap: 40px;
        text-align: center; /* Centers text for better mobile balance */
    }

    .feature-text {
        width: 100%; /* Forces text to take full width */
        padding: 0 10px;
    }

    .feature-img {
        width: 100%;
        margin-bottom: 20px;
    }

    /* 2. Fix Stats (25+ Years, etc.) */
    /* Make them a 2x2 grid instead of a weird line */
    .stats-grid {
        display: grid;
        grid-template-columns: 1fr 1fr; /* Two columns */
        gap: 20px;
        justify-content: center;
        margin-top: 40px;
        border-top: 1px solid #eee;
        padding-top: 30px;
    }
    
    /* Make the last stat (if odd number) span across the bottom */
    .stats-grid .stat-box:last-child {
        grid-column: span 2;
    }

    /* 3. Fix Instructor Card (Constantine) */
    .instructor-card-large {
        flex-direction: column; /* Stack Image on top of Text */
        text-align: center;
        max-width: 100%;
        border-radius: 15px; /* Slightly smaller radius for mobile */
    }

    .inst-img-wrapper {
        width: 100%;
        height: 300px; /* Fixed height for the image area */
    }

    .inst-content {
        width: 100%;
        padding: 30px 20px;
    }

    .inst-badges {
        justify-content: center; /* Center the badges */
        flex-wrap: wrap; /* Allow wrapping if screen is tiny */
    }

    /* 4. Fix Pledge/Values Grid */
    .values-grid {
        display: grid;
        grid-template-columns: 1fr; /* Stack cards vertically */
        gap: 30px;
        padding: 0 10px;
    }

    .value-card {
        padding: 25px; /* Slightly less padding */
    }

    /* 5. Page Header Adjustments */
    .page-header {
        padding: 80px 0 60px; /* Reduce padding */
    }

    .page-header h1 {
        font-size: 2.2rem; /* Smaller title */
        padding: 0 15px;
    }
    
    .page-header p {
        padding: 0 20px;
        font-size: 1rem;
    }
}

/* =========================================
   INSTRUCTOR SECTION RESPONSIVE FIX
   ========================================= */

@media (max-width: 768px) {
    
    /* 1. Stack Image and Text Vertically */
    .instructor-grid {
        display: flex;        /* Switch from Grid to Flex for easier stacking */
        flex-direction: column; 
        gap: 30px;            /* Space between image and text */
        text-align: center;   /* Center all text */
        padding: 0 20px;      /* Ensure text doesn't touch screen edges */
    }

    /* 2. Resize and Center the Image */
    .instructor-img {
        width: 180px;         /* Smaller size for mobile (was 300px) */
        height: 180px;        /* Keep it circular */
        margin: 0 auto;       /* Force centering */
        border-width: 4px;    /* Slightly thinner border */
    }

    /* 3. Adjust Text Size */
    .instructor-text h2 {
        font-size: 2rem;      /* Make headline readable */
        line-height: 1.2;
    }

    /* 4. Adjust the Blue Background Shape */
    /* The desktop clip-path might look weird on mobile, so we flatten the top slightly or adjust padding */
    .instructor-section {
        padding: 60px 0 80px; /* Reduce top/bottom padding */
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%); /* Optional: Flattens the wave effect on mobile for cleaner look */
        margin-top: 0;
    }
}

/* =========================================
   COURSE DETAILS RESPONSIVE FIX
   ========================================= */

@media (max-width: 900px) {
    
    /* 1. Stack the columns */
    .course-detail-grid {
        display: flex;
        flex-direction: column; /* Content on top, Card on bottom */
        /* flex-direction: column-reverse; <--- UNCOMMENT THIS if you want Price Card ON TOP for mobile */
        gap: 40px;
    }

    /* 2. Reset Sidebar Width */
    .course-sidebar {
        width: 100%; /* Full width on mobile */
    }

    /* 3. Disable "Sticky" on mobile */
    /* Sticky elements can be annoying on small screens */
    .course-sidebar .card {
        position: static !important; 
        box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    }

    /* 4. Adjust Typography */
    #course-title {
        font-size: 2rem !important; /* Smaller title for mobile */
    }
    
    #course-price {
        font-size: 2rem !important;
    }
}

@media (max-width: 1024px) {
    .container, .cpr-container {
        padding: 0 40px; /* More side padding so content doesn't touch edges */
    }
    

}

/* Mobile Devices (Max Width: 768px) */
@media (max-width: 768px) {
     

    /* 4. Course Grid (Stacking) */
    .cpr-course-grid {
        grid-template-columns: 1fr; /* Force single column */
        gap: 40px; /* More space between cards */
        padding: 0 10px;
    }

    /* 5. Section Spacing (Compact view) */

    #cpr-main-course{
        padding-top: 50px !important;
        padding-bottom: 50px !important;
        margin-top: 30px !important;
        margin-bottom: 30px !important;
    }
 }

 /* =========================================
   DESKTOP SPACING REFINEMENT
   ========================================= */

@media (min-width: 1025px) {
    /* 1. Pull content away from the screen edges */
    .cpr-container {
        max-width: 1150px; /* Slightly constrain width for a tighter look */
        padding: 0 60px !important; /* Adds big "breathing room" on left/right */
        margin: 0 auto;
    }

    /* 2. Close the gaps between cards */
    .cpr-course-grid {
        gap: 20px !important; /* Reduced from 30px to 20px */
        justify-content: center; /* Ensures the grid stays centered */
    }
}