/* 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.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: #6366f1;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: #6366f1;
    color: white;
}

.btn-primary:hover {
    background-color: #4f46e5;
    text-decoration: none;
}

.btn-secondary {
    background-color: transparent;
    color: #6366f1;
    border: 2px solid #6366f1;
}

.btn-secondary:hover {
    background-color: #6366f1;
    color: white;
    text-decoration: none;
}

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

.btn-outline:hover {
    background-color: #f9fafb;
    text-decoration: none;
}

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

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

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

.nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav a {
    color: #374151;
    font-weight: 500;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.nav a:hover,
.nav a.active {
    color: #6366f1;
    border-bottom-color: #6366f1;
    text-decoration: none;
}

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

.mobile-menu-toggle span {
    width: 20px;
    height: 2px;
    background-color: #374151;
    transition: all 0.2s ease;
}

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

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

.hero-content h1 {
    font-size: 3rem;
    color: #1f2937;
    margin-bottom: 1.5rem;
}

.hero-content p {
    font-size: 1.25rem;
    color: #6b7280;
    margin-bottom: 2rem;
}

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

.hero-image img {
    width: 100%;
    height: auto;
}

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

.features h2 {
    text-align: center;
    margin-bottom: 3rem;
    color: #1f2937;
}

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

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

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

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

.feature-card p {
    color: #6b7280;
    margin-bottom: 0;
}

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

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

.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 4px 6px 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 8px 15px rgba(0, 0, 0, 0.15);
}

.course-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(45deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
}

.course-image img {
    width: 80%;
    height: 80%;
    object-fit: cover;
}

.course-content {
    padding: 1.5rem;
}

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

.course-tag {
    background-color: #e0e7ff;
    color: #6366f1;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
}

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

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

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

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

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

/* Course Detail Page */
.course-detail {
    padding: 2rem 0;
}

.course-header {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 3rem 0;
    margin-bottom: 3rem;
}

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

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

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

.course-sidebar .course-image {
    height: 150px;
    margin-bottom: 1rem;
}

.course-sidebar .course-price {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.course-sidebar .btn {
    width: 100%;
    text-align: center;
    margin-bottom: 1rem;
}

.course-includes {
    list-style: none;
    margin-bottom: 1.5rem;
}

.course-includes li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.course-includes li:before {
    content: "✓";
    color: #059669;
    font-weight: bold;
}

.course-section {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

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

.course-section ul {
    list-style-position: inside;
    color: #6b7280;
}

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

.curriculum-item {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

.instructor-info {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.instructor-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(45deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
}

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

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

.faq-question {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.faq-answer {
    color: #6b7280;
    margin-bottom: 0;
}

/* Courses Page */
.courses-header {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 3rem 0;
    text-align: center;
}

.courses-filters {
    background: white;
    padding: 2rem 0;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 2rem;
}

.filters-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 500;
    color: #374151;
}

.filter-group select,
.filter-group input {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.courses-content {
    padding: 2rem 0;
}

/* Checkout Pages */
.checkout-header {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 2rem 0;
    text-align: center;
}

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

.progress-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    background: #f3f4f6;
    color: #6b7280;
}

.progress-step.active {
    background: #6366f1;
    color: white;
}

.checkout-content {
    padding: 2rem 0;
}

.checkout-form {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

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

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

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

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

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

.order-summary {
    background: #f9fafb;
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.summary-total {
    border-top: 1px solid #d1d5db;
    padding-top: 0.5rem;
    font-weight: 600;
    font-size: 1.25rem;
}

.payment-icons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

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

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

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-top: 0.25rem;
}

/* 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-section h4 {
    color: white;
    margin-bottom: 1rem;
}

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

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

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

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

.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) {
    .container {
        padding: 0 1rem;
    }
    
    .nav {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .courses-grid {
        grid-template-columns: 1fr;
    }
    
    .course-info {
        grid-template-columns: 1fr;
    }
    
    .course-sidebar {
        position: static;
    }
    
    .filters-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .checkout-progress {
        flex-direction: column;
        align-items: center;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
}

@media (max-width: 480px) {
    .hero-actions {
        flex-direction: column;
    }
    
    .btn {
        text-align: center;
    }
    
    .course-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

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

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

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

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

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

[dir="rtl"] .course-info {
    grid-template-columns: 1fr 2fr;
}

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

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

/* Accessibility */
.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;
}

button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

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

.spinner {
    border: 2px solid #f3f4f6;
    border-top: 2px solid #6366f1;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}