/* Homepage-specific styles extending styles.css */

/* Override body styles for homepage */
.homepage-body {
    overflow: visible;
    /* Allow scrolling for homepage */
    height: auto;
    background: var(--bg);
    color: var(--text);
    padding-top: 92px;
}

/* Scroll offset for fixed navbar - ensures sections scroll to show headings */
#features,
#pricing,
#about {
    scroll-margin-top: 93px;
}

@media (max-width: 900px) {

    #features,
    #pricing,
    #about {
        scroll-margin-top: 73px;
    }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header - inherits position: fixed from navbar.css */

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    position: relative;
}

/* Homepage-specific logo overrides (inherits from navbar.css) */

/* Navigation - Centered */
.nav-wrapper {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
}

/* Hide navigation on mobile by default */
@media (max-width: 900px) {
    .nav-wrapper {
        display: none;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }
}

/* Hide mobile auth buttons on desktop */
.mobile-auth-buttons {
    display: none;
}

/* Mobile Styles */
@media (max-width: 900px) {
    .homepage-body {
        padding-top: 75px;
    }

    .hamburger {
        display: flex !important;
        margin-left: auto;
    }

    /* Hide auth buttons on mobile header - IMPORTANT: Only hamburger should show */
    .auth-buttons {
        display: none !important;
    }

    /* Mobile navigation menu */
    .nav-wrapper {
        position: fixed;
        top: 75px;
        /* Position right below the navbar */
        left: 0;
        right: 0;
        background: var(--panel);
        border-bottom: 1px solid var(--border);
        transform: scaleY(0);
        transform-origin: top;
        transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
        z-index: 99;
        padding: 1.5rem 0 2rem 0;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        display: flex;
        flex-direction: column;
        align-items: center;
        opacity: 0;
        visibility: hidden;
    }

    .nav-wrapper.open {
        transform: scaleY(1);
        opacity: 1;
        visibility: visible;
    }

    .nav-links {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
        margin-bottom: 0;
    }

    .nav-links a {
        font-size: 1.1rem;
        padding: 0.75rem 0;
        font-weight: 500;
    }

    /* Show auth buttons inside mobile menu */
    .nav-wrapper .mobile-auth-buttons {
        display: flex;
        flex-direction: column;
        gap: 1.25rem;
        align-items: center;
        width: 100%;
        max-width: 160px;
        margin-top: 2rem;
    }

    .nav-wrapper .mobile-auth-buttons .btn {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }

    /* Make header content simpler on mobile */
    .header-content {
        justify-content: space-between;
        padding: 0.75rem 0;
    }

    /* Logo stays on the left (size inherited from navbar.css) */

    .hero h1 {
        font-size: 3.7rem;
    }

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

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

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

    .pricing-card.featured {
        transform: none;
    }

    .container {
        padding: 0 16px;
    }
}

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

.nav-links a {
    text-decoration: none;
    color: var(--muted);
    font-weight: 500;
    transition: color 0.2s;
    padding: 0.5rem 0;
}

.nav-links a:hover {
    color: var(--text);
}

/* Auth buttons (inherits .btn, .btn-primary, .btn-outline from navbar.css) */
.auth-buttons {
    display: flex;
    gap: 0.75rem;
    z-index: 10;
}

/* Hamburger menu - hidden by default (inherits from navbar.css) */
.hamburger {
    display: none;
    z-index: 101;
    position: relative;
}

/* Hero Section */
.hero {
    background: var(--bg);
    color: var(--text);
    text-align: center;
    padding: 4.8rem 0 6rem;
}

.hero h1 {
    font-size: 4.5rem;
    font-weight: normal;
    margin-top: 0;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.subject-carousel {
    font-weight: bold;
    transition: opacity 0.2s ease-in-out;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--muted);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    min-height: 56px;
}

/* Desktop larger text */
@media (min-width: 900px) {
    .hero h1 {
        font-size: 5.5rem;
    }
}

/* Course Preview */
.course-preview {
    background: var(--panel);
    padding: 3rem 0 0;
    text-align: center;
}

@media (max-width: 900px) {
    .course-preview {
        padding: 2rem 0 0;
    }
}

