/*
Theme Name: Courses Pro Theme
Theme URI: https://shavix.xyz
Author: Ali Sohrabi
Author URI: https://shavix.xyz
Description: A beautiful dark theme for courses with modern design
Version: 1.2.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: courses-theme
Tags: dark, courses, rtl, modern, responsive
*/

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #96F207;
    --bg-dark: #0a0a0a;
    --bg-card: #1a1a1a;
    --bg-hover: #252525;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --border-color: #2a2a2a;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s ease;
    --header-height: 70px;
    --accent-purple: #8B5CF6;
    --accent-blue: #3B82F6;
    --accent-pink: #EC4899;
}

body {
    font-family: 'Yekan Bakh', 'Vazir', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    direction: rtl;
    overflow-x: hidden;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: #b8ff3d;
}

/* Header */
.site-header {
    background: linear-gradient(180deg, #0f0f0f 0%, var(--bg-dark) 100%);
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    height: var(--header-height);
}

.header-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.site-logo {
    font-size: 26px;
    font-weight: 700;
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(150, 242, 7, 0.3);
}

.site-logo a {
    color: var(--primary-color);
}

.main-navigation {
    display: flex;
    gap: 30px;
    align-items: center;
}

.main-navigation ul {
    display: flex;
    list-style: none;
    gap: 25px;
    margin: 0;
    padding: 0;
}

.main-navigation a {
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    position: relative;
    padding: 5px 0;
}

.main-navigation a::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.main-navigation a:hover::after {
    width: 100%;
}

/* Search Box with Live Search */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border-radius: 25px;
    padding: 8px 15px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(150, 242, 7, 0.2);
}

.search-box input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    outline: none;
    width: 200px;
    font-family: inherit;
    font-size: 14px;
}

.search-box input::placeholder {
    color: var(--text-secondary);
}

.search-box button {
    background: transparent;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 18px;
    padding: 0 5px;
}

/* Live Search Results - Beautiful Design */
.live-search-results {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    left: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    max-height: 500px;
    overflow-y: auto;
    display: none;
    z-index: 9999;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
}

.live-search-results.active {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--bg-hover);
    padding-right: 20px;
}

