/*
 Theme Name: MRKB Theme
 Theme URI: https://mrkb.ir
 Author: MRKB (Master Kilobyte)
 Author URI: https://mrkb.ir
 Description: A modern WordPress theme with a galactic and glassmorphism design, built for portfolios and blogs. Optimized for Persian SEO, speed, and responsiveness.
 Version: 1.6
 License: GNU General Public License v2 or later
 License URI: http://www.gnu.org/licenses/gpl-2.0.html
 Text Domain: mrkb-theme
 Tags: portfolio, blog, galactic, glassmorphism, responsive, rtl, seo, accessibility
*/

/* =CSS Variables
-------------------------------------------------------------- */
:root {
    --primary-color: #7b7bff; /* روشن‌تر برای کنتراست بهتر */
    --secondary-color: #ff7b7b; /* روشن‌تر برای کنتراست بهتر */
    --text-color: #fff;
    --background-gradient: linear-gradient(180deg, #0a0a23 0%, #1a1a4a 100%);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
    --shadow-hover: 0 8px 40px rgba(0, 0, 0, 0.3);
    --border-radius: 15px;
    --transition: all 0.3s ease;
}

/* =Reset and Base Styles
-------------------------------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: clamp(14px, 2.5vw, 16px);
}

body {
    font-family: 'Vazir', sans-serif;
    direction: rtl;
    background: var(--background-gradient);
    color: var(--text-color);
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.menu-open,
body.sidebar-open {
    overflow: hidden;
}

/* =Particles Background
-------------------------------------------------------------- */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.8;
    background: transparent !important;
}

/* =Glassmorphism Effect - reduced blur on mobile via media query */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

@media (max-width: 768px) {
    .glass {
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
    }
}

.glass:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-5px);
}

