/* ========================================
   CSS Variables - Brand Colors
   ======================================== */
:root {
    /* Brand Colors from Smart Tutor Frontend */
    --primary-color: #76d7fa;      /* Sky Blue - matches quiz-frontend */
    --primary-hover: #5ac8f5;      /* Darker Sky Blue for hover states */
    --primary-light: #e3f7fe;      /* Light Sky Blue for backgrounds */
    --secondary-color: #4B5563;    /* Medium Gray */
    --accent-color: #F59E0B;       /* Amber - for highlights */
    --text-color: #000000;         /* Black - primary text */
    --text-secondary: #4B5563;     /* Medium Gray - secondary text */
    --text-light: #9CA3AF;         /* Light Gray - tertiary text */
    --background-color: #FFFFFF;   /* White */
    --background-light: #F8F9FA;   /* Light Gray Background */
    --background-dark: #E5E7EB;    /* Darker Gray Background */

    /* Semantic Colors */
    --success-color: #10B981;      /* Green */
    --danger-color: #EF4444;       /* Red */
    --warning-color: #F59E0B;      /* Amber */
    --info-color: #3B82F6;         /* Blue */

    /* Typography */
    --font-family: 'Poppins', sans-serif;
    --font-size-base: 14px;
    --line-height-base: 1.6;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    --spacing-3xl: 6rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;
}

/* ========================================
   Reset & Base Styles
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--text-color);
    background-color: var(--background-color);
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ========================================
   Container & Layout
   ======================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

@media (min-width: 768px) {
    .container {
        padding: 0 var(--spacing-xl);
    }
}

/* ========================================
   Typography
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--primary-color);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

@media (min-width: 768px) {
    h1 { font-size: 3rem; }
    h2 { font-size: 2.5rem; }
    h3 { font-size: 1.875rem; }
}

@media (min-width: 1024px) {
    h1 { font-size: 3.5rem; }
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.btn-secondary:hover {
    background-color: #d97706;
    border-color: #d97706;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* ========================================
   Navigation
   ======================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: white;
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: box-shadow var(--transition-base);
}

.navbar.scrolled {
    box-shadow: var(--shadow-md);
}

.nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.logo h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin: 0;
}

.logo-image {
    height: 70px;
    width: auto;
    display: block;
}

@media (max-width: 768px) {
    .logo-image {
        height: 55px;
    }
}

.nav-menu {
    display: none;
    align-items: center;
    gap: var(--spacing-md);
}

.nav-menu.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    padding: var(--spacing-md);
    box-shadow: var(--shadow-lg);
}

.nav-link {
    color: var(--text-color);
    font-weight: 500;
    transition: color var(--transition-fast);
}

.nav-link:hover {
    color: var(--accent-color);
}

.mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background-color: var(--primary-color);
    transition: all var(--transition-base);
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

@media (min-width: 768px) {
    .nav-menu {
        display: flex;
        flex-direction: row;
        position: static;
        background-color: transparent;
        padding: 0;
        box-shadow: none;
    }

    .mobile-menu-toggle {
        display: none;
    }
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
    padding: calc(80px + var(--spacing-3xl)) 0 var(--spacing-3xl);
    background: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 100%);
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
    align-items: center;
}

.hero-title {
    font-size: 2.5rem;
    line-height: 1.1;
    margin-bottom: var(--spacing-md);
}

.highlight {
    color: var(--accent-color);
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-light);
    margin-bottom: var(--spacing-lg);
    max-width: 600px;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 0 0 auto;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-color);
    white-space: nowrap;
    display: inline-block;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-light);
}

.hero-illustration {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.hero-screenshot {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.screenshot-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-lg);
}

@media (min-width: 1024px) {
    .hero-content {
        grid-template-columns: 1.2fr 1fr;
    }

    .hero-title {
        font-size: 3.5rem;
    }
}

/* ========================================
   Section Styles
   ======================================== */
section {
    padding: var(--spacing-3xl) 0;
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.section-title {
    margin-bottom: var(--spacing-md);
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto;
}

/* ========================================
   Features Section
   ======================================== */
.features {
    background-color: var(--background-light);
    padding: var(--spacing-3xl) 0;
}

.features-showcase {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-3xl);
}