.search-result-thumb {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.search-result-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.search-result-item:hover .search-result-thumb img {
    transform: scale(1.1);
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-result-meta {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: var(--text-secondary);
    align-items: center;
}

.search-result-category {
    background: var(--bg-hover);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    color: var(--primary-color);
}

.search-result-arrow {
    color: var(--text-secondary);
    font-size: 18px;
    transition: var(--transition);
}

.search-result-item:hover .search-result-arrow {
    color: var(--primary-color);
    transform: translateX(-5px);
}

.search-no-results {
    padding: 30px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

.search-no-results-icon {
    font-size: 40px;
    margin-bottom: 10px;
    opacity: 0.5;
}

.search-loading {
    padding: 30px;
    text-align: center;
}

.search-loading::after {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    padding: 50px 0;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.hero-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.hero-title {
    font-size: 38px;
    font-weight: 700;
    margin-bottom: 12px;
    background: linear-gradient(90deg, var(--primary-color), #b8ff3d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
}

/* Homepage Grid Layout */
.homepage-grid {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px 50px;
}

.category-block {
    margin-bottom: 50px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    position: relative;
    padding-right: 15px;
}

.section-title::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 28px;
    background: var(--primary-color);
    border-radius: 2px;
}

.view-all {
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.view-all:hover {
    gap: 10px;
}

/* Posts Grid - 5 columns */
.posts-grid-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

/* Post Card - New Design like image */
.post-card {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(150, 242, 7, 0.15);
    border-color: var(--primary-color);
}

.post-thumbnail {
    width: 100%;
    aspect-ratio: 16/10;
    overflow: hidden;
    position: relative;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.post-card:hover .post-thumbnail img {
    transform: scale(1.1);
}

/* Badges on thumbnail */
.post-badges {
    position: absolute;
    top: 12px;
    right: 12px;
    left: 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.post-level-badge {
    background: rgba(0, 0, 0, 0.7);
    color: var(--text-primary);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.post-download-badge {
    background: var(--accent-purple);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-content {
    padding: 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 45px;
}

.post-title a {
    color: var(--text-primary);
}

.post-title a:hover {
    color: var(--primary-color);
}

.post-excerpt {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

/* Tags */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 15px;
}

.post-tag {
    background: var(--bg-hover);
    color: var(--text-secondary);
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 10px;
    transition: var(--transition);
}

.post-tag:hover {
    background: var(--primary-color);
    color: var(--bg-dark);
}

/* View Course Link */
.post-view-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 600;
    margin-top: auto;
}

.post-view-link:hover {
    gap: 10px;
}

/* Post Meta Footer */
.post-meta-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-secondary);
}

.post-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Footer */
.site-footer {
    background: #050505;
    padding: 25px 0;
    margin-top: 50px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-text {
    color: var(--text-secondary);
    font-size: 14px;
}

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

/* Single Post Page */
.single-post {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}

.single-post-header {
    margin-bottom: 30px;
}

.single-post-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.3;
}

.single-post-meta {
    display: flex;
    gap: 20px;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.single-post-thumbnail {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 30px;
}

.single-post-thumbnail img {
    width: 100%;
    height: auto;
}

.single-post-content {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    line-height: 1.8;
}

.single-post-content p {
    margin-bottom: 20px;
}

.single-post-content h2,
.single-post-content h3 {
    margin: 30px 0 15px;
    color: var(--primary-color);
}

/* Category Page */
.category-header {
    max-width: 1600px;
    margin: 40px auto 30px;
    padding: 0 20px;
}

.category-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
}

.category-description {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Category Grid */
.category-grid {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px 50px;
}

.category-posts-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

/* Pagination */
.pagination {
    max-width: 1600px;
    margin: 40px auto;
    padding: 0 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 10px 15px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    transition: var(--transition);
}

.pagination a:hover,
.pagination .current {
    background: var(--primary-color);
    color: var(--bg-dark);
    border-color: var(--primary-color);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--primary-color);
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .posts-grid-5,
    .category-posts-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1024px) {
    .posts-grid-5,
    .category-posts-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .hero-title {
        font-size: 32px;
    }
    
    .section-title {
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    .site-header {
        padding: 10px 0;
        height: auto;
    }
    
    .header-container {
        flex-wrap: wrap;
        gap: 10px;
        height: auto;
        padding: 10px 15px;
    }
    
    .site-logo {
        font-size: 22px;
    }
    
    .menu-toggle {
        display: block;
        order: 3;
    }
    
    .main-navigation {
        display: none;
        width: 100%;
        order: 4;
        flex-direction: column;
        gap: 0;
        margin-top: 10px;
        background: var(--bg-card);
        border-radius: 12px;
        padding: 15px;
        border: 1px solid var(--border-color);
    }
    
    .main-navigation.active {
        display: flex;
    }
    
    .main-navigation ul {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }
    
    .main-navigation li {
        border-bottom: 1px solid var(--border-color);
    }
    
    .main-navigation li:last-child {
        border-bottom: none;
    }
    
    .main-navigation a {
        display: block;
        padding: 12px 0;
        font-size: 15px;
    }
    
    .main-navigation a::after {
        display: none;
    }
    
    .search-box {
        order: 2;
        flex: 1;
        min-width: 0;
    }
    
    .search-box input {
        width: 100%;
        min-width: 0;
    }
    
    .live-search-results {
        position: fixed;
        top: var(--header-height);
        right: 10px;
        left: 10px;
        max-height: 70vh;
        border-radius: 12px;
    }
    
    .search-result-item {
        padding: 12px;
    }
    
    .search-result-thumb {
        width: 60px;
        height: 60px;
    }
    
    .hero-section {
        padding: 30px 0;
        margin-bottom: 20px;
    }
    
    .hero-title {
        font-size: 26px;
    }
    
    .hero-subtitle {
        font-size: 14px;
    }
    
    .homepage-grid,
    .category-grid {
        padding: 0 15px 30px;
    }
    
    .category-block {
        margin-bottom: 30px;
    }
    
    .section-header {
        margin-bottom: 15px;
        padding-bottom: 10px;
    }
    
    .section-title {
        font-size: 18px;
    }
    
    .posts-grid-5,
    .category-posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .post-card {
        border-radius: 12px;
    }
    
    .post-content {
        padding: 12px;
    }
    
    .post-title {
        font-size: 14px;
        min-height: 40px;
    }
    
    .post-excerpt {
        font-size: 12px;
        -webkit-line-clamp: 2;
    }
    
    .single-post {
        margin: 20px auto;
        padding: 0 15px;
    }
    
    .single-post-title {
        font-size: 24px;
    }
    
    .single-post-content {
        padding: 20px;
    }
    
    .single-post-meta {
        gap: 10px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .posts-grid-5,
    .category-posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .post-title {
        font-size: 13px;
        min-height: 36px;
    }
    
    .post-badges {
        top: 8px;
        right: 8px;
        left: 8px;
    }
    
    .post-level-badge,
    .post-download-badge {
        font-size: 10px;
        padding: 3px 7px;
    }
    
    .hero-title {
        font-size: 22px;
    }
    
    .section-title {
        font-size: 16px;
    }
}

/* Loading Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-card {
    animation: fadeIn 0.5s ease forwards;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-card);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 45px;
    height: 45px;
    background: var(--primary-color);
    color: var(--bg-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
    box-shadow: 0 4px 10px rgba(150, 242, 7, 0.3);
    border: none;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #b8ff3d;
    transform: translateY(-3px);
}

/* Error 404 */
.error-404 {
    max-width: 600px;
    margin: 80px auto;
    text-align: center;
    padding: 0 20px;
}

.error-404 h1 {
    font-size: 100px;
    color: var(--primary-color);
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(150, 242, 7, 0.5);
}

.error-404 h2 {
    font-size: 28px;
    margin-bottom: 15px;
}

.error-404 p {
    color: var(--text-secondary);
    margin-bottom: 30px;
    line-height: 1.8;
}

.btn-primary {
    display: inline-block;
    padding: 12px 30px;
    background: var(--primary-color);
    color: var(--bg-dark);
    border-radius: 25px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary:hover {
    background: #b8ff3d;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(150, 242, 7, 0.4);
}

/* No Results */
.no-results {
    text-align: center;
    padding: 50px 20px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.no-results h2 {
    font-size: 24px;
    margin-bottom: 15px;
}

.no-results p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Post Tags */
.post-tags-section {
    margin-top: 30px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.post-tags-section h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.post-tags-section .tag {
    display: inline-block;
    padding: 5px 12px;
    background: var(--bg-hover);
    border-radius: 15px;
    margin-left: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    transition: var(--transition);
}

.post-tags-section .tag:hover {
    background: var(--primary-color);
    color: var(--bg-dark);
}

/* Related Posts */
.related-posts {
    margin-top: 40px;
}

.related-posts h2 {
    font-size: 22px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (max-width: 1024px) {
    .related-posts-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .related-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Comments */
.comments-area {
    margin-top: 40px;
    padding: 25px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.comments-title {
    font-size: 22px;
    margin-bottom: 20px;
}

.comment-list {
    list-style: none;
    padding: 0;
}

.comment {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.comment:last-child {
    border-bottom: none;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.comment-author img {
    border-radius: 50%;
}

.comment-metadata {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.comment-content {
    line-height: 1.8;
}

/* Comment Form */
.comment-form {
    margin-top: 25px;
}

.comment-form p {
    margin-bottom: 15px;
}

.comment-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 12px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    transition: var(--transition);
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.comment-form textarea {
    min-height: 120px;
    resize: vertical;
}

.comment-form .submit {
    padding: 12px 30px;
    background: var(--primary-color);
    color: var(--bg-dark);
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.comment-form .submit:hover {
    background: #b8ff3d;
    transform: translateY(-2px);
}

/* Widgets */
.widget {
    margin-bottom: 25px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.widget-title {
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.widget ul {
    list-style: none;
    padding: 0;
}

.widget li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.widget li:last-child {
    border-bottom: none;
}