.section-subtitle {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.preview-image {
    max-width: 700px;
    width: 100%;
    height: auto;
    display: block;
    margin: 2rem auto 0;
    border-radius: var(--radius);
}

@media (max-width: 600px) {
    .preview-image {
        max-width: 70%;
        margin: 1rem auto 0;
    }

    .section-title {
        font-size: 1.75rem;
        margin-bottom: 2rem;
    }

    .section-subtitle {
        font-size: 1.4rem;
    }
}

.preview-mockup {
    background: var(--bg);
    border-radius: var(--radius);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    max-width: 800px;
    margin: 2rem auto;
    overflow: hidden;
    border: 1px solid var(--border);
}

.mockup-header {
    background: var(--text);
    color: var(--panel);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    text-align: left;
}

.mockup-content {
    padding: 0;
}

.mockup-question {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 500;
    color: var(--text);
}

.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.course-card {
    background: var(--panel);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-align: left;
}

.course-card h4 {
    margin-bottom: 0.5rem;
    color: var(--text);
}

.progress-bar {
    background: var(--border);
    height: 4px;
    border-radius: 2px;
    margin: 0.5rem 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #10b981;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    width: 100%;
    margin-top: 0.5rem;
}

/* Sections */
.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: bold;
    margin-top: 0;
    margin-bottom: 3rem;
    color: var(--text);
}

@media (max-width: 600px) {
    .section-title {
        font-size: 1.75rem;
        margin-bottom: 2rem;
    }
}

/* Features */
.features {
    padding: 3rem 0;
    background: var(--bg);
}

@media (max-width: 600px) {
    .features {
        padding: 2rem 0;
    }
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    text-align: center;
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--panel);
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: var(--text);
}

.feature-card p {
    color: var(--muted);
    line-height: 1.6;
}

/* Pricing */
.pricing {
    background: var(--panel);
    padding: 3rem 0;
}

@media (max-width: 600px) {
    .pricing {
        padding: 2rem 0;
    }
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.pricing-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 2rem;
    text-align: left;
    border: 1px solid #e5e7eb;
    transition: all 0.2s;
}

.pricing-card.featured {
    border-color: #111827;
}

#completePlan {
    scroll-margin-top: 120px;
    /* Space for mobile header + padding */
}

@media (min-width: 768px) {
    #completePlan {
        scroll-margin-top: 240px;
        /* More space for desktop header + padding */
    }
}

.pricing-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.pricing-card h3 {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.75rem;
    color: #111827;
}

.price {
    font-size: 2.25rem;
    font-weight: bold;
    color: #111827;
    margin: 1rem 0;
}

.price-period {
    font-size: 1rem;
    color: #6b7280;
    font-weight: normal;
}

.pricing-features {
    list-style: none;
    margin: 2rem 0;
    padding: 0;
}

.pricing-features li {
    padding: 0.5rem 0;
    color: var(--muted);
    position: relative;
    padding-left: 1.5rem;
}

.pricing-features li:before {
    content: "✓";
    color: #111827;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.pricing-features li.no-tick:before {
    content: none;
}

.pricing-btn {
    width: 100%;
    background: #111827;
    color: #ffffff;
    border-color: #111827;
}

/* Toggle styles */
.billing-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.5rem 0 1rem;
}

.billing-toggle .toggle-label {
    color: #6b7280;
    font-weight: 500;
}

.billing-toggle .toggle-label.active {
    color: #111827;
}

.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #111827;
    transition: .2s;
    border-radius: 999px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    transition: .2s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #111827;
}

input:checked+.slider:before {
    transform: translateX(22px);
}

/* About */
.about {
    padding: 3rem 0;
    background: var(--bg);
}

@media (max-width: 600px) {
    .about {
        padding: 2rem 0;
    }
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--muted);
    margin-bottom: 1.5rem;
}

/* Testimonials */
.testimonials {
    background: var(--panel);
    padding: 3rem 0;
}

@media (max-width: 600px) {
    .testimonials {
        padding: 2rem 0;
    }
}