.feature-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-2xl);
    align-items: center;
    padding: var(--spacing-2xl);
    background-color: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.feature-row:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-5px);
}

.feature-row-reverse {
    direction: rtl;
}

.feature-row-reverse > * {
    direction: ltr;
}

.feature-content {
    padding: var(--spacing-md);
}

.feature-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
}

.feature-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    color: var(--text-color);
    line-height: 1.3;
}

.feature-description {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: var(--spacing-lg);
}

.feature-benefits {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-benefits li {
    padding: 0.75rem 0;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.6;
    border-bottom: 1px solid var(--background-dark);
}

.feature-benefits li:last-child {
    border-bottom: none;
}

.feature-benefits strong {
    color: var(--text-color);
    font-weight: 600;
}

.feature-image {
    position: relative;
}

.feature-screenshot {
    width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: block;
}

/* Make screenshots larger in features 2, 3, and 4 */
.feature-large {
    grid-template-columns: 0.8fr 1.2fr;
}

.feature-large.feature-row-reverse {
    grid-template-columns: 1.2fr 0.8fr;
}

.feature-large .feature-screenshot {
    max-width: 100%;
    transform: scale(1.1);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .feature-row {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
        padding: var(--spacing-lg);
    }

    .feature-row-reverse {
        direction: ltr;
    }

    .feature-title {
        font-size: 1.5rem;
    }

    .features-showcase {
        gap: var(--spacing-xl);
    }

    .feature-image {
        order: -1;
    }
}

/* ========================================
   How It Works Section
   ======================================== */
.how-it-works {
    background-color: var(--background-light);
}

.steps-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
    max-width: 900px;
    margin: 0 auto;
}

.step {
    text-align: center;
    padding: var(--spacing-lg);
    background-color: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.step-number {
    width: 60px;
    height: 60px;
    background-color: var(--accent-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 auto var(--spacing-md);
}

.step-title {
    font-size: 1.375rem;
    margin-bottom: var(--spacing-sm);
}

.step-description {
    color: var(--text-light);
}

.step-arrow {
    display: none;
}

@media (min-width: 768px) {
    .steps-container {
        grid-template-columns: 1fr auto 1fr auto 1fr;
        align-items: center;
    }

    .step-arrow {
        display: block;
        font-size: 2rem;
        color: var(--accent-color);
        font-weight: 700;
    }
}

/* ========================================
   Pricing Section - Comparison Table
   ======================================== */
.pricing {
    background-color: white;
    padding: var(--spacing-3xl) 0;
}

.pricing-table-wrapper {
    overflow: visible;
    padding-top: 50px;
    margin-top: 30px;
}

.pricing-table-wrapper .pricing-table {
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    background-color: white;
}

.pricing-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 800px;
}

.pricing-table thead {
    background-color: var(--background-light);
}

.pricing-table th {
    padding: var(--spacing-xl) var(--spacing-lg);
    text-align: center;
    border-left: 1px solid var(--background-dark);
    border-right: 1px solid var(--background-dark);
    border-top: 1px solid var(--background-dark);
    border-bottom: 1px solid var(--background-dark);
    vertical-align: top;
}

.pricing-table thead tr th:first-child {
    border-top-left-radius: var(--radius-xl);
}

.pricing-table thead tr th:last-child {
    border-top-right-radius: var(--radius-xl);
}

.pricing-table th.feature-column {
    text-align: left;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-color);
    background-color: var(--background-light);
    width: 30%;
}

.pricing-table th.plan-column {
    width: 23.33%;
    position: relative;
    background-color: white;
}

.pricing-table th.featured-column {
    background-color: var(--primary-light);
    border: 2px solid var(--primary-color);
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.pricing-table tbody tr td.featured-cell {
    border-left: 2px solid var(--primary-color);
    border-right: 2px solid var(--primary-color);
    border-top: none;
}

.pricing-table tbody tr:last-child td.featured-cell {
    border-bottom: 2px solid var(--primary-color);
    border-bottom-left-radius: var(--radius-xl);
    border-bottom-right-radius: var(--radius-xl);
}

.popular-badge {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--accent-color);
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 700;
    white-space: nowrap;
    z-index: 10;
}

