* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    direction: rtl;
}

body {
    background: linear-gradient(135deg, #6b46c1 0%, #805ad5 25%, #d53f8c 50%, #ed64a6 75%, #fbb6ce 100%);
    color: #1f2937;
    font-family: 'IRANSans', 'Vazirmatn', Arial, sans-serif;
    min-height: 100vh;
    line-height: 1.6;
    direction: rtl;
    text-align: right;
}

.floating-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgb(124, 58, 237);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 30px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 6px 15px rgba(124, 58, 237, 0.3);
    transition: all 0.3s ease;
    z-index: 999;
}
.floating-btn:hover {
    background: var(--primary-light);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.4);
}
.floating-btn i {
    font-size: 1.2rem;
}

.hero-section {
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    color: white;
    padding: 5rem 0 3rem;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.3;
}

.category-header {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
    position: relative;
    z-index: 2;
}

.category-title {
    font-size: 3rem;
    font-weight: 800;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    background: linear-gradient(135deg, #ffffff 0%, #e9d5ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.category-stats {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    border: 1px solid rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.controls-section {
    max-width: 1200px;
    margin: 0 auto 3rem;
    padding: 0 1.5rem;
}

.controls-wrapper {
    background: white;
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 8px 30px rgba(124, 58, 237, 0.08);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    align-items: end;
}

.search-wrapper {
    position: relative;
}

.search-bar {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.search-bar:focus-within {
    border-color: #7c3aed;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
    background: white;
}

.search-bar i {
    color: #7c3aed;
    font-size: 1.2rem;
    margin-left: 1rem;
}

.search-bar input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 1rem;
    color: #1e293b;
    background: transparent;
    text-align: right;
    font-family: inherit;
}

.filter-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-label {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
}

.sort-select {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
    text-align: right;
    font-family: inherit;
}

.sort-select:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
    outline: none;
}

.courses-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.course-card {
    background: white;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(107, 114, 128, 0.12);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    border: 1px solid #f1f5f9;
}

.course-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 50px rgba(124, 58, 237, 0.25);
}

.course-image-section {
    position: relative;
    overflow: hidden;
}

.course-image-wrapper {
    width: 100%;
    height: 240px;
    overflow: hidden;
    background: #f8fafc;
}

.course-image {
    width: 100%;
    height: 100%;
    object-fit: fill;
    transition: transform 0.7s ease;
}

.course-card:hover .course-image {
    transform: scale(1.1);
}

.logo-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 0.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 3;
    border: 1px solid rgba(124, 58, 237, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
}

.logo-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.logo-fallback {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
}

.price-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.4);
    z-index: 2;
}

.image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(124, 58, 237, 0.9) 0%, rgba(124, 58, 237, 0.2) 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.course-card:hover .image-overlay {
    opacity: 1;
}

.course-content {
    padding: 1.5rem;
    text-align: right;
}

.course-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1rem;
    line-height: 1.4;
    min-height: 3.5rem;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
}

.course-duration {
    color: #64748b;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.course-duration i {
    color: #7c3aed;
    font-size: 1rem;
}

.enroll-btn {
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.enroll-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.5);
    background: linear-gradient(135deg, #6b46c1 0%, #4338ca 100%);
}

.course-decoration {
    position: absolute;
    bottom: -3rem;
    left: -3rem;
    width: 6rem;
    height: 6rem;
    border-radius: 50%;
    background: #e9d5ff;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.course-card:hover .course-decoration {
    opacity: 1;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 24px;
    margin: 2rem 0;
}

.empty-icon {
    width: 5rem;
    height: 5rem;
    border-radius: 50%;
    background: #f1f5f9;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.empty-icon i {
    font-size: 2.5rem;
    color: #94a3b8;
}

.empty-state h3 {
    color: #475569;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 1.5rem;
}

.empty-state p {
    color: #64748b;
    font-size: 1.1rem;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-item {
    animation: fadeInUp 0.6s ease-out;
}