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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

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

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

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

[dir="rtl"] .hero-actions {
    justify-content: flex-end;
}

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

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

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

p {
    margin-bottom: 1rem;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.btn-primary {
    background-color: #2563eb;
    color: white;
}

.btn-primary:hover {
    background-color: #1d4ed8;
    text-decoration: none;
}

.btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background-color: #e5e7eb;
    text-decoration: none;
}

.btn-block {
    width: 100%;
}

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

.nav {
    padding: 1rem 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1.25rem;
    color: #1f2937;
    text-decoration: none;
}

.nav-logo:hover {
    text-decoration: none;
}

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

.nav-link {
    color: #6b7280;
    font-weight: 500;
    padding: 0.5rem 0;
    transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #2563eb;
    text-decoration: none;
}

.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: #374151;
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    position: relative;
    padding: 4rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.1;
}

.hero-bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

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

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

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

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

.features h2 {
    text-align: center;
    margin-bottom: 3rem;
}

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

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

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

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

.featured-courses h2 {
    text-align: center;
    margin-bottom: 1rem;
}

.section-subtitle {
    text-align: center;
    color: #6b7280;
    margin-bottom: 3rem;
}

.section-actions {
    text-align: center;
    margin-top: 3rem;
}

/* Courses Grid */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

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

.course-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px 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: 1rem;
    margin-bottom: 1rem;
}

.course-category,
.course-difficulty {
    font-size: 0.875rem;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: 500;
}

.course-category {
    background-color: #dbeafe;
    color: #1e40af;
}

.course-difficulty {
    background-color: #f3e8ff;
    color: #7c3aed;
}

.course-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.course-title a {
    color: #1f2937;
    text-decoration: none;
}

.course-title a:hover {
    color: #2563eb;
}

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

.course-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.course-price {
    font-size: 1.25rem;
    font-weight: 600;
    color: #059669;
}

.course-duration {
    color: #6b7280;
    font-size: 0.875rem;
}

/* Page Header */
.page-header {
    padding: 3rem 0;
    background-color: #f9fafb;
    text-align: center;
}

.page-header h1 {
    margin-bottom: 1rem;
}

/* Catalog Filters */
.catalog-filters {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #374151;
}