.plan-header-cell {
    padding: var(--spacing-md);
}

.plan-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    color: var(--text-color);
}

.plan-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    margin-bottom: var(--spacing-sm);
}

.currency {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.amount {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin: 0 0.25rem;
}

.period {
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.plan-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: var(--spacing-md);
}

.btn-small {
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
}

.pricing-table tbody tr:hover {
    background-color: var(--background-light);
}

.pricing-table td {
    padding: var(--spacing-md) var(--spacing-lg);
    text-align: center;
    border-left: 1px solid var(--background-dark);
    border-right: 1px solid var(--background-dark);
    border-bottom: 1px solid var(--background-dark);
    border-top: none;
}

.pricing-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: var(--radius-xl);
}

.pricing-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: var(--radius-xl);
}

.feature-name {
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9375rem;
}

.feature-value {
    text-align: center;
    vertical-align: middle;
}

.feature-value.featured-cell {
    background-color: var(--primary-light);
}

.feature-value.disabled {
    opacity: 0.5;
}

.check-icon {
    width: 24px;
    height: 24px;
    color: var(--success-color);
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.25rem;
}

.cross-icon {
    width: 24px;
    height: 24px;
    color: var(--danger-color);
    display: inline-block;
    vertical-align: middle;
}

.limit-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 600;
    vertical-align: middle;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .pricing-table-wrapper {
        margin: 0 -var(--spacing-md);
        overflow-x: auto;
        overflow-y: visible;
    }

    .pricing-table {
        min-width: 600px;
    }

    .pricing-table th,
    .pricing-table td {
        padding: var(--spacing-sm);
    }

    .plan-name {
        font-size: 1.25rem;
    }

    .amount {
        font-size: 2rem;
    }

    .btn-small {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
}

/* ========================================
   FAQ Section
   ======================================== */
.faq {
    background-color: var(--background-light);
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background-color: white;
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    background-color: white;
    border: none;
    text-align: left;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.faq-question:hover {
    background-color: var(--background-light);
}

.faq-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    transition: transform var(--transition-base);
    color: var(--accent-color);
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow);
}

.faq-question[aria-expanded="true"] + .faq-answer {
    max-height: 500px;
}

.faq-answer p {
    padding: 0 var(--spacing-lg) var(--spacing-lg);
    color: var(--text-light);
    line-height: 1.7;
}

/* ========================================
   CTA Section
   ======================================== */
.cta {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
}

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

.cta-title {
    color: white;
    font-size: 2.5rem;
    margin-bottom: var(--spacing-md);
}

.cta-subtitle {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-xl);
    color: rgba(255, 255, 255, 0.9);
}

.cta-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    justify-content: center;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background-color: var(--primary-color);
    color: var(--text-color);
    padding: var(--spacing-3xl) 0 var(--spacing-lg);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.footer-column {
    min-width: 0;
}

.footer-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: var(--spacing-md);
}

.footer-description {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.footer-heading {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: var(--spacing-md);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--text-color);
    font-weight: 600;
}

.social-links {
    display: flex;
    gap: var(--spacing-md);
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    color: var(--text-color);
    transition: all var(--transition-base);
}

.social-links a:hover {
    background-color: var(--accent-color);
    color: white;
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing-lg);
    border-top: 1px solid rgba(0, 0, 0, 0.15);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

.fade-in-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger animation delays */
.fade-in:nth-child(1) { animation-delay: 0.1s; }
.fade-in:nth-child(2) { animation-delay: 0.2s; }
.fade-in:nth-child(3) { animation-delay: 0.3s; }
.fade-in:nth-child(4) { animation-delay: 0.4s; }

/* ========================================
   Responsive Utilities
   ======================================== */
@media (max-width: 767px) {
    .hero-cta {
        flex-direction: column;
    }

    .hero-cta .btn {
        width: 100%;
    }

}

/* ========================================
   Accessibility
   ======================================== */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* Focus styles */
a:focus,
button:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