.testimonial-carousel {
    position: relative;
    margin-top: 3rem;
    --spv: 2;
    --gap: 1.5rem;
    padding: 0 3.5rem;
}

.carousel-viewport {
    overflow: hidden;
    width: 100%;
}

.carousel-track {
    display: flex;
    transition: transform 400ms ease;
}

.carousel-slide {
    flex: 0 0 calc(100% / var(--spv));
    padding: 0 calc(var(--gap) / 2);
    box-sizing: border-box;
}

.testimonial {
    background: var(--bg);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    height: 240px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.carousel-controls {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    pointer-events: none;
}

.carousel-button {
    pointer-events: auto;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    color: var(--text);
    border: none;
    font-size: 3.1rem;
    line-height: 1;
    padding: 0;
    margin: 0;
    cursor: pointer;
}

.carousel-button.prev {
    left: 0.75rem;
}

.carousel-button.next {
    right: 0.75rem;
}

.carousel-button:hover {
    color: var(--text);
    opacity: 0.8;
}

/* 2 per view on narrower screens */
/* Keep 2 on wider screens by default */

/* 1 per view on mobile */
@media (max-width: 900px) {
    .testimonials {
        padding: 2rem 0;
    }

    .testimonial-carousel {
        --spv: 1;
        padding: 0 2.5rem;
        margin-top: 2rem;
    }

    .carousel-viewport {
        overflow: hidden;
    }

    .carousel-slide {
        flex: 0 0 100%;
        padding: 0 0.5rem;
    }

    .carousel-button.prev {
        left: 0.5rem;
    }

    .carousel-button.next {
        right: 0.5rem;
    }

    /* Make About section text column narrower on mobile to match narrow content feel */
    .about .about-content {
        max-width: calc(100% - 5rem);
    }

    .testimonial {
        height: 320px;
    }

    .testimonial-text {
        -webkit-line-clamp: 8;
        line-clamp: 8;
    }
}

.testimonial {
    background: var(--bg);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    height: 260px;
    display: flex;
    flex-direction: column;
}

.testimonial-text {
    font-style: italic;
    color: var(--muted);
    margin-bottom: 1rem;
    line-height: 1.6;
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    line-clamp: 5;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

.testimonial-footer {
    margin-top: auto;
}

.testimonial-author {
    font-weight: bold;
    color: var(--text);
}

.testimonial-role {
    color: var(--muted);
    font-size: 0.9rem;
}

/* Mobile testimonial overrides - must come after base styles */
@media (max-width: 900px) {
    .testimonial {
        height: 370px !important;
    }

    .testimonial-text {
        -webkit-line-clamp: 9 !important;
        line-clamp: 9 !important;
    }
}

/* Footer */
footer {
    background: transparent;
    color: var(--text);
    padding: 2rem 0 3rem;
}

.footer-new {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    align-items: start;
    justify-items: center;
}

.footer-col h4 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

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

.footer-col .linklike {
    background: none;
    border: none;
    color: var(--muted);
    font: inherit;
    padding: 0.35rem 0;
    text-align: center;
    cursor: pointer;
    display: block;
    width: 100%;
}

.footer-col .linklike {
    display: block;
    text-align: center;
}

.footer-col .linklike:hover {
    color: var(--text);
}

.footer-col .linklike.underline {
    text-decoration: underline;
}

.footer-col .footer-text {
    color: var(--muted);
    padding: 0.35rem 0;
    display: block;
    text-align: center;
}

.footer-col .footer-link {
    color: var(--muted);
    text-decoration: none;
    cursor: pointer;
}

.footer-col .footer-link:hover {
    color: var(--text);
}

@media (max-width: 900px) {
    .footer-new {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }

    .footer-col:nth-child(1) {
        grid-column: 1;
        grid-row: 1;
    }

    .footer-col:nth-child(2) {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .footer-col:nth-child(3) {
        grid-column: 2;
        grid-row: 1;
    }
}

.footer-bottom {
    border-top: 1px solid var(--muted);
    padding-top: 2rem;
    text-align: center;
    color: var(--muted);
}

@media (max-width: 900px) {
    .hero h1 {
        font-size: 3.7rem;
    }
}