.filter-input,
.filter-select {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 1rem;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.results-info {
    margin-bottom: 1rem;
    color: #6b7280;
}

/* Course Detail Page */
.course-hero {
    background-color: #f9fafb;
    padding: 3rem 0;
}

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

.course-hero-info h1 {
    margin-bottom: 1rem;
}

.course-stats {
    display: flex;
    gap: 2rem;
    margin: 1rem 0;
    color: #6b7280;
}

.course-instructor {
    color: #6b7280;
}

.course-hero-sidebar .course-card {
    position: sticky;
    top: 2rem;
}

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

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

.course-section {
    margin-bottom: 3rem;
}

.learning-objectives {
    list-style: none;
    padding: 0;
}

.learning-objectives li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.learning-objectives li:before {
    content: "✓";
    color: #059669;
    font-weight: bold;
    margin-right: 0.5rem;
}

.curriculum-list {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.curriculum-item {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.curriculum-item:last-child {
    border-bottom: none;
}

.curriculum-item h4 {
    margin-bottom: 0.5rem;
}

.curriculum-item p {
    color: #6b7280;
    margin: 0;
    font-size: 0.875rem;
}

.instructor-info h3 {
    margin-bottom: 1rem;
}

.faq-list {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.faq-item {
    border-bottom: 1px solid #e5e7eb;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    width: 100%;
    padding: 1rem;
    background: none;
    border: none;
    text-align: left;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question:hover {
    background-color: #f9fafb;
}

.faq-answer {
    padding: 0 1rem 1rem 1rem;
    display: none;
}

.faq-answer.active {
    display: block;
}

.faq-icon {
    font-size: 1.25rem;
    transition: transform 0.2s ease;
}

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

.sidebar-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.sidebar-card h3 {
    margin-bottom: 1rem;
}

.course-details-list {
    list-style: none;
    padding: 0;
}

.course-details-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.course-details-list li:last-child {
    border-bottom: none;
}

/* Checkout Styles */
.checkout {
    padding: 3rem 0;
    background-color: #f9fafb;
    min-height: 80vh;
}

.checkout-header {
    text-align: center;
    margin-bottom: 3rem;
}

.checkout-steps {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
}

.step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6b7280;
}

.step.active {
    color: #2563eb;
}

.step.completed {
    color: #059669;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.step.active .step-number {
    background-color: #2563eb;
    color: white;
}

.step.completed .step-number {
    background-color: #059669;
    color: white;
}

.checkout-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    max-width: 1000px;
    margin: 0 auto;
}

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

.form-section {
    margin-bottom: 2rem;
}

.form-section h2 {
    margin-bottom: 1.5rem;
    color: #1f2937;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

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

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

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

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

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
}

.checkbox-label input[type="checkbox"] {
    margin: 0;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 3px;
    position: relative;
    flex-shrink: 0;
    margin-top: 2px;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background-color: #2563eb;
    border-color: #2563eb;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark:after {
    content: "✓";
    color: white;
    position: absolute;
    top: -2px;
    left: 2px;
    font-size: 12px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-top: 2rem;
}

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

.order-summary h3 {
    margin-bottom: 1.5rem;
    color: #1f2937;
}

.security-notice {
    background: #f0f9ff;
    border: 1px solid #0ea5e9;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 2rem;
}

.security-icons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: #0369a1;
    font-weight: 500;
}

.payment-methods {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Order Success */
.order-success {
    padding: 4rem 0;
    text-align: center;
}

.success-content {
    max-width: 600px;
    margin: 0 auto;
}

.success-icon {
    margin-bottom: 2rem;
}

.success-message {
    font-size: 1.125rem;
    color: #6b7280;
    margin-bottom: 2rem;
}

.order-details {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin: 2rem 0;
    text-align: left;
}

.next-steps {
    margin: 2rem 0;
}

.next-steps ul {
    text-align: left;
    max-width: 400px;
    margin: 0 auto;
}

.success-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* About Page */
.about-content {
    padding: 3rem 0;
}

.about-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
}

.content-section {
    margin-bottom: 3rem;
}

.content-section ul {
    margin-left: 1.5rem;
}

/* Contact Page */
.contact-content {
    padding: 3rem 0;
}

.contact-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
}

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

.contact-info {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.contact-item {
    margin-bottom: 1.5rem;
}

.contact-item h4 {
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.support-hours {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.support-hours ul {
    list-style: none;
    padding: 0;
}

.support-hours li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.support-hours li:last-child {
    border-bottom: none;
}

.quick-links {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.quick-links ul {
    list-style: none;
    padding: 0;
}

.quick-links li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.quick-links li:last-child {
    border-bottom: none;
}

.success-message {
    background: #f0fdf4;
    border: 1px solid #22c55e;
    border-radius: 6px;
    padding: 2rem;
    margin-top: 2rem;
    text-align: center;
}

.success-message h3 {
    color: #15803d;
    margin-bottom: 1rem;
}

/* FAQ Page */
.faq-content {
    padding: 3rem 0;
}

.faq-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
}

.faq-section {
    margin-bottom: 3rem;
}

/* Legal Pages */
.legal-content {
    padding: 3rem 0;
}

.legal-document {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 3rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.legal-section {
    margin-bottom: 3rem;
}

.legal-section h2 {
    color: #1f2937;
    margin-bottom: 1.5rem;
}

.legal-section h3 {
    color: #374151;
    margin: 1.5rem 0 1rem 0;
}

.legal-section ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

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

.contact-info {
    background: #f9fafb;
    padding: 1.5rem;
    border-radius: 6px;
    margin-top: 1rem;
}

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

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

.footer-section h4 {
    color: white;
    margin-bottom: 1rem;
}

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

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

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

.footer-section a {
    color: #d1d5db;
    text-decoration: none;
}

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

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

/* 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 h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

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

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

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

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

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

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

    .about-grid,
    .contact-grid,
    .faq-grid {
        grid-template-columns: 1fr;
    }

    .catalog-filters {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

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

    .success-actions {
        flex-direction: column;
        align-items: center;
    }

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

    .step {
        flex-direction: column;
        text-align: center;
        gap: 0.25rem;
    }

    .step-label {
        font-size: 0.875rem;
    }
}

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

    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }

    .hero {
        padding: 2rem 0;
    }

    .features,
    .featured-courses {
        padding: 2rem 0;
    }

    .page-header {
        padding: 2rem 0;
    }

    .legal-document {
        padding: 1.5rem;
    }

    .checkout-form,
    .contact-form {
        padding: 1.5rem;
    }

    .order-summary,
    .contact-info {
        padding: 1rem;
    }
}

/* Focus Styles for Accessibility */
button:focus,
input:focus,
select:focus,
textarea:focus,
a:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .header,
    .footer,
    .nav,
    .btn,
    .checkout-sidebar,
    .sidebar-card {
        display: none;
    }

    body {
        font-size: 12pt;
        line-height: 1.4;
    }

    .container {
        max-width: none;
        padding: 0;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .btn-primary {
        background-color: #000;
        border: 2px solid #000;
    }

    .btn-secondary {
        background-color: #fff;
        border: 2px solid #000;
        color: #000;
    }

    .course-card {
        border: 2px solid #000;
    }
}

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

    html {
        scroll-behavior: auto;
    }
}