/* استایل‌های عمومی */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Vazir, Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    direction: rtl;
    line-height: 1.8;
}

@media (max-width: 992px) {
.knowledge-base {
    min-height: 100vh;
   
}
}
@media (min-width: 993px) {
.knowledge-base {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* هدر */
.kb-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 40px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.kb-header h1 {
    font-size: 2.5em;
    color: #2d3748;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1em;
    color: #718096;
    font-weight: 300;
}

.admin-link {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 20px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.95em;
    transition: all 0.3s ease;
}

.admin-link:hover {
    background: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.back-link {
    display: inline-block;
    color: #667eea;
    text-decoration: none;
    font-size: 1em;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.back-link:hover {
    color: #764ba2;
    transform: translateX(5px);
}

/* جعبه جستجو */
.search-box {
    margin: 40px 0;
}

.search-box input {
    width: 100%;
    padding: 18px 25px;
    font-size: 1.1em;
    font-family: Vazir, Arial, sans-serif;
    border: none;
    border-radius: 15px;
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    box-shadow: 0 6px 30px rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

/* شبکه دسته‌بندی‌ها */
.categories-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 30px 0 10px;
}

.category-card {
    background: white;
    padding: 35px;
    border-radius: 20px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    flex: 1 1 calc(33.333% - 20px);
    max-width: calc(33.333% - 20px);
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}
.slick-prev:before {
    content: '←' !important;
}
.slick-next:before {
    content: '→' !important;
}

.category-card:hover::before {
    transform: scaleX(1);
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.3);
}

.category-thumb {width:100%;height:140px;border-radius:16px;background:#f1f5f9;margin-bottom:15px;display:flex;align-items:center;justify-content:center;overflow:hidden;}
.category-thumb img {width:100%;height:100%;object-fit:cover;display:block;}
.category-icon-text {font-size:2.6em;}
/* نتایج جستجو */
.search-results {margin-top:20px;}
.search-result-list {display:flex;flex-direction:column;gap:15px;}
.search-result-item {background:#fff;padding:20px 24px;border-radius:16px;text-decoration:none;color:#2d3748;box-shadow:0 4px 15px rgba(0,0,0,.08);transition:.25s;}
.search-result-item:hover {box-shadow:0 8px 25px rgba(0,0,0,.12);transform:translateY(-4px);}
.search-result-item .result-title {font-size:1.2em;font-weight:700;margin-bottom:6px;}
.search-result-item .result-meta {font-size:.8em;color:#64748b;margin-bottom:8px;}
.search-result-item .result-snippet {font-size:.85em;color:#475569;line-height:1.7;}
mark {background:#ffe9a8;color:#b45309;padding:0 4px;border-radius:4px;}

.category-card h2 {
    font-size: 1.5em;
    color: #2d3748;
    margin-bottom: 10px;
}

.category-card p {
    color: #718096;
    margin-bottom: 20px;
    font-size: 0.95em;
}

.category-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #667eea;
    font-size: 0.9em;
    font-weight: bold;
}

@media (max-width: 992px) {
    .category-card {
        flex: 1 1 calc(50% - 20px);
        max-width: calc(50% - 20px);
    }
}

@media (max-width: 576px) {
    .category-card {
        flex: 1 1 100%;
        max-width: 100%;
    }
}

.post-count {
    background: #f7fafc;
    padding: 5px 12px;
    border-radius: 20px;
}

.arrow {
    font-size: 1.5em;
}

/* لیست پست‌ها */
.posts-list {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin: 40px 0;
}

.post-item {
    display: flex;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid #e2e8f0;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.post-item:last-child {
    border-bottom: none;
}

.post-item:hover {
    background: #f7fafc;
    padding-right: 40px;
}

.post-icon {
    font-size: 2.5em;
    margin-left: 20px;
}

.post-info {
    flex: 1;
}

.post-info h3 {
    color: #2d3748;
    font-size: 1.3em;
    margin-bottom: 8px;
}

.post-meta {
    display: flex;
    gap: 20px;
    color: #a0aec0;
    font-size: 0.85em;
}

.post-arrow {
    color: #667eea;
    font-size: 1.5em;
    font-weight: bold;
}

/* محتوای پست */
.post-content {
    background: white;
    border-radius: 20px;
    padding: 50px;
    margin: 40px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.post-header {
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 30px;
    margin-bottom: 40px;
}

.category-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9em;
    margin-bottom: 20px;
}

.post-header h1 {
    font-size: 2.5em;
    color: #2d3748;
    margin-bottom: 15px;
    line-height: 1.4;
}

.post-body {
    font-size: 1.1em;
    color: #4a5568;
    line-height: 2;
}

.post-body h2 {
    color: #2d3748;
    margin: 30px 0 15px;
    font-size: 1.8em;
}

.post-body h3 {
    color: #2d3748;
    margin: 25px 0 12px;
    font-size: 1.4em;
}

.post-body p {
    margin-bottom: 20px;
}

.post-body ul, .post-body ol {
    margin: 20px 0;
    padding-right: 30px;
}

.post-body li {
    margin-bottom: 10px;
}

/* بخش اسلایدها */
.slides-section {
    margin: 50px 0;
    padding: 40px;
    background: #f7fafc;
    border-radius: 15px;
}

.slides-section h2 {
    color: #2d3748;
    font-size: 1.8em;
    margin-bottom: 30px;
}

.tutorial-slider {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.slide-item-view {
    text-align: center;
    padding: 20px;
}

.slide-item-view img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.slide-caption {
    background: white;
    padding: 20px;
    border-radius: 12px;
    color: #4a5568;
    font-size: 1.05em;
    line-height: 1.8;
    margin-top: 15px;
}

/* دکمه‌های Slick */
.slick-prev, .slick-next {
    width: 50px;
    height: 50px;
    background: #667eea !important;
    border-radius: 50%;
    z-index: 1;
    font-size: 0;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
	direction:rtl;
}

.slick-prev:hover, .slick-next:hover {
    background: #764ba2 !important;
    transform: scale(1.1);
}

.slick-prev {
     left: -35px !important;  /* قبلی سمت چپ */
    right: auto !important;
	width: 35px !important;
  height: 35px !important;
}

.slick-next {
       right: -35px !important; /* بعدی سمت راست */
    left: auto !important;
	width: 35px !important;
  height: 35px !important;
}

.slick-prev:before, .slick-next:before {
    color: white;
    font-size: 24px;
}

.slick-dots {
    bottom: -40px;
}

.tutorial-slider .slick-dots {
    direction: ltr;
    display: flex !important;
    justify-content: center;
    gap: 8px;
}

.tutorial-slider .slick-dots li {
    float: none;
}

.slick-dots li button:before {
    font-size: 12px;
    color: #667eea;
}

.slick-dots li.slick-active button:before {
    color: #764ba2;
}

@media (max-width: 992px) {
    .slides-section {
        padding: 30px;
    }

    .tutorial-slider {
        max-width: 100%;
    }

    .tutorial-slider .slick-prev,
    .tutorial-slider .slick-next {
        right: auto;
        left: auto;
    }

    .tutorial-slider .slick-prev {
        right: 10px;
    }

    .tutorial-slider .slick-next {
        left: 10px;
    }
}

@media (max-width: 768px) {
    .slides-section {
        padding: 25px 20px;
    }

    .slide-item-view {
        padding: 12px;
    }

    .slide-item-view img {
        max-height: 360px;
        object-fit: contain;
    }

    .tutorial-slider .slick-prev,
    .tutorial-slider .slick-next {
        width: 42px;
        height: 42px;
        top: 45%;
    }
}

@media (max-width: 576px) {
    .slides-section {
        padding: 20px 15px;
    }

    .slide-caption {
        padding: 15px;
        font-size: 0.95em;
    }

    .tutorial-slider .slick-prev,
    .tutorial-slider .slick-next {
        top: auto;
        bottom: -15px;
        width: 36px;
        height: 36px;
    }

    .tutorial-slider .slick-prev {
        right: calc(50% + 35px);
    }

    .tutorial-slider .slick-next {
        left: calc(50% + 35px);
    }

    .tutorial-slider .slick-dots {
        bottom: -60px;
    }
}

/* عملیات پست */
.post-actions {
    display: flex;
    gap: 15px;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid #e2e8f0;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-family: Vazir, Arial, sans-serif;
    font-size: 1em;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e2e8f0;
    color: #2d3748;
}

.btn-secondary:hover {
    background: #cbd5e0;
    transform: translateY(-2px);
}

/* حالت خالی */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.empty-icon {
    font-size: 5em;
    margin-bottom: 20px;
}

.empty-state h2 {
    color: #2d3748;
    font-size: 1.8em;
    margin-bottom: 15px;
}

.empty-state p {
    color: #718096;
    font-size: 1.1em;
    margin-bottom: 30px;
}

/* فوتر */
.kb-footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 30px 0;
    text-align: center;
    color: #718096;
    margin-top: auto;
}

/* هدر دسته‌بندی */
.category-header {
    display: flex;
    align-items: center;
    gap: 20px;
}

.category-icon-large {
    font-size: 4em;
}

.kb-header-small {
    padding: 30px 0;
}

/* ریسپانسیو */
@media (max-width: 768px) {
    .categories-grid {grid-template-columns:repeat(auto-fill,minmax(180px,1fr));}
    .category-thumb {height:110px;}
    .search-result-item {padding:16px 18px;}
    .search-result-item .result-title {font-size:1.05em;}
    .post-header h1 {font-size:1.8em;}
    .post-body {font-size:1.05em;}
}
@media (max-width:480px){
    .post-content {padding:22px 16px;}
    .slides-section {padding:24px;}
    .category-badge {font-size:.75em;padding:6px 14px;}
    .tutorial-slider {max-width:100%;}
    .slick-prev,.slick-next {width:38px;height:38px;}
    .slick-prev:before,.slick-next:before {font-size:18px;}
}
    

.tutorial-slider {
    direction: rtl; /* راست‌چین کردن محتوا */
}

.tutorial-slider .slick-dots {
    direction: ltr; /* dots چپ به راست */
}
.slick-track {
    direction: rtl !important;
}

.slick-slide {
    direction: rtl !important;
    float: right !important;
}