/* =Font Import (Default) */
@font-face {
    font-family: 'Vazir';
    src: url('/wp-content/themes/mrkb-theme/fonts/Vazir.woff2') format('woff2'),
         url('/wp-content/themes/mrkb-theme/fonts/Vazir.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* =Header Styles
-------------------------------------------------------------- */
header {
    position: sticky;
    top: 10px;
    z-index: 1000;
    padding: 15px 0;
    transition: var(--transition);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo-img {
    max-height: 50px;
    width: auto;
    transition: transform var(--transition);
}

.logo-img:hover {
    transform: scale(1.05);
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--text-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo::before {
    content: '';
    width: 30px;
    height: 30px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm0 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16z" fill="white"/></svg>') no-repeat center;
    background-size: contain;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 15px;
}

nav ul li a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 16px;
    padding: 10px 15px;
    transition: var(--transition);
    position: relative;
    border-radius: 10px;
}

nav ul li a:hover,
nav ul li a:focus {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 5px;
    right: 10px;
    width: 0;
    height: 2px;
    background: linear-gradient(45deg, var(--secondary-color), #ff8e53);
    transition: width var(--transition);
}

nav ul li a:hover::after {
    width: calc(100% - 20px);
}

/* =Mobile Menu Sidebar */
#mobile-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    max-width: 90%;
    height: 100vh;
    background-color: rgba(25, 25, 25, 0.95);
    color: #fff;
    padding: 2rem 1.5rem;
    z-index: 9999;
    transition: transform 0.3s ease-in-out;
    overflow-y: auto;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
    direction: rtl;
    backdrop-filter: blur(10px);
}

#mobile-sidebar.active {
    right: 0;
}

#mobile-sidebar-close {
    background: var(--glass-bg);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    color: var(--text-color);
    font-size: 24px;
    cursor: pointer;
    position: absolute;
    top: 20px;
    left: 20px;
    transition: var(--transition);
}

#mobile-sidebar-close:hover {
    background: linear-gradient(45deg, var(--primary-color), #8e53ff);
    transform: scale(1.1);
}

.mobile-menu {
    list-style: none;
    padding: 0;
    margin-top: 4rem;
}

.mobile-menu li {
    margin-bottom: 1.2rem;
}

.mobile-menu a {
    color: #fff;
    text-decoration: none;
    font-size: 1rem;
    display: block;
    padding: 0.5rem 1rem;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: background 0.3s;
}

.mobile-menu a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.mobile-menu-btn {
    border-radius: 10px;
    padding: 5px 10px;
    background-color: rgb(25 25 25 / 40%);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #fff;
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 1001;
}

.mobile-menu-btn:hover {
    transform: scale(1.1);
}

.mobile-menu-btn i {
    font-size: 20px;
}

/* =Filter Sidebar */
.sidebar-mobile {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    max-width: 80%;
    height: 100%;
    background-color: rgba(25, 25, 25, 0.95);
    color: #fff;
    padding: 2rem 1.5rem;
    z-index: 9998;
    transition: transform 0.3s ease-in-out;
    overflow-y: auto;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
    direction: rtl;
    backdrop-filter: blur(10px);
}

.sidebar-mobile.active {
    right: 0;
}

.sidebar-mobile-close {
    background: var(--glass-bg);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    color: var(--text-color);
    font-size: 24px;
    cursor: pointer;
    position: absolute;
    top: 20px;
    left: 20px;
    transition: var(--transition);
}

.sidebar-mobile-close:hover {
    background: linear-gradient(45deg, var(--primary-color), #8e53ff);
    transform: scale(1.1);
}

.sidebar-mobile-btn {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 15px;
    width: 50px;
    height: 50px;
    background: linear-gradient(45deg, var(--secondary-color), #ff8e53);
    color: var(--text-color);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1001;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
}

.sidebar-mobile-btn:hover {
    transform: scale(1.1);
}

.sidebar-mobile-btn i {
    font-size: 20px;
}

/* =Main Content */
main {
    flex: 1;
    padding: 20px 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =Footer Styles */
footer.glass {
    padding: 20px 15px;
    text-align: center;
    margin-top: auto;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

footer p {
    font-size: 14px;
    opacity: 0.8;
    margin: 0;
}

footer a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease, transform 0.3s ease;
}

footer a:hover {
    color: var(--primary-color);
    transform: scale(1.05);
}

.footer-social {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 10px;
}

.social-link {
    color: var(--text-color);
    font-size: 24px;
    transition: transform 0.3s ease, color 0.3s ease;
}

.social-link:hover {
    transform: scale(1.2);
    color: var(--primary-color);
}

@media (max-width: 768px) {
    footer.glass {
        padding: 15px 10px;
    }
    .footer-inner {
        gap: 15px;
    }
    .footer-social {
        gap: 10px;
    }
    .footer-menu {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    .footer-menu li {
        margin: 5px;
    }
    .footer-widget:not(:first-child) {
        display: none;
    }
}

/* =Portfolio Archive Styles */
.portfolio-grid {
    max-width: 1200px;
    margin: 40px auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    padding: 0 20px;
}

.portfolio-card {
    pointer-events: none;
    height: fit-content;
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius);
    transition: var(--transition);
    animation: fadeInUp 0.5s ease-out forwards;
    /* حذف will-change برای بهبود performance */
}

.portfolio-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.portfolio-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform var(--transition);
    aspect-ratio: 4/3;
}

.portfolio-card:hover img {
    transform: scale(1.05);
}

.portfolio-card-content {
    pointer-events: auto;
    z-index: 100;
    padding: 20px;
    position: relative;
    width: 100%;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
}

.portfolio-card-content:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-5px);
}

.portfolio-card-title {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--text-color);
    line-height: 1.4;
}

.portfolio-card-meta {
    display: flex;
    gap: 15px;
    justify-content: center;
    font-size: 14px;
}

h2.portfolio-card-title a {
    text-decoration: none;
    color: var(--text-color);
}

.portfolio-card-features {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
    justify-content: center;
}

.feature-tag, .category-item {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    transition: var(--transition);
    cursor: pointer;
    animation: fadeInTag 0.5s ease-out forwards;
    background-size: 200% 200%;
    color: var(--text-color);
    text-decoration: none;
    display: inline-block;
    white-space: nowrap;
    border: none;
    outline: none;
}

