/* ===== BEAUTIFUL MOBILE RESPONSIVE DESIGN ===== */
/* Clean, spacious, minimalist mobile experience without cropping */

/* Ensure no horizontal overflow on any screen size */
* {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden !important;
    width: 100%;
    max-width: 100vw;
    position: relative;
}

/* Prevent any element from causing horizontal scroll */
body > * {
    max-width: 100vw;
    overflow-x: hidden;
}

/* Base responsive containers - spacious and clean */
.course-hero,
.enrollment-cta-section,
.program-overview-section,
.course-tabs-section {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Enhanced mobile navigation */
@media (max-width: 900px) {
    .nav-container {
        padding: 0.875rem 1.5rem;
        gap: 1rem;
    }
    
    .logo-text {
        display: none;
    }
    
    .back-button {
        width: 36px;
        height: 36px;
    }
}

/* Tablet responsive design */
@media (max-width: 1024px) {
    .course-hero {
        padding: 2.5rem 1.5rem;
        gap: 2rem;
    }
    
    .enrollment-cta-container {
        padding: 2.5rem 2rem;
    }
    
    .enrollment-options {
        width: 100%;
        max-width: 600px;
        margin: 0 auto;
        gap: 1.5rem;
    }
    
    .enrollment-option {
        width: 100%;
    }
}

/* Beautiful mobile design - spacious and clean */
@media (max-width: 768px) {
    /* Main container with generous spacing */
    body.course-detail-page main {
        padding: 110px 0 2rem;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    /* Add consistent padding to all major sections */
    body.course-detail-page main > section {
        padding-left: 1rem;
        padding-right: 1rem;
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        max-width: 100%;
    }
    
    /* Hero section - spacious and elegant */
    .course-hero {
        padding: 2rem 1.5rem;
        margin: 0 auto 2rem;
        gap: 2rem;
        border-radius: 1rem;
    }
    
    .course-hero-content {
        width: 100%;
        text-align: center;
    }
    
    .course-hero-title {
        font-size: clamp(1.8rem, 6vw, 2.5rem);
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    
    .course-hero-subtitle {
        font-size: clamp(1rem, 3vw, 1.2rem);
        line-height: 1.5;
    }
    
    .course-hero-image {
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
    }
    
    /* Meta badges - clean grid layout */
    .course-meta-badges {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
        margin-top: 1.5rem;
        justify-items: center;
    }
    
    .meta-badge {
        font-size: 0.85rem;
        padding: 0.6rem 1rem;
        text-align: center;
        width: 100%;
        border-radius: 0.5rem;
    }
    
    .meta-badge.certification {
        grid-column: 1 / -1;
        max-width: 300px;
    }
    
    .meta-badge svg {
        width: 16px;
        height: 16px;
    }
    
    /* Duration section - fix cropping and make responsive */
    section[style*="max-width: 1200px"] {
        margin: 2rem 0 !important;
        padding: 0 1rem !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    section[style*="max-width: 1200px"] > div {
        padding: 1.5rem 1rem !important;
        border-radius: 1rem !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
        overflow: hidden !important;
    }
    
    /* Duration content wrapper */
    section[style*="max-width: 1200px"] > div > div:last-child {
        flex: 1 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Duration grid - prevent cropping */
    div[style*="grid-template-columns: 1fr 1fr"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Duration grid items */
    div[style*="grid-template-columns: 1fr 1fr"] > div {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
    }
    
    /* Contact information section */
    div[style*="background: rgba(168, 85, 247, 0.1)"] {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Contact text and phone link */
    div[style*="background: rgba(168, 85, 247, 0.1)"] p {
        flex-direction: column !important;
        gap: 0.75rem !important;
        align-items: flex-start !important;
    }
    
    div[style*="background: rgba(168, 85, 247, 0.1)"] a {
        display: inline-block !important;
        word-break: break-all !important;
    }
    
    /* Enrollment section - spacious and elegant */
    .enrollment-cta-section {
        padding: 0 1rem;
        margin: 2rem 0;
        width: 100%;
        max-width: 100%;
    }
    
    .enrollment-cta-container {
        padding: 2rem 1.5rem;
        gap: 2rem;
        border-radius: 1rem;
        margin: 0 auto;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }
    
    .enrollment-cta-text {
        text-align: center;
        margin-bottom: 1rem;
    }
    
    .enrollment-cta-text h2 {
        font-size: clamp(1.6rem, 5vw, 2.2rem);
        line-height: 1.3;
        margin-bottom: 0.75rem;
    }
    
    .enrollment-options {
        flex-direction: column;
        gap: 1.5rem;
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .enrollment-option {
        width: 100%;
        padding: 1.5rem;
        border-radius: 1rem;
    }
    
    /* Program overview - clean and spacious */
    .program-overview-section {
        padding: 0 1rem;
        margin: 2rem 0;
        width: 100%;
        max-width: 100%;
    }
    
    .program-overview-container {
        padding: 2rem 1.5rem;
        margin: 0 auto;
        border-radius: 1rem;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }
    
    .section-title {
        font-size: clamp(1.8rem, 6vw, 2.4rem);
        margin-bottom: 2rem;
        text-align: center;
    }
    
    .subsection-title {
        font-size: clamp(1.3rem, 4vw, 1.7rem);
        margin-top: 2rem;
        margin-bottom: 1.5rem;
    }
    
    /* Course tabs - beautiful mobile layout */
    .course-tabs-section {
        padding: 0 1rem;
        margin: 2rem 0;
        width: 100%;
        max-width: 100%;
    }
    
    .course-tabs-wrapper {
        padding: 1.5rem;
        margin: 0 auto;
        border-radius: 1rem;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }
    
    .course-tabs-container {
        flex-direction: column;
        gap: 0.75rem;
        background: transparent;
        padding: 0;
    }
    
    .course-tab-button {
        width: 100%;
        padding: 1rem 1.5rem;
        font-size: 0.95rem;
        border-radius: 0.75rem;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        transition: all 0.3s ease;
    }
    
    .course-tab-button.active {
        background: linear-gradient(135deg, #a855f7, #4ecdc4);
        border-color: transparent;
    }
    
    .course-tab-glider {
        display: none;
    }
    
    /* Grid layouts - single column, spacious */
    .learning-path-grid,
    .differentiators-list,
    .skills-categories,
    .support-items,
    .audience-items,
    .career-paths-grid,
    .salary-items {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Accordion sections - clean and spacious */
    .phase-header,
    .month-header,
    .week-header {
        padding: 1.25rem 1.5rem;
        gap: 1rem;
        border-radius: 0.75rem;
    }
    
    .phase-info,
    .month-info {
        min-width: 0;
        flex: 1;
    }
    
    .phase-title {
        font-size: clamp(1.2rem, 4vw, 1.4rem);
        line-height: 1.3;
    }
    
    .phase-description {
        font-size: 0.95rem;
        line-height: 1.5;
        margin-top: 0.5rem;
    }
    
    .month-title {
        font-size: clamp(1.1rem, 3.5vw, 1.25rem);
    }
    
    .week-title {
        font-size: clamp(1rem, 3vw, 1.15rem);
    }
    
    /* Content sections - generous padding */
    .phase-content,
    .month-content,
    .week-content {
        padding: 1.5rem;
    }
    
    /* Career timeline - clean mobile layout */
    .career-outcomes-timeline {
        padding-left: 1.5rem;
    }
    
    .career-outcome {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1.25rem;
        border-radius: 0.75rem;
    }
    
    .career-outcome::before {
        left: calc(-1.5rem - 6px);
    }
    
    /* Text content - readable and spacious */
    .overview-description {
        font-size: 1.05rem;
        line-height: 1.7;
    }
    
    .tab-intro {
        font-size: 1.05rem;
        margin-bottom: 2rem;
        text-align: center;
    }
    
    /* Lists - clean spacing */
    .topics-list li,
    .projects-list li {
        padding: 0.75rem 1rem;
        padding-left: 2rem;
        font-size: 0.95rem;
        line-height: 1.6;
        margin-bottom: 0.5rem;
        border-radius: 0.5rem;
    }
}

/* Additional fixes for duration section on all mobile sizes */
@media (max-width: 768px) {
    /* Force duration section to be fully responsive */
    section[style*="max-width: 1200px"] {
        margin: 1.5rem 0.5rem !important;
        padding: 0 !important;
        max-width: calc(100vw - 1rem) !important;
        width: calc(100vw - 1rem) !important;
    }
    
    section[style*="max-width: 1200px"] > div {
        margin: 0 !important;
        padding: 1.5rem 1rem !important;
        max-width: 100% !important;
        width: 100% !important;
        overflow: hidden !important;
    }
    
    /* Duration icon container */
    div[style*="flex-shrink: 0; width: 48px"] {
        flex-shrink: 0 !important;
        width: 40px !important;
        height: 40px !important;
        margin-bottom: 1rem !important;
    }
    
    /* Duration main content */
    section[style*="max-width: 1200px"] h3 {
        font-size: 1.25rem !important;
        margin-bottom: 1rem !important;
        line-height: 1.3 !important;
    }
    
    section[style*="max-width: 1200px"] p {
        font-size: 0.95rem !important;
        line-height: 1.6 !important;
        margin-bottom: 1.5rem !important;
    }
}

/* Small mobile devices - maintain spaciousness */
@media (max-width: 480px) {
    body.course-detail-page main {
        padding: 100px 0.75rem 1.5rem;
    }
    
    .course-hero {
        padding: 1.5rem 1rem;
        margin-bottom: 1.5rem;
    }
    
    .course-hero-title {
        font-size: clamp(1.6rem, 7vw, 2rem);
    }
    
    .course-hero-subtitle {
        font-size: clamp(0.95rem, 4vw, 1.1rem);
    }
    
    /* Meta badges - stack vertically on very small screens */
    .course-meta-badges {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .meta-badge {
        padding: 0.75rem;
        font-size: 0.8rem;
    }
    
    /* Containers - maintain generous spacing */
    .enrollment-cta-container,
    .program-overview-container,
    .course-tabs-wrapper {
        padding: 1.5rem 1rem;
        margin: 1.5rem auto;
    }
    
    /* Duration section for small screens */
    section[style*="max-width: 1200px"] {
        margin: 1rem 0.25rem !important;
        padding: 0 !important;
        max-width: calc(100vw - 0.5rem) !important;
        width: calc(100vw - 0.5rem) !important;
    }
    
    section[style*="max-width: 1200px"] > div {
        padding: 1.25rem 0.75rem !important;
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    
    section[style*="max-width: 1200px"] h3 {
        font-size: 1.1rem !important;
    }
    
    section[style*="max-width: 1200px"] p {
        font-size: 0.9rem !important;
    }
    
    .section-title {
        font-size: clamp(1.6rem, 7vw, 2rem);
        margin-bottom: 1.5rem;
    }
    
    .subsection-title {
        font-size: clamp(1.2rem, 5vw, 1.5rem);
        margin-top: 1.5rem;
        margin-bottom: 1rem;
    }
    
    /* Accordion - maintain readability */
    .phase-header,
    .month-header,
    .week-header {
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .phase-title {
        font-size: clamp(1.1rem, 5vw, 1.3rem);
    }
    
    .month-title {
        font-size: clamp(1rem, 4vw, 1.2rem);
    }
    
    .week-title {
        font-size: clamp(0.95rem, 3.5vw, 1.1rem);
    }
    
    /* Content sections */
    .phase-content,
    .month-content,
    .week-content {
        padding: 1rem;
    }
    
    /* Career timeline */
    .career-outcomes-timeline {
        padding-left: 1rem;
    }
    
    .career-outcome {
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .career-outcome::before {
        left: calc(-1rem - 6px);
        width: 12px;
        height: 12px;
    }
    
    .outcome-step {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    /* Enrollment options */
    .enrollment-option {
        padding: 1.25rem;
    }
    
    .enrollment-option .price {
        font-size: 1.6rem;
    }
    
    .enroll-btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }
}

/* Landscape orientation - optimize for wider screens */
@media (max-width: 768px) and (orientation: landscape) {
    body.course-detail-page main {
        padding-top: 90px;
    }
    
    .course-hero {
        flex-direction: row;
        align-items: center;
        text-align: left;
        padding: 1.5rem;
        gap: 2rem;
    }
    
    .course-hero-content {
        flex: 1;
        text-align: left;
    }
    
    .course-hero-image {
        flex: 0 0 250px;
        max-width: 250px;
    }
    
    .course-meta-badges {
        grid-template-columns: 1fr 1fr;
        justify-items: flex-start;
    }
}

/* Ensure proper text wrapping */
.phase-title,
.month-title,
.week-title,
.course-hero-title,
.section-title,
.subsection-title {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Ensure all content respects boundaries */
p, li, span, div {
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* Beautiful scrollbars for tabs */
.course-tabs-container::-webkit-scrollbar {
    height: 4px;
}

.course-tabs-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.course-tabs-container::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.6);
    border-radius: 2px;
}

.course-tabs-container::-webkit-scrollbar-thumb:hover {
    background: rgba(168, 85, 247, 0.8);
}

/* Ensure images are responsive */
img, svg {
    max-width: 100%;
    height: auto;
}

/* Prevent flex item overflow */
.course-hero-content,
.enrollment-cta-text,
.phase-info,
.month-info {
    min-width: 0;
    flex-shrink: 1;
}

/* Final safety measures - prevent any cropping */
@media (max-width: 768px) {
    /* Ensure no element exceeds viewport */
    * {
        max-width: 100vw;
    }
    
    /* All containers respect viewport boundaries */
    .course-hero,
    .enrollment-cta-container,
    .program-overview-container,
    .course-tabs-wrapper,
    .phase-section,
    .month-section,
    .week-section {
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }
    
    /* Prevent text overflow */
    .topics-list li,
    .projects-list li,
    .phase-description,
    .overview-description p,
    .tab-intro {
        word-break: break-word;
        overflow-wrap: anywhere;
    }
    
    /* Fix accordion content spacing */
    .curriculum-accordion {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }
    
    .phase-section,
    .month-section,
    .week-section {
        width: 100%;
        max-width: 100%;
        margin-bottom: 1rem;
    }
    
    /* Ensure accordion content doesn't overflow */
    .phase-content,
    .month-content,
    .week-content {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }
    
    /* Fix expand icons alignment */
    .expand-icon {
        flex-shrink: 0;
        margin-left: auto;
        font-size: 1rem;
        transition: transform 0.3s ease;
    }
    
    .phase-section.active .phase-header .expand-icon,
    .month-section.active .month-header .expand-icon,
    .week-section.active .week-header .expand-icon {
        transform: rotate(180deg);
    }
    
    /* Improve button spacing and touch targets */
    .phase-header,
    .month-header,
    .week-header {
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        cursor: pointer;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Better visual feedback on tap */
    .phase-header:active,
    .month-header:active,
    .week-header:active {
        opacity: 0.8;
        transform: scale(0.98);
    }
    
    /* Smooth transitions for accordion */
    .phase-content,
    .month-content,
    .week-content {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-out, padding 0.3s ease;
    }
    
    .phase-section.active .phase-content,
    .month-section.active .month-content,
    .week-section.active .week-content {
        max-height: 10000px;
        transition: max-height 0.6s ease-in;
    }
    
    /* Improve list readability */
    .topics-list,
    .projects-list {
        padding-left: 0;
        margin: 0;
        list-style: none;
    }
    
    .topics-list li,
    .projects-list li {
        position: relative;
        padding-left: 2.5rem;
        margin-bottom: 0.75rem;
    }
    
    .topics-list li::before,
    .projects-list li::before {
        content: "•";
        position: absolute;
        left: 1rem;
        color: #a855f7;
        font-size: 1.2rem;
        font-weight: bold;
    }
    
    /* Better spacing for content sections */
    .topics-section,
    .projects-section,
    .practice-section,
    .assessment-section {
        margin-bottom: 1.5rem;
        padding: 1rem;
        background: rgba(255, 255, 255, 0.02);
        border-radius: 0.75rem;
        border-left: 3px solid #a855f7;
    }
    
    .content-section-title {
        font-size: 1rem;
        font-weight: 600;
        color: #a855f7;
        margin-bottom: 1rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    /* Improve enrollment buttons */
    .enroll-btn {
        width: 100%;
        padding: 1rem 1.5rem;
        font-size: 1rem;
        font-weight: 600;
        border-radius: 0.75rem;
        border: none;
        cursor: pointer;
        transition: all 0.3s ease;
        text-align: center;
        text-decoration: none;
        display: inline-block;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .enroll-btn.primary {
        background: linear-gradient(135deg, #a855f7, #4ecdc4);
        color: white;
    }
    
    .enroll-btn.outline {
        background: transparent;
        border: 2px solid #a855f7;
        color: #a855f7;
    }
    
    .enroll-btn:active {
        transform: scale(0.97);
    }
    
    /* Better price display */
    .price {
        font-size: 2rem;
        font-weight: 700;
        color: #a855f7;
        margin: 1rem 0;
        text-align: center;
    }
    
    /* Improve hero image container */
    .course-hero-image {
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        border-radius: 1rem;
    }
    
    .course-hero-image img,
    .hero-course-image {
        width: 100%;
        height: auto;
        max-width: 100%;
        object-fit: contain;
        border-radius: 0.75rem;
    }
    
    /* Better category badge */
    .course-category {
        display: inline-block;
        padding: 0.5rem 1rem;
        background: rgba(168, 85, 247, 0.2);
        color: #a855f7;
        border-radius: 2rem;
        font-size: 0.85rem;
        font-weight: 600;
        margin-bottom: 1rem;
        border: 1px solid rgba(168, 85, 247, 0.3);
    }
    
    /* Improve differentiators list */
    .differentiators-list {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    
    .differentiators-list li {
        padding: 1rem;
        margin-bottom: 0.75rem;
        background: rgba(255, 255, 255, 0.03);
        border-radius: 0.75rem;
        border-left: 3px solid #4ecdc4;
        display: flex;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .check-icon {
        color: #4ecdc4;
        font-weight: bold;
        font-size: 1.2rem;
        flex-shrink: 0;
    }
    
    /* Better learning path items */
    .learning-path-item {
        padding: 1.5rem;
        background: rgba(255, 255, 255, 0.03);
        border-radius: 0.75rem;
        border: 1px solid rgba(255, 255, 255, 0.1);
        margin-bottom: 1rem;
    }
    
    .path-number {
        font-size: 0.85rem;
        color: #a855f7;
        font-weight: 600;
        margin-bottom: 0.5rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }
    
    .path-content {
        font-size: 0.95rem;
        line-height: 1.6;
        color: #CBD5E1;
    }
    
    /* Improve show more button */
    .show-more-btn {
        width: 100%;
        padding: 0.75rem;
        margin-top: 1rem;
        background: rgba(168, 85, 247, 0.1);
        border: 1px solid rgba(168, 85, 247, 0.3);
        border-radius: 0.5rem;
        color: #a855f7;
        font-size: 0.9rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        min-height: 44px;
    }
    
    .show-more-btn:active {
        background: rgba(168, 85, 247, 0.2);
        transform: scale(0.98);
    }
}

/* Extra small devices - maintain quality */
@media (max-width: 360px) {
    body.course-detail-page main {
        padding: 100px 0.5rem 1.5rem;
    }
    
    .course-hero,
    .enrollment-cta-container,
    .program-overview-container,
    .course-tabs-wrapper {
        padding: 1.25rem 0.75rem;
    }
    
    .course-hero-title {
        font-size: 1.5rem;
    }
    
    .course-hero-subtitle {
        font-size: 0.9rem;
    }
    
    .meta-badge {
        font-size: 0.75rem;
        padding: 0.6rem 0.75rem;
    }
    
    section[style*="max-width: 1200px"] {
        padding: 0 0.5rem !important;
    }
    
    section[style*="max-width: 1200px"] > div {
        padding: 1rem 0.75rem !important;
    }
}