/* کانتینر اصلی */
.exercise-search-container {
    max-width: 900px; /* کمی باریک‌تر برای خوانایی بهتر لیست */
    margin: 0 auto;
    padding: 50px 20px;
    direction: rtl;
    font-family: inherit; /* ارث‌بری از فونت قالب */
}

/* بخش جستجو */
.search-wrapper {
    margin-bottom: 50px;
}

.search-input-box {
    position: relative;
    max-width: 100%;
}

#exercise-search-input {
    width: 100%;
    padding: 22px 60px 22px 25px;
    font-size: 18px;
    border: none;
    background: #f8f9fa;
    border-radius: 16px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

#exercise-search-input:focus {
    background: #fff;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    transform: translateY(-1px);
    outline: none;
}

.search-icon {
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
    color: #aaa;
    pointer-events: none;
}

/* استایل لیست آیتم‌ها (جایگزین گرید) */
.exercise-list-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.exercise-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    padding: 18px 24px;
    border-radius: 12px;
    border: 1px solid transparent;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

/* افکت هاور زیبا */
.exercise-list-item:hover {
    transform: translateX(-5px); /* حرکت ملایم به چپ */
    border-color: rgba(0,0,0,0.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.06);
}

/* خط رنگی کنار آیتم در حالت هاور */
.exercise-list-item::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #4CAF50;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.exercise-list-item:hover::before {
    opacity: 1;
}

.exercise-item-content {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-grow: 1;
}

.exercise-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.exercise-title a {
    color: inherit;
    text-decoration: none;
}

/* کلیک روی کل سطر */
.exercise-title a::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}

.exercise-meta {
    display: flex;
    gap: 8px;
}

.category-pill {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.exercise-item-action {
    margin-right: 15px;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.2s ease;
}

.exercise-list-item:hover .exercise-item-action {
    opacity: 1;
    transform: translateX(0);
}

.view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #f0f2f5;
    border-radius: 50%;
    color: #555;
}

/* استایل صفحه‌بندی کوتاه شده */
.pagination-wrapper {
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

.pagination {
    background: #fff;
    padding: 8px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    display: inline-flex;
    gap: 5px;
}

.pagination-link {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #555;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.pagination-link:hover {
    background: #f5f5f5;
    color: #000;
}

.pagination-link.active {
    background: #333;
    color: #fff;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.pagination-dots {
    display: flex;
    align-items: center;
    padding: 0 5px;
    color: #aaa;
    letter-spacing: 2px;
}

/* لودینگ و ریسپانسیو */
.search-loading-bar {
    position: absolute;
    bottom: 0;
    left: 20px;
    right: 20px;
    height: 3px;
    background: transparent;
    overflow: hidden;
    border-radius: 0 0 16px 16px;
}

.search-loading-bar-inner {
    width: 40%;
    height: 100%;
    background: #4CAF50;
    transform: translateX(-150%);
    animation: search-anim 1.5s infinite;
    opacity: 0;
}

.search-input-box.loading .search-loading-bar-inner {
    opacity: 1;
}

@keyframes search-anim {
    0% { transform: translateX(-150%); }
    100% { transform: translateX(250%); }
}

@media (max-width: 600px) {
    .exercise-item-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .exercise-list-item {
        padding: 15px;
    }
    
    .exercise-item-action {
        display: none; /* در موبایل فلش را حذف می‌کنیم تا شلوغ نشود */
    }
}
