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

html {
    font-size: 16px;
    line-height: 1.6;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #333;
    background-color: #fff;
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
    color: #1a1a1a;
}

h2 {
    font-size: 2rem;
    color: #1a1a1a;
    text-align: center;
    margin-bottom: 2rem;
}

h3 {
    font-size: 1.5rem;
    color: #1a1a1a;
}

p {
    margin-bottom: 1rem;
    color: #666;
}

a {
    color: #7c3aed;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #5b21b6;
}

a:focus {
    outline: 2px solid #7c3aed;
    outline-offset: 2px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.2;
}

.btn-primary {
    background-color: #7c3aed;
    color: white;
    border-color: #7c3aed;
}

.btn-primary:hover {
    background-color: #5b21b6;
    border-color: #5b21b6;
    color: white;
}

.btn-secondary {
    background-color: transparent;
    color: #7c3aed;
    border-color: #7c3aed;
}

.btn-secondary:hover {
    background-color: #7c3aed;
    color: white;
}

.btn-outline {
    background-color: transparent;
    color: #374151;
    border-color: #d1d5db;
}

.btn-outline:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
    color: #374151;
}

.btn:focus {
    outline: 2px solid #7c3aed;
    outline-offset: 2px;
}

/* Header */
.header {
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
}

.nav-logo:hover {
    color: #7c3aed;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: #666;
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: #7c3aed;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -0.25rem;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #7c3aed;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 2px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    padding: 4rem 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    position: relative;
    overflow: hidden;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.hero-text h1 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.hero-text p {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    color: #4b5563;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-image img {
    width: 100%;
    height: auto;
    border-radius: 1rem;
}

/* Features Section */
.features {
    padding: 4rem 0;
    background-color: #f9fafb;
}

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

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.feature-card h3 {
    margin-bottom: 1rem;
    color: #1a1a1a;
}

.feature-card p {
    color: #666;
}

/* Courses Grid */
.featured-courses {
    padding: 4rem 0;
}

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

.course-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.course-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.course-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.course-content {
    padding: 1.5rem;
}

.course-meta {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.course-tag {
    background-color: #ede9fe;
    color: #7c3aed;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.course-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
}

.course-description {
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.course-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #666;
}

.course-price {
    font-size: 1.5rem;
    font-weight: 600;
    color: #7c3aed;
    margin-bottom: 1rem;
}

.course-actions {
    display: flex;
    gap: 0.5rem;
}

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

/* Trust Section */
.trust-section {
    padding: 4rem 0;
    background-color: #f9fafb;
}

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

.trust-item {
    text-align: center;
    padding: 2rem;
}

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

.trust-item h3 {
    margin-bottom: 1rem;
    color: #1a1a1a;
}

.trust-item p {
    color: #666;
}

/* Section Footer */
.section-footer {
    text-align: center;
}

/* Footer */
.footer {
    background-color: #1f2937;
    color: #d1d5db;
    padding: 3rem 0 1rem;
}

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

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
    margin-bottom: 1rem;
}

.footer-section h3 {
    color: white;
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #d1d5db;
    transition: color 0.2s;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 1rem;
    text-align: center;
    color: #9ca3af;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    background-color: white;
    cursor: pointer;
}

.form-checkbox {
    width: auto;
    margin-right: 0.5rem;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.checkbox-group label {
    margin-bottom: 0;
    cursor: pointer;
}

/* Error States */
.form-input.error {
    border-color: #ef4444;
}

.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Success States */
.success-message {
    background-color: #dcfce7;
    color: #166534;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid #bbf7d0;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Search and Filter */
.search-filter-bar {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 3rem;
}

.search-filter-content {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 1rem;
    align-items: end;
}

.search-group {
    position: relative;
}

.search-input {
    padding-left: 2.5rem;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

/* Course Detail Page */
.course-hero {
    padding: 3rem 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.course-hero-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: start;
}

.course-info h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.course-sidebar {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 2rem;
}

.course-main {
    padding: 3rem 0;
}

.course-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 2rem;
}

.course-tab {
    padding: 1rem 2rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.course-tab.active {
    color: #7c3aed;
    border-bottom-color: #7c3aed;
}

.course-tab:hover {
    color: #7c3aed;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Checkout */
.checkout-steps {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
}

.step {
    display: flex;
    align-items: center;
    padding: 1rem 2rem;
    background: #f3f4f6;
    color: #666;
    position: relative;
}

.step.active {
    background: #7c3aed;
    color: white;
}

.step.completed {
    background: #10b981;
    color: white;
}

.step::after {
    content: '';
    position: absolute;
    right: -1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 1rem solid;
    border-top: 1.5rem solid transparent;
    border-bottom: 1.5rem solid transparent;
}

.step.active::after {
    border-left-color: #7c3aed;
}

.step.completed::after {
    border-left-color: #10b981;
}

.step:last-child::after {
    display: none;
}

.checkout-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 3rem;
}

.checkout-form {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.checkout-summary {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.payment-icons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin: 1rem 0;
}

.payment-icon {
    width: 40px;
    height: 25px;
    background: #f3f4f6;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #666;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

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

    .nav-toggle {
        display: flex;
    }

    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-text h1 {
        font-size: 2rem;
    }

    .search-filter-content {
        grid-template-columns: 1fr;
    }

    .course-hero-content {
        grid-template-columns: 1fr;
    }

    .checkout-content {
        grid-template-columns: 1fr;
    }

    .checkout-steps {
        flex-direction: column;
        align-items: center;
    }

    .step::after {
        display: none;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }

    .hero {
        padding: 2rem 0;
    }

    .hero-text h1 {
        font-size: 1.75rem;
    }

    .hero-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

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

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

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

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* RTL Support */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] .nav-content {
    flex-direction: row-reverse;
}

[dir="rtl"] .nav-logo {
    flex-direction: row-reverse;
}

[dir="rtl"] .hero-content {
    grid-template-columns: 1fr 1fr;
}

[dir="rtl"] .search-icon {
    left: auto;
    right: 0.75rem;
}

[dir="rtl"] .search-input {
    padding-left: 0.75rem;
    padding-right: 2.5rem;
}

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

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for better accessibility */
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #7c3aed;
    outline-offset: 2px;
}