* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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;
}

.page-header {
    padding: 4rem 0 2rem;
    text-align: center;
    background: transparent;
}

.page-title {
    background: linear-gradient(135deg, #ffffff 0%, #e9d5ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.page-subtitle {
    color: #e9d5ff;
    font-size: 1.2rem;
    font-weight: 400;
}

.contact-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    color: #fff;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.contact-fab:hover {
    transform: translateY(-8px) scale(1.1);
    box-shadow: 0 15px 35px rgba(124, 58, 237, 0.6);
}

.search-filters-container {
    max-width: 1200px;
    margin: 0 auto 3rem;
    padding: 0 1.5rem;
}

.search-wrapper {
    background: #ffffff;
    border-radius: 20px;
    padding: 1.5rem 2rem;
    box-shadow: 0 4px 25px rgba(107, 114, 128, 0.15);
    margin-bottom: 1.5rem;
}

.search-form {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border-radius: 50px;
    padding: 1rem 1.5rem;
    transition: all 0.3s ease;
    gap: 1rem;
}

.search-form:focus-within {
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.search-form input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 1.1rem;
    color: #1f2937;
    background: transparent;
    font-family: inherit;
    padding: 0.5rem;
    text-align: right;
    direction: rtl;
}

.search-form button {
    background: #7c3aed;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s ease;
    white-space: nowrap;
}

.search-form button:hover {
    background: #6b46c1;
}

.search-form i {
    color: #7c3aed;
    margin-left: 0;
    margin-right: 12px;
    font-size: 1.3rem;
}

.filters-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #6b7280;
    font-weight: 500;
    text-align: right;
}

.filter-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
    color: #1f2937;
    font-size: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: right;
    direction: rtl;
}

.filter-select:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.categories-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.category-item {
    perspective: 1000px;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: #ffffff;
    border-radius: 24px;
    padding: 2rem 1.5rem;
    height: 100%;
    box-shadow: 0 8px 30px rgba(107, 114, 128, 0.12);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: #1f2937;
    position: relative;
    overflow: hidden;
    border: 1px solid #f3f4f6;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.category-card:hover {
    transform: translateY(-12px) rotateX(5deg);
    box-shadow: 0 20px 50px rgba(124, 58, 237, 0.25);
}

.category-card:hover::before {
    transform: scaleX(1);
}

.image-container {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 1.5rem;
    border: 4px solid #f3f4f6;
    position: relative;
    transition: all 0.4s ease;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.4s ease;
}

.category-card:hover .image-container {
    transform: scale(1.1);
    border-color: #e9d5ff;
}

.category-card:hover .image-container img {
    transform: scale(1.15);
}

.count-badge {
    position: absolute;
    top: -8px;
    left: -8px;
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
    z-index: 2;
}

.category-card h5 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #374151;
    line-height: 1.4;
}

.course-count {
    background: #f8fafc;
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    margin-top: auto;
    transition: all 0.3s ease;
}

.category-card:hover .course-count {
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    color: #ffffff;
    transform: translateY(-2px);
}

.no-course {
    background: #f9fafb;
    color: #9ca3af;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    margin: 2rem 0;
    direction: rtl;
}

.empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #f3f4f6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.empty-icon i {
    font-size: 2rem;
    color: #9ca3af;
}

.empty-state h3 {
    color: #6b7280;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.empty-state p {
    color: #9ca3af;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-item {
    animation: fadeInUp 0.6s ease-out;
}