.feature-tag:focus, .category-item:focus {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

.feature-tag:nth-child(1) { background: linear-gradient(45deg, var(--secondary-color), #ff8e53); }
.feature-tag:nth-child(2) { background: linear-gradient(45deg, var(--primary-color), #8e53ff); }
.feature-tag:nth-child(3) { background: linear-gradient(45deg, #6bff6b, #53ff8e); }
.feature-tag:nth-child(4) { background: linear-gradient(45deg, #ffb6b6, #ff53e8); }
.feature-tag:nth-child(5) { background: linear-gradient(45deg, #ffd166, #ff9e7d); }
.feature-tag:nth-child(6) { background: linear-gradient(45deg, #06d6a0, #4cc9f0); }

.feature-tag:hover, .category-item:hover,
.feature-tag.active, .category-item.active {
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.feature-tag.active::after, .category-item.active::after {
    content: '✔';
    margin-right: 8px;
    font-size: 12px;
}

.portfolio-card-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: nowrap;
    margin-top: 10px;
}

.portfolio-button {
    padding: 8px 12px;
    border-radius: 30px;
    text-align: center;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none !important;
    display: inline-block;
    background-size: 200% 200%;
    animation: gradientShift 5s ease infinite;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.portfolio-button.view-more {
    pointer-events: auto;
    position: relative;
    z-index: 1000;
    background: linear-gradient(45deg, var(--primary-color), #8e53ff);
    color: var(--text-color);
}

.portfolio-button.contact {
    background: linear-gradient(45deg, #4CAF50, #8BC34A);
    color: var(--text-color);
}

.portfolio-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

@media (min-width: 768px) {
    .portfolio-card {
        pointer-events: none;
    }
    .portfolio-card-content,
    .portfolio-button.view-more {
        pointer-events: auto;
        z-index: 10;
    }
}

/* =Single Portfolio Styles */
.single-portfolio {
    max-width: 1200px;
    margin: 40px auto;
    display: flex;
    gap: 30px;
    padding: 0 20px;
    position: relative;
}

.single-portfolio-content {
    flex: 3;
}

.single-portfolio img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    transition: transform var(--transition);
    aspect-ratio: 4/3;
}

.single-portfolio img:hover {
    transform: scale(1.02);
}

.single-portfolio-content h1 {
    font-size: 28px;
    margin-bottom: 20px;
    color: var(--text-color);
}

header.portfolio-header {
    z-index: auto;
    position: relative;
}

.portfolio-meta-top {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.portfolio-meta-top .entry-date,
.portfolio-meta-top .portfolio-contact {
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.portfolio-contact a {
    color: var(--text-color);
    text-decoration: none;
}

.portfolio-content {
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.portfolio-content p {
    margin-bottom: 15px;
    line-height: 1.8;
}

.portfolio-project-link {
    margin-top: 20px;
}

.portfolio-features {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px 0;
}

.features-list, .categories-list {
    flex: 1;
    min-width: 200px;
}

.features-list h3, .categories-list h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.features-list ul, .categories-list ul {
    list-style: none;
}

.features-list li, .categories-list li {
    padding: 8px 0;
    font-size: 14px;
}

.portfolio-actions {
    margin: 20px 0;
}

.actions-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.action-button {
    padding: 12px 20px;
    border-radius: 30px;
    font-weight: bold;
    text-decoration: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.action-button.contact {
    background: linear-gradient(45deg, #4CAF50, #8BC34A);
    color: var(--text-color);
}

.action-button.comments {
    background: linear-gradient(45deg, #2196F3, #03A9F4);
    color: var(--text-color);
}

.action-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.comments-section {
    margin-top: 40px;
    padding: 25px;
}

.comment-list {
    list-style: none;
    margin-top: 20px;
}

.comment {
    margin-bottom: 25px;
    padding: 20px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
}

.comment-author {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.comment-author img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-left: 15px;
}

.comment-author .fn {
    font-weight: bold;
    color: var(--text-color);
}

.comment-metadata {
    font-size: 13px;
    opacity: 0.8;
    margin-top: 5px;
}

.comment-content {
    margin-top: 15px;
    line-height: 1.7;
}

.comment-reply-link {
    display: inline-block;
    padding: 8px 20px;
    margin-top: 10px;
    background: linear-gradient(45deg, var(--primary-color), #8e53ff);
    border-radius: 20px;
    font-size: 13px;
    text-decoration: none;
    color: var(--text-color);
    transition: var(--transition);
}

.comment-reply-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.comment-respond {
    margin-top: 40px;
}

.comment-reply-title {
    margin-bottom: 20px;
    font-size: 22px;
}

/* =Forms */
.comment-form textarea,
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"] {
    width: 100%;
    padding: 15px;
    border-radius: 10px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    margin-bottom: 15px;
    font-family: 'Vazir', sans-serif;
}

.comment-form input[type="submit"] {
    background: linear-gradient(45deg, var(--secondary-color), #ff8e53);
    border: none;
    padding: 12px 20px;
    border-radius: 30px;
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Vazir', sans-serif;
    font-weight: bold;
}

.comment-form input[type="submit"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.search-form {
    margin-bottom: 20px;
}

.search-form input[type="search"] {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-color);
    margin-bottom: 10px;
    font-family: 'Vazir', sans-serif;
}

.search-form input[type="submit"] {
    padding: 12px 20px;
    border-radius: 10px;
    background: linear-gradient(45deg, var(--secondary-color), #ff8e53);
    border: none;
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    font-family: 'Vazir', sans-serif;
    font-weight: bold;
}

.search-form input[type="submit"]:hover {
    transform: scale(1.05);
}

/* =Sidebar Styles */
.sidebar {
    width: 450px;
    padding: 25px;
    position: sticky;
    top: 100px;
    height: fit-content;
    max-width: 450px;
}

.sidebar h3 {
    margin: 20px 0 15px;
    font-size: 18px;
    color: var(--text-color);
}

.filter-item, .category-item {
    font-family: 'Vazir', sans-serif;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    background: var(--glass-bg);
    margin: 5px;
    display: inline-block;
    color: var(--text-color);
    text-align: center;
    border: none;
    font-size: 14px;
    white-space: nowrap;
    text-decoration: none;
}

.filter-item:hover, .filter-item.active, 
.category-item:hover, .category-item.active {
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    background: linear-gradient(45deg, var(--primary-color), #8e53ff);
}

.filter-item.active::after, .category-item.active::after {
    content: '✔';
    margin-right: 8px;
    font-size: 12px;
}

.filter-categories, .filter-features {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-item.hidden, .category-item.hidden {
    display: none;
}

.show-more-btn {
    padding: 10px 15px;
    border-radius: 20px;
    background: linear-gradient(45deg, var(--secondary-color), #ff8e53);
    color: var(--text-color);
    border: none;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
    transition: var(--transition);
    display: inline-block;
}

.show-more-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* =Portfolio Gallery Styles */
.portfolio-gallery {
    margin: 20px 0;
}

.portfolio-gallery h3 {
    font-size: 18px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.gallery-item {
    display: block;
    overflow: hidden;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.gallery-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    transition: transform var(--transition);
    aspect-ratio: 4/3;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* =Load More Button */
.load-more {
    font-family: 'Vazir', sans-serif;
    display: block;
    margin: 40px auto;
    padding: 12px 20px;
    border-radius: 30px;
    background: linear-gradient(45deg, var(--secondary-color), #ff8e53);
    color: var(--text-color);
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: var(--transition);
    background-size: 200% 200%;
    animation: gradientShift 5s ease infinite;
}

.load-more:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}
.load-more.loading {
    opacity: 0.7;
    cursor: not-allowed;
}
.load-more.loading::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--text-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

.load-more:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* =Reset Filters Button */
.reset-filters {
    padding: 12px 20px;
    border-radius: 30px;
    background: linear-gradient(45deg, #ff4b4b, #ff7878);
    color: var(--text-color);
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: var(--transition);
    width: 100%;
    text-align: center;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.reset-filters:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* =Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 90px;
    width: 60px;
    height: 60px;
    background: linear-gradient(45deg, var(--primary-color), #8e53ff);
    color: var(--text-color);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    z-index: 1003;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.back-to-top.visible {
    opacity: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 1.5s ease infinite;
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.back-to-top i {
    font-size: 18px;
}

@media (max-width: 768px) {
    .back-to-top {
        width: 40px;
        height: 40px;
        bottom: 15px;
        right: 15px;
    }
    .back-to-top i {
        font-size: 16px;
    }
}

/* =Portfolio Slider Styles */
.portfolio-slider-section {
    margin: 40px 0;
    padding: 30px;
    border-radius: var(--border-radius);
}

.portfolio-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.portfolio-swiper {
    position: relative;
}

.portfolio-slide {
    pointer-events: auto;
    z-index: 1;
    display: flex;
    justify-content: center;
}

.swiper-button-prev, .swiper-button-next {
    color: var(--text-color) !important;
    background: var(--glass-bg) !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    transition: var(--transition) !important;
}

.swiper-button-prev:after, .swiper-rtl .swiper-button-next:after,
.swiper-button-next:after, .swiper-rtl .swiper-button-prev:after {
    font-size: 20px;
}

.swiper-button-prev:hover, .swiper-button-next:hover {
    background: linear-gradient(45deg, var(--primary-color), #8e53ff);
}

.swiper-pagination-bullet {
    background: var(--text-color);
    opacity: 0.5;
}

.swiper-pagination-bullet-active {
    background: var(--primary-color);
    opacity: 1;
}

/* =Post Slider Styles */
.post-slider-section {
    margin: 40px 0;
    padding: 30px;
    border-radius: var(--border-radius);
}

.post-swiper {
    position: relative;
}

.post-slide {
    display: flex;
    justify-content: center;
}

/* =Category Archive Styles */
.category-archive .post-card, 
.category-archive .portfolio-card {
    width: 100%;
    max-width: 350px;
    height: auto;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    background: var(--glass-bg);
    border-radius: 15px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s ease-in-out;
}

.category-archive .post-card img,
.category-archive .portfolio-card img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-bottom: 2px solid var(--glass-border);
}

.category-archive .post-card-content,
.category-archive .portfolio-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

/* =Utility Classes for Grid & Spacing */
.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.gap-6 {
    gap: 1.5rem;
}

.py-5 {
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mt-8 {
    margin-top: 2rem;
}

.text-3xl {
    font-size: 1.875rem;
    line-height: 2.25rem;
}

.font-bold {
    font-weight: 700;
}

/* Styles for Post Grid on Category pages */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

/* =Nav Links */
.nav-links {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    padding: 12px;
    border-radius: 10px;
    transition: var(--transition);
    text-align: center;
    background: var(--glass-bg);
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* =Portfolio Meta */
.portfolio-meta {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.meta-item strong {
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.terms-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.terms-list a {
    padding: 6px 12px;
    border-radius: 20px;
    background: var(--glass-bg);
    color: var(--text-color);
    text-decoration: none;
    font-size: 12px;
    transition: var(--transition);
}

.terms-list a:hover {
    background: linear-gradient(45deg, var(--primary-color), #8e53ff);
    transform: scale(1.05);
}

/* =Resume Page Styles */
.about-section, .skills-section, .contact-section {
    margin: 40px 0;
    padding: 30px;
    border-radius: var(--border-radius);
}

.about-content {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.profile-img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.profile-img:hover {
    transform: scale(1.05);
}

.about-text {
    flex: 1;
    min-width: 300px;
}

.about-text h3 {
    font-size: 24px;
    margin-bottom: 15px;
}

.about-social {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.skill-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skill-name {
    font-size: 16px;
    font-weight: bold;
}

.skill-bar {
    background: var(--glass-bg);
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
}

.skill-level {
    background: linear-gradient(45deg, var(--primary-color), #8e53ff);
    height: 100%;
    transition: width 1s ease;
}

.contact-content {
    text-align: center;
}

.contact-content p {
    margin-bottom: 20px;
}

/* =Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInTag {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =Responsive Design */
@media (max-width: 1024px) {
    .portfolio-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .sidebar {
        width: 300px;
    }
}

@media (max-width: 900px) {
    .single-portfolio {
        margin: unset;
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        position: static;
        margin-bottom: 30px;
    }
}

@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        gap: 20px;
    }
    
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .portfolio-grid {
        margin: unset;
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .portfolio-card-buttons {
        flex-direction: row;
        flex-wrap: nowrap;
    }
    
    .portfolio-button {
        flex: 1;
    }
    
    .actions-buttons {
        flex-direction: column;
    }
    
    .action-button {
        width: 100%;
        justify-content: center;
    }

    .back-to-top {
        bottom: 21px;
        right: 80px;
        width: 48px;
        height: 48px;
    }
    
    .about-content {
        flex-direction: column;
        align-items: center;
    }

    .profile-img {
        width: 150px;
        height: 150px;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .desktop-nav {
        display: none !important;
    }
    
    .sidebar-mobile-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .sidebar {
        display: none;
    }
    
    .search-form {
        margin-top: 4rem;
    }
}

@media (min-width: 769px) {
    .mobile-menu-btn {
        display: none !important;
    }
    
    #mobile-sidebar {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .portfolio-grid,.post-grid {
        margin: unset;
        grid-template-columns: 1fr;
    }
    
    .portfolio-card img {
        height: 180px;
    }
    
    .single-portfolio-content h1 {
        font-size: 24px;
    }
    
    .sidebar-mobile {
        width: 90%;
    }
    
    .portfolio-card-buttons {
        flex-direction: column;
        flex-wrap: wrap;
    }
    
    .portfolio-button {
        width: 100%;
    }
    
    .comment-author {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .comment-author img {
        margin-left: 0;
        margin-bottom: 10px;
    }
}

@media (max-width: 320px) {
    .portfolio-card img {
        height: 150px;
    }
    
    .portfolio-card-title {
        font-size: 18px;
    }
    
    .portfolio-button {
        font-size: 12px;
        padding: 6px 10px;
    }
}

/* =Accessibility */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

:focus {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

/* =Print Styles */
@media print {
    .glass {
        background: #fff !important;
        box-shadow: none !important;
    }
    
    .portfolio-card {
        break-inside: avoid;
    }
    
    .sidebar, .sidebar-mobile-btn, .back-to-top, #particles {
        display: none !important;
    }
    
    .portfolio-grid {
        margin: unset;
        grid-template-columns: 1fr;
    }
}

/* استایل‌های کارت‌های مقاله */
.post-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius);
    transition: var(--transition);
    animation: fadeInUp 0.5s ease-out forwards;
    /* حذف will-change */
}

.post-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.post-card-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform var(--transition);
    aspect-ratio: 4/3;
}

.post-card:hover img {
    transform: scale(1.05);
}

.post-card-content {
    padding: 20px;
    position: relative;
    width: 100%;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
}

.post-card-content:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-5px);
}

.post-card-title {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--text-color);
    line-height: 1.4;
}

.post-card-meta {
    display: flex;
    gap: 15px;
    justify-content: center;
    font-size: 14px;
}

@media (max-width: 768px) {
    .load-more-wrapper {
        margin: 20px 10px;
    }
    .post-card-meta i,
    .portfolio-card-meta i {
        font-size: 16px;
    }
}

/* استایل توضیحات دسته‌بندی/تاکسونومی */
.category-description,
.taxonomy-description {
    margin: 20px 0;
    padding: 15px;
    background: var(--glass-bg);
    border-radius: var(--border-radius);
    border: 1px solid var(--glass-border);
    font-size: 16px;
    line-height: 1.6;
}

/* استایل پیام یافت نشد */
.no-results {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
}

/* =Custom Comments Styles */
.comments-area.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    margin: 20px 0;
    padding: 20px;
}

.comment-list {
    list-style: none;
    padding: 0;
}

.comment.glass {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.comment-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    font-size: 0.9em;
    color: #999;
}

.comment-content {
    margin: 10px 0;
}

.comment-reply .reply-button a {
    display: inline-block;
    padding: 5px 10px;
    background: #007bff;
    color: #fff;
    border-radius: 5px;
    text-decoration: none;
}

.comment-reply .reply-button a:hover {
    background: #0056b3;
}

.comment-form.glass {
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.comment-form label {
    display: block;
    margin-bottom: 5px;
}

.comment-form textarea,
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

.comment-form .portfolio-button {
    background: #007bff;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.comment-form .portfolio-button:hover {
    background: #0056b3;
}

/* =Custom */
h2#about-title,h2#skills-title,h2#contact-title,h2#portfolio-slider-title,h2#post-slider-title {
    margin-bottom: 20px;
}