:root {
    --primary-green: #73BA25;
    --dark-green: #5A8F1E;
    --light-green: #8BC34A;
    --dark-bg: #1A1A1A;
    --card-bg: #FFFFFF;
    --text-dark: #2D2D2D;
    --text-light: #6C757D;
    --shadow: 0 8px 32px rgba(0,0,0,0.08);
    --shadow-hover: 0 12px 48px rgba(115, 186, 37, 0.15);
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base */
body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    background: #F8FAF5;
    color: var(--text-dark);
    direction: rtl;
}

/* Navbar */
.navbar {
    background: rgba(255,255,255,0.95) !important;
    backdrop-filter: blur(12px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.06);
    padding: 0.75rem 0;
    border-bottom: 2px solid rgba(115, 186, 37, 0.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--text-dark) !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-highlight {
    color: var(--primary-green);
}

.navbar-brand img {
    height: 40px;
    width: auto;
}

.nav-link {
    color: var(--text-dark) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: var(--transition);
}

.nav-link:hover {
    background: rgba(115, 186, 37, 0.08);
    color: var(--primary-green) !important;
}

.nav-link i {
    margin-left: 6px;
}

/* Buttons */
.btn-primary {
    background: var(--primary-green);
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    transition: var(--transition);
    color: white;
}

.btn-primary:hover {
    background: var(--dark-green);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(115, 186, 37, 0.35);
}

.btn-outline-primary {
    color: var(--primary-green);
    border: 2px solid var(--primary-green);
    background: transparent;
    padding: 0.6rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-outline-primary:hover {
    background: var(--primary-green);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(115, 186, 37, 0.25);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #1A2A0A 0%, #2D4A12 50%, #3D5F1A 100%);
    padding: 5rem 0 4rem;
    border-radius: 0 0 40px 40px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(circle, rgba(115, 186, 37, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.hero-section .display-4 {
    font-weight: 800;
    color: white;
    text-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.hero-section .lead {
    color: rgba(255,255,255,0.85);
    font-weight: 400;
}

.hero-section .btn-light {
    background: white;
    color: var(--dark-green);
    padding: 0.8rem 2.5rem;
    border-radius: 12px;
    font-weight: 700;
    transition: var(--transition);
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.hero-section .btn-light:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

/* Stats Cards */
.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.stat-card h2 {
    color: var(--primary-green);
    font-weight: 800;
    font-size: 2.5rem;
}

.stat-card p {
    color: var(--text-dark);
    margin: 0;
    font-weight: 500;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    overflow: hidden;
    background: var(--card-bg);
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

.card-course .card-img-top {
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, #E8F5E0, #C8E6B0);
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.card-text {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Badges */
.badge {
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.75rem;
}

.bg-success {
    background: var(--primary-green) !important;
}

.bg-warning {
    background: #FFB74D !important;
    color: #1A1A1A;
}

/* Footer */
.footer {
    background: var(--dark-bg);
    color: rgba(255,255,255,0.7);
    padding: 4rem 0 2rem;
    margin-top: 4rem;
}

.footer h5 {
    color: white;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.footer a {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    transition: var(--transition);
}

.footer a:hover {
    color: var(--primary-green);
}

.footer .social-link {
    display: inline-block;
    width: 42px;
    height: 42px;
    line-height: 42px;
    text-align: center;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
    transition: var(--transition);
    color: rgba(255,255,255,0.7);
}

.footer .social-link:hover {
    background: var(--primary-green);
    color: white;
    transform: translateY(-2px);
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-weight: 700;
    color: var(--text-dark);
}

.section-header h2 i {
    color: var(--primary-green);
    margin-left: 0.75rem;
}

/* Utilities */
.gradient-text {
    background: linear-gradient(135deg, var(--primary-green), var(--dark-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.bg-green-soft {
    background: linear-gradient(135deg, #F0F7EB, #E0F0D8);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 0 2rem;
        border-radius: 0 0 20px 20px;
    }
    
    .hero-section .display-4 {
        font-size: 2rem;
    }
    
    .stat-card h2 {
        font-size: 1.8rem;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .navbar-brand img {
        height: 32px;
    }
    
    .card-course .card-img-top {
        height: 150px;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeInUp 0.6s ease forwards;
}

/* Progress Circles */
.progress-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    border: 2px solid #dee2e6;
    background: #f8f9fa;
    transition: all 0.3s ease;
}
.progress-circle.completed {
    background: #28a745;
    border-color: #28a745;
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.3);
}
.progress-circle.failed {
    background: #dc3545;
    border-color: #dc3545;
    box-shadow: 0 0 8px rgba(220, 53, 69, 0.3);
}
.progress-circle.pending {
    background: #ffc107;
    border-color: #ffc107;
    box-shadow: 0 0 8px rgba(255, 193, 7, 0.3);
}
.progress-circle.manual {
    background: #6c757d;
    border-color: #6c757d;
}
.progress-container {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-wrap: wrap;
}
.accordion-button .progress-container {
    margin-right: 10px;
}
.lesson-content-inline {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 0.5rem;
}
.lesson-content-inline img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}
.lesson-content-inline pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
}
.lesson-content-inline code {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}
.accordion-button:not(.collapsed) {
    background: rgba(115, 186, 37, 0.05);
    color: #2d2d2d;
}
.accordion-button:focus {
    box-shadow: none;
    border-color: rgba(115, 186, 37, 0.3);
}
.badge-progress {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
}
.lesson-description {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
/* Playground - Code Editor */
.code-editor {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    direction: ltr;
    text-align: left;
    background: #1e1e1e;
    color: #d4d4d4;
    border: none;
    border-radius: 8px;
    padding: 1rem;
    width: 100%;
    min-height: 300px;
    resize: vertical;
    tab-size: 4;
}
.code-editor:focus {
    outline: 2px solid var(--primary-green);
    outline-offset: 2px;
}
.output-area {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    min-height: 100px;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    direction: ltr;
    text-align: left;
}
.output-area.error {
    background: #f8d7da;
    color: #721c24;
}
.output-area.success {
    background: #d4edda;
    color: #155724;
}
.test-case-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    margin: 0 4px;
}
.test-case-circle.pass {
    background: #28a745;
    color: white;
}
.test-case-circle.fail {
    background: #dc3545;
    color: white;
}
.test-case-circle.pending {
    background: #ffc107;
    color: #212529;
}
.question-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}
.question-content pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
}
.question-content code {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

/* Force LTR for code blocks */
.code-block {
    direction: ltr;
    text-align: left;
    unicode-bidi: embed;
}

pre[dir="ltr"] {
    direction: ltr !important;
    text-align: left !important;
}

/* Code Playground */
.code-editor {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    direction: ltr;
    text-align: left;
    background: #1e1e1e;
    color: #d4d4d4;
    border: none;
    border-radius: 8px;
    padding: 1rem;
    width: 100%;
    min-height: 300px;
    resize: vertical;
    tab-size: 4;
    line-height: 1.6;
}
.code-editor:focus {
    outline: 2px solid var(--primary-green);
    outline-offset: 2px;
}
.code-output {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    direction: ltr;
    text-align: left;
    white-space: pre-wrap;
    word-break: break-word;
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 1rem;
    border-radius: 8px;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
}
.code-output .error {
    color: #f48771;
}
.code-output .success {
    color: #6a9955;
}
.code-output .warning {
    color: #ffc107;
}
