﻿/** {
   font-family: 'Vazirmatn';
   font-weight : normal;
}*/

body {
   overflow-x: hidden;
}

.book-cover {
   box-shadow: 0 10px 20px rgba(0,0,0,0.2);
   transition: transform 0.3s ease, box-shadow 0.3s ease;
}

   .book-cover:hover {
      transform: scale(1.03);
      box-shadow: 0 15px 30px rgba(0,0,0,0.3);
   }

.rating-stars input {
   display: none;
}

.rating-stars label {
   cursor: pointer;
   width: 25px;
   height: 25px;
   margin: 0 2px;
}

   .rating-stars label svg {
      width: 100%;
      height: 100%;
   }

   .rating-stars input:checked ~ label svg path,
   .rating-stars label:hover ~ label svg path,
   .rating-stars label:hover svg path {
      fill: #f59e0b;
   }

.status-btn {
   transition: all 0.3s ease;
}

   .status-btn.active {
      background-color: #0270c3;
      color: white;
   }

.modal {
   transition: opacity 0.3s ease, transform 0.3s ease;
}

.modal-open {
   overflow: hidden;
}

@keyframes fadeIn {
   from {
      opacity: 0;
      transform: translateY(10px);
   }

   to {
      opacity: 1;
      transform: translateY(0);
   }
}

.animate-fadeIn {
   animation: fadeIn 0.5s ease forwards;
}

.btn-hover-effect {
   position: relative;
   overflow: hidden;
   transition: all 0.3s ease;
}

   .btn-hover-effect:after {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      width: 0;
      height: 100%;
      background-color: rgba(255,255,255,0.2);
      transition: width 0.3s ease;
      z-index: 1;
   }

   .btn-hover-effect:hover:after {
      width: 100%;
   }

   .btn-hover-effect span {
      position: relative;
      z-index: 2;
   }

/* Custom scrollbar */
::-webkit-scrollbar {
   width: 8px;
   height: 8px;
}

::-webkit-scrollbar-track {
   background: #f1f1f1;
   border-radius: 0px;
}

::-webkit-scrollbar-thumb {
   background: silver;
   border-radius: 0px;
}

   ::-webkit-scrollbar-thumb:hover {
      background: #074d83;
   }

.tag {
   position: relative;
   overflow: hidden;
   z-index: 1;
}

   .tag:before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0,0,0,0.05);
      transform: translateX(-100%) skewX(-15deg);
      transition: transform 0.3s ease;
      z-index: -1;
   }

   .tag:hover:before {
      transform: translateX(0) skewX(-15deg);
   }

.pulse-animation {
   animation: pulse 2s infinite;
}

@keyframes pulse {
   0% {
      box-shadow: 0 0 0 0 rgba(2, 112, 195, 0.4);
   }

   70% {
      box-shadow: 0 0 0 10px rgba(2, 112, 195, 0);
   }

   100% {
      box-shadow: 0 0 0 0 rgba(2, 112, 195, 0);
   }
}

.like-button {
   transition: all 0.3s ease;
}

   .like-button.liked svg {
      fill: #ef4444;
      stroke: #ef4444;
   }

   .like-button.liked {
      color: #ef4444;
   }

   .like-button:hover:not(.liked) svg {
      transform: scale(1.1);
   }

   .like-button.liked:hover svg {
      animation: heartBeat 0.8s;
   }

@keyframes heartBeat {
   0% {
      transform: scale(1);
   }

   14% {
      transform: scale(1.3);
   }

   28% {
      transform: scale(1);
   }

   42% {
      transform: scale(1.3);
   }

   70% {
      transform: scale(1);
   }
}

.book-info-item {
   transition: all 0.2s ease;
}

   .book-info-item:hover {
      background-color: #f0f7ff;
   }

.ripple {
   position: relative;
   overflow: hidden;
}

   .ripple:after {
      content: "";
      display: block;
      position: absolute;
      width: 100%;
      height: 100%;
      top: 0;
      left: 0;
      pointer-events: none;
      background-image: radial-gradient(circle, #fff 10%, transparent 10.01%);
      background-repeat: no-repeat;
      background-position: 50%;
      transform: scale(10, 10);
      opacity: 0;
      transition: transform .5s, opacity 1s;
   }

   .ripple:active:after {
      transform: scale(0, 0);
      opacity: .3;
      transition: 0s;
   }

/* Floating shapes animation */
.shape {
   position: absolute;
   opacity: 0.2;
   z-index: -1;
   animation-duration: 20s;
   animation-iteration-count: infinite;
   animation-timing-function: linear;
}

.shape-1 {
   top: 10%;
   left: 5%;
   animation-name: float1;
}

.shape-2 {
   top: 20%;
   right: 5%;
   animation-name: float2;
}

.shape-3 {
   bottom: 10%;
   left: 10%;
   animation-name: float3;
}

.shape-4 {
   bottom: 20%;
   right: 10%;
   animation-name: float4;
}

@keyframes float1 {
   0% {
      transform: translate(0, 0) rotate(0deg);
   }

   50% {
      transform: translate(20px, 20px) rotate(180deg);
   }

   100% {
      transform: translate(0, 0) rotate(360deg);
   }
}

@keyframes float2 {
   0% {
      transform: translate(0, 0) rotate(0deg);
   }

   50% {
      transform: translate(-20px, 20px) rotate(-180deg);
   }

   100% {
      transform: translate(0, 0) rotate(-360deg);
   }
}

@keyframes float3 {
   0% {
      transform: translate(0, 0) rotate(0deg);
   }

   50% {
      transform: translate(20px, -20px) rotate(180deg);
   }

   100% {
      transform: translate(0, 0) rotate(360deg);
   }
}

@keyframes float4 {
   0% {
      transform: translate(0, 0) rotate(0deg);
   }

   50% {
      transform: translate(-20px, -20px) rotate(-180deg);
   }

   100% {
      transform: translate(0, 0) rotate(-360deg);
   }
}

/* Modal animation */
@keyframes modalFadeIn {
   from {
      opacity: 0;
      transform: translateY(-20px);
   }

   to {
      opacity: 1;
      transform: translateY(0);
   }
}

.modal-content {
   animation: modalFadeIn 0.3s ease forwards;
}

/* User avatar */
.user-avatar {
   width: 40px;
   height: 40px;
   border-radius: 50%;
   display: flex;
   align-items: center;
   justify-content: center;
   font-weight: bold;
   color: white;
}

/* Read more functionality */
.read-more-content {
   height: 0;
   overflow: hidden;
   transition: all 0.5s ease-in-out;
}

   .read-more-content.expanded {
      height: auto;
   }

.read-more-btn {
   color: #0270c3;
   cursor: pointer;
   display: inline-flex;
   align-items: center;
   font-weight: 500;
   transition: all 0.3s ease;
}

   .read-more-btn:hover {
      color: #025a9e;
   }

   .read-more-btn svg {
      transition: transform 0.3s ease;
   }

   .read-more-btn.expanded svg {
      transform: rotate(180deg);
   }


@media (min-width: 640px) {
   .container {
      max-width: 640px
   }
}

@media (min-width: 768px) {
   .container {
      max-width: 768px
   }
}

@media (min-width: 1024px) {
   .container {
      max-width: 1024px
   }
}

@media (min-width: 1280px) {
   .container {
      max-width: 1280px
   }
}

@media (min-width: 1536px) {
   .container {
      max-width: 1536px
   }
}


@media (min-width: 768px) {
   .md\:w-1\/4 {
      width: 25%
   }

   .md\:w-3\/4 {
      width: 75%
   }

   .md\:flex-row {
      flex-direction: row
   }
}

/* Bottom Menu Styles */
.bottom-menu {
   overflow: hidden;
}

body.dark-mode .bottom-menu {
   background: #334155;
   border-color: rgba(255, 255, 255, 0.1);
   box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.3);
}

.menu-container {
   display: flex;
   width: 200%;
   transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.menu-primary, .menu-secondary {
   display: flex;
   width: 50%;
   justify-content: space-around;
}

.menu-item {
   position: relative;
   transition: all 0.3s ease;
   padding: 12px;
   border-radius: 50%;
}

   .menu-item.active {
      color: #0270c3;
   }

body.dark-mode .menu-item.active {
   color: #38bdf8;
}

.menu-item:not(.active) {
   color: #94a3b8;
}

body.dark-mode .menu-item:not(.active) {
   color: #cbd5e1;
}

.menu-item:hover {
   color: #0270c3;
   transform: translateY(-3px);
}

body.dark-mode .menu-item:hover {
   color: #38bdf8;
}

/* Active indicator */
.active-indicator {
   position: absolute;
   top: 0;
   left: 50%;
   transform: translateX(-50%);
   width: 5px;
   height: 5px;
   border-radius: 60px;
   background: linear-gradient(135deg, #0270c3, #6d28d9);
   opacity: 0;
   transition: all 0.3s ease;
}

.menu-item.active .active-indicator {
   opacity: 1;
   width: 5px;
   height: 5px;
}

body.dark-mode .active-indicator {
   background: linear-gradient(135deg, #38bdf8, #a78bfa);
}

/* Notification badge */
.notification-badge {
   position: absolute;
   top: 0;
   right: 0;
   background: linear-gradient(135deg, #ef4444, #f97316);
   color: white;
   min-width: 18px;
   height: 18px;
   border-radius: 9px;
   display: flex;
   align-items: center;
   justify-content: center;
   font-size: 10px;
   font-weight: bold;
   padding: 0 5px;
   border: 2px solid white;
   box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

body.dark-mode .notification-badge {
   border-color: #334155;
}

/* Profile avatar */
.profile-avatar {
   position: relative;
   width: 24px;
   height: 24px;
   border-radius: 50%;
   overflow: hidden;
   background: linear-gradient(135deg, #0270c3, #6d28d9);
   display: flex;
   align-items: center;
   justify-content: center;
}

/* Floating animation for the menu */
@keyframes float {
   0% {
      transform: translateY(0px);
   }

   50% {
      transform: translateY(-5px);
   }

   100% {
      transform: translateY(0px);
   }
}

/*.floating {
   animation: float 5s ease-in-out infinite;
}*/

/* Desktop styles - Vertical menu on the left */
@media (min-width: 1280px) {
   body {
      padding-bottom: 0;
   }

   .menu-wrapper {
      position: fixed;
      top: 0;
      left: 0;
      bottom: 0;
      width: auto;
      height: 100vh;
      display: flex;
      align-items: center;
      z-index: 50;
      padding-left: 10px;
   }

   .bottom-menu {
      width: auto;
      height: auto;
      max-width: none;
      max-height: 80vh;
      margin: 0;
      border-radius: 10px;
      box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
   }

   .menu-container {
      flex-direction: column;
      width: 100%;
      height: auto;
      transform: none !important; /* Prevent sliding on desktop */
   }

   .menu-primary, .menu-secondary {
      flex-direction: column;
      width: 100%;
      height: auto;
      justify-content: flex-start;
   }

   .menu-item:hover {
      transform: translateX(-3px);
   }

   .active-indicator {
      left: auto;
      right: 0;
      top: 50%;
      bottom: auto;
      transform: translateY(-50%);
   }

   .menu-item.active .active-indicator {
      width: 3px;
      height: 20px;
   }
/*
   .floating {
      animation: float-horizontal 5s ease-in-out infinite;
   }*/

   @keyframes float-horizontal {
      0% {
         transform: translateX(0px);
      }

      50% {
         transform: translateX(-5px);
      }

      100% {
         transform: translateX(0px);
      }
   }

   /* Hide the more button and back button on desktop */
   #more-button-mobile, #back-button {
      display: none;
   }

   /* Show all menu items on desktop */
   .menu-secondary {
      display: flex;
   }

   /* Add a separator between primary and secondary menus */
   .menu-separator {
      width: 30px;
      height: 1px;
      background: rgba(148, 163, 184, 0.3);
      margin: 10px auto;
   }
}

.header {
   background: white;
   box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
   -moz-transition: all .3s;
   -o-transition: all .3s;
   -webkit-transition: all .3s;
   transition: all .3s;
}

body.dark-mode .header {
   background: #1e293b;
   box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* Logo styles */
.logo {
   background: linear-gradient(135deg, #0270c3, #6d28d9);
   -webkit-background-clip: text;
   -webkit-text-fill-color: transparent;
   background-clip: text;
   text-fill-color: transparent;
}

/* Breadcrumb styles */
.breadcrumb-item:not(:last-child)::after {
   content: '/';
   margin: 0 0.5rem;
   color: #94a3b8;
}

/* Button styles */
.btn {
   transition: all 0.3s ease !important;
}

.btn-primary {
   background: linear-gradient(135deg, #0270c3, #0c8de3);
   box-shadow: 0 4px 10px rgba(2, 112, 195, 0.2);
}

   .btn-primary:hover {
      box-shadow: 0 6px 15px rgba(2, 112, 195, 0.3);
   }

.btn-outline {
   box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

   .btn-outline:hover {
      box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
   }

/* Dark mode button styles */
body.dark-mode .btn-outline {
   border-color: #475569;
   color: #e2e8f0;
   box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

   body.dark-mode .btn-outline:hover {
      background-color: #475569;
      box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
   }

/* Breadcrumb styles for dark mode */
body.dark-mode .breadcrumb-item {
   color: #cbd5e1;
}

   body.dark-mode .breadcrumb-item:not(:last-child)::after {
      color: #64748b;
   }

   body.dark-mode .breadcrumb-item:last-child {
      color: #e2e8f0;
   }



.modal-overlay {
   position: fixed;
   top: 0;
   left: 0;
   right: 0;
   bottom: 0;
   background-color: rgb(0 0 0 / 58%);
   display: flex;
   justify-content: center;
   z-index: 100;
   opacity: 0;
   visibility: hidden;
   transition: opacity 0.3s ease, visibility 0.3s ease;
}

   .modal-overlay.active {
      opacity: 1;
      visibility: visible;
   }



.modal {
   box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
   display: flex;
   flex-direction: column;
   opacity: 0;
   transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
   overflow : hidden;
}

.modal-overlay.active .modal {
   transform: translateY(0) !important;
   opacity: 1;
}


.modal-fullscreen {
   width: 100%;
   height: 100%;
   max-width: 100%;
   max-height: 100vh;
   border-radius: 0;
}

@media (min-width: 1024px) {
   .modal-fullscreen {
      width: 800px;
      height: 90%;
      max-width: 90%;
      max-height: 90vh;
      border-radius: 10px;
   }
}

/* Modal header with gradient line */
.modal-header {
   position: relative;
   flex-shrink: 0;
}

/* Modal body with scroll */
.modal-body {
   overflow-y: auto;
   flex-grow: 1;
   /* Custom scrollbar */
   scrollbar-width: thin;
   scrollbar-color: #cbd5e1 #f1f5f9;
}

   .modal-body::-webkit-scrollbar {
      width: 6px;
   }

   .modal-body::-webkit-scrollbar-track {
      background: #f1f5f9;
      border-radius: 3px;
   }

   .modal-body::-webkit-scrollbar-thumb {
      background-color: #cbd5e1;
      border-radius: 3px;
   }

/* Modal footer */
.modal-footer {
   flex-shrink: 0;
}

/* Close button */
.modal-close {
   transition: background-color 0.3s ease;
}

   .modal-close:hover {
      background-color: #f1f5f9;
   }

/* Dark mode modal styles */
body.dark-mode .modal {
   background: #1e293b;
   box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

body.dark-mode .modal-close:hover {
   background-color: #334155;
}

body.dark-mode .modal-body {
   scrollbar-color: #475569 #1e293b;
}

   body.dark-mode .modal-body::-webkit-scrollbar-track {
      background: #1e293b;
   }

   body.dark-mode .modal-body::-webkit-scrollbar-thumb {
      background-color: #475569;
   }

body.dark-mode .modal-footer {
   border-color: #334155;
}

/* Modal animation variations */
.modal-overlay[data-animation="fade"] .modal {
   transform: translateY(0);
}

.modal-overlay[data-animation="slide-up"] .modal {
   transform: translateY(50px);
}

.modal-overlay[data-animation="zoom"] .modal {
   transform: scale(0.9);
}
        





/*  LIKED BOOK USERS */

.btn-primary {
   background: linear-gradient(135deg, #0270c3, #0c8de3);
   box-shadow: 0 4px 10px rgba(2, 112, 195, 0.2);
}

   .btn-primary:hover {
      box-shadow: 0 6px 15px rgba(2, 112, 195, 0.3);
   }

.btn-outline {
   box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

   .btn-outline:hover {
      box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
   }

/* Modal styles */
/*.modal-overlay {
   position: fixed;
   top: 0;
   left: 0;
   right: 0;
   bottom: 0;
   background-color: rgba(0, 0, 0, 0.5);
   display: flex;
   align-items: center;
   justify-content: center;
   z-index: 100;
   opacity: 0;
   visibility: hidden;
   transition: opacity 0.3s ease, visibility 0.3s ease;
}

   .modal-overlay.active {
      opacity: 1;
      visibility: visible;
   }

.modal {
   background: white;
   border-radius: 10px;
   box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
   max-width: 90%;
   max-height: 90vh;
   display: flex;
   flex-direction: column;
   opacity: 0;
   transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
   overflow: hidden;*/ /* Ensure nothing spills outside the modal */
/*}

.modal-overlay.active .modal {
   transform: translateY(0) !important;
   opacity: 1;
}*/

/* Modal sizes */
/*.modal-md {
   width: 500px;
}*/

/* Modal header with gradient line */
/*.modal-header {
   position: relative;
   flex-shrink: 0;
}

   .modal-header::after {
      content: '';
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      height: 2px;
      background: linear-gradient(to right, #0270c3, #6d28d9);
   }*/

/* Modal body with scroll */
/*.modal-body {
   overflow-y: auto;
   flex-grow: 1;*/
   /* Custom scrollbar */
   /*scrollbar-width: thin;
   scrollbar-color: #cbd5e1 #f1f5f9;
}

   .modal-body::-webkit-scrollbar {
      width: 6px;
   }

   .modal-body::-webkit-scrollbar-track {
      background: #f1f5f9;
      border-radius: 3px;
      margin: 5px;
   }

   .modal-body::-webkit-scrollbar-thumb {
      background-color: #cbd5e1;
      border-radius: 3px;
   }*/

/* Modal footer */
/*.modal-footer {
   flex-shrink: 0;
}*/

/* Close button */
/*.modal-close {
   transition: background-color 0.3s ease;
}

   .modal-close:hover {
      background-color: #f1f5f9;
   }*/

/* Dark mode modal styles */
/*body.dark-mode .modal {
   background: #1e293b;
   box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

body.dark-mode .modal-close:hover {
   background-color: #334155;
}

body.dark-mode .modal-body {
   scrollbar-color: #475569 #1e293b;
}

   body.dark-mode .modal-body::-webkit-scrollbar-track {
      background: #1e293b;
   }

   body.dark-mode .modal-body::-webkit-scrollbar-thumb {
      background-color: #475569;
   }

body.dark-mode .modal-footer {
   border-color: #334155;
}*/

/* Modal animation variations */
/*.modal-overlay[data-animation="slide-up"] .modal {
   transform: translateY(150%);
}*/

/* User list styles */
.user-list {
   border-radius: 8px;
   overflow: hidden;
}

.user-avatar {
   width: 40px;
   height: 40px;
   border-radius: 50%;
   overflow: hidden;
   background-color: #e2e8f0;
   display: flex;
   align-items: center;
   justify-content: center;
   color: #64748b;
   font-weight: bold;
   flex-shrink: 0;
}

.friend-status {
   display: flex;
   align-items: center;
   margin-left: 10px;
}

.connection-icon {
   transition: all 0.2s ease;
}

   .connection-icon:hover {
      transform: scale(1.15);
   }

.load-more-btn {
   transition: all 0.3s ease;
}

   .load-more-btn:hover {
      background-color: #f1f5f9;
   }

body.dark-mode .load-more-btn:hover {
   background-color: #334155;
}

input,textarea {
   outline : none;
}

.custom-scrollbar::-webkit-scrollbar {
   width: 4px !important;
}

.custom-scrollbar::-webkit-scrollbar-track {
   background: transparent !important;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
   background-color: rgba(156, 163, 175, 0.5) !important;
   border-radius: 20px !important;
}

input#related-search.selected {
   background-color: #9bc8fb3d;
   border: 1px solid #2699e6;
}

input,textarea,select{
   outline : none !important;
}

.book-img-container-lg {
   width: 8rem;
   height: 12rem;
}

.book-img-container-md {
   width: 7rem;
   height: 10rem;
}

.input-validation-error {
   border: 1px solid #ffa7a7 !important;
   box-shadow: 0px 0px 13px #ffdada !important;
}

.bg-noteBook-lines {
   background-image: repeating-linear-gradient(#00000000, #cfcfcf00 24px, #eeeeee 24px, #dadada 25px);
   background-color: #ffc06d12 !important;
}

/* Animations */
.float {
   animation: float 3s ease-in-out infinite;
}

.scan {
   animation: scan 2s ease-in-out infinite;
}

.scan-line {
   animation: scan-line 3s ease-in-out infinite;
}

/* Keyframes */
@keyframes float {
   0%, 100% {
      transform: translateY(0px);
   }

   50% {
      transform: translateY(-5px);
   }
}

@keyframes scan {
   0% {
      opacity: 0.3;
   }

   50% {
      opacity: 1;
   }

   100% {
      opacity: 0.3;
   }
}

@keyframes scan-line {
   0% {
      transform: translateY(0px);
      opacity: 0;
   }

   10% {
      opacity: 1;
   }

   90% {
      opacity: 1;
   }

   100% {
      transform: translateY(100px);
      opacity: 0;
   }
}


/* ==== Title Ticker (RTL-safe) ==== */
.title-wrap {
    position: relative;
    overflow: hidden;
    min-width: 0;
    --edge-fade: 12px;
    -webkit-mask-image: linear-gradient(to right,transparent 0,#000 var(--edge-fade),#000 calc(100% - var(--edge-fade)),transparent 100%);
    mask-image: linear-gradient(to right,transparent 0,#000 var(--edge-fade),#000 calc(100% - var(--edge-fade)),transparent 100%);
}

    .title-wrap .title-marquee {
        /* کانتینر عمداً LTR می‌ماند تا کپی دوم سمت راست بچیند */
        direction: ltr;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 24px;
        white-space: nowrap;
        will-change: transform;
        transform: translate3d(0,0,0);
    }

      .title-wrap .title-marquee:not(.is-overflow):not(.is-right) {
         justify-content: center;
      }

      .title-wrap .title-marquee.is-right:not(.is-overflow) {
         justify-content: end;
         padding-right : 10px;
      }
        .title-wrap .title-marquee.is-overflow {
            justify-content: flex-start;
            animation: marquee-run var(--dur, 14s) linear infinite;
        }

    .title-wrap .title-text,
    .title-wrap .title-dup {
        /* خود متن RTL برای فارسی */
        direction: rtl;
        unicode-bidi: plaintext;
        display: inline-block;
    }

@keyframes marquee-run {
   from {
      transform: translate3d(calc(-1 * var(--distance)),0,0);
   }

   to {
      transform: translate3d(0,0,0);
   }
}

@media (prefers-reduced-motion: reduce) {
    .title-wrap .title-marquee {
        animation: none !important;
    }
}
/* --- Marquee: container LTR, text RTL --- */
.title-wrap .title-marquee {
    direction: ltr !important; /* کپیِ دوم سمت راست قرار می‌گیرد */
    flex-direction: row !important;
}

    .title-wrap .title-marquee.is-overflow {
        justify-content: flex-start !important;
        animation-name: marquee-run !important; /* همین @keyframes که داری */
    }

.title-wrap .title-text,
.title-wrap .title-dup {
    direction: rtl;
    unicode-bidi: plaintext; /* اعداد/حروف فارسی درست */
}

/* اسپینر مینیمال */
.ptr-spinner {
    width: 22px;
    height: 22px;
    border-radius: 9999px;
    border: 2px solid #cbd5e1; /* slate-300 */
    border-top-color: #64748b; /* slate-500 */
    opacity: .9;
}

.ptr--spin .ptr-spinner {
    animation: ptr-spin .8s linear infinite;
}

@keyframes ptr-spin {
    to {
        transform: rotate(360deg);
    }
}

/* نرم کردن باز و بسته شدن نوار */
#ptrHeader {
    transition: height .18s cubic-bezier(.2,.8,.2,1);
}

#swipeArea {
    touch-action: pan-y;
    overscroll-behavior-x: contain;
}

#postsContainer {
    will-change: transform;
}

.swipe-transition {
    transition: transform 220ms cubic-bezier(.2,.8,.2,1);
}
   }
}


.skeleton {
   background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
   background-size: 200% 100%;
   animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
   0% {
      background-position: 200% 0;
   }

   100% {
      background-position: -200% 0;
   }
}

.pulse-loading {
   animation: pulse-loading 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-loading {
   0%, 100% {
      opacity: 1;
   }

   50% {
      opacity: 0.5;
   }
}

.shimmer {
   background: linear-gradient(90deg, #f0f0f0 0%, #e0e0e0 20%, #d0d0d0 40%, #e0e0e0 60%, #f0f0f0 80%, #f0f0f0 100%);
   background-size: 200% auto;
   animation: shimmer 1.5s linear infinite;
}

@keyframes shimmer {
   0% {
      background-position: -200% center;
   }

   100% {
      background-position: 200% center;
   }
}

.wave-loading {
   background: linear-gradient(90deg, #f5f5f5 0%, #e0e0e0 50%, #f5f5f5 100%);
   background-size: 400% 100%;
   animation: wave 2s ease-in-out infinite;
}

@keyframes wave {
   0% {
      background-position: 0% 50%;
   }

   50% {
      background-position: 100% 50%;
   }

   100% {
      background-position: 0% 50%;
   }
}

.fade-in {
   animation: fade-in 0.8s ease-out forwards;
   opacity: 0;
}

@keyframes fade-in {
   from {
      opacity: 0;
      transform: translateY(20px);
   }

   to {
      opacity: 1;
      transform: translateY(0);
   }
}

.slide-in {
   animation: slide-in 0.6s ease-out forwards;
   transform: translateX(30px);
   opacity: 0;
}

@keyframes slide-in {
   to {
      transform: translateX(0);
      opacity: 1;
   }
}

.scale-in {
   animation: scale-in 0.5s ease-out forwards;
   transform: scale(0.9);
   opacity: 0;
}

@keyframes scale-in {
   to {
      transform: scale(1);
      opacity: 1;
   }
}

.bounce-in {
   animation: bounce-in 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
   transform: scale(0);
   opacity: 0;
}

@keyframes bounce-in {
   0% {
      transform: scale(0);
      opacity: 0;
   }

   50% {
      transform: scale(1.05);
      opacity: 0.8;
   }

   100% {
      transform: scale(1);
      opacity: 1;
   }
}

.rotate-in {
   animation: rotate-in 0.6s ease-out forwards;
   transform: rotate(-180deg) scale(0.5);
   opacity: 0;
}

@keyframes rotate-in {
   to {
      transform: rotate(0deg) scale(1);
      opacity: 1;
   }
}


.typing {
   overflow: hidden;
   border-left: 2px solid #3b82f6;
   white-space: nowrap;
   animation: typing 3s steps(30, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
   from {
      width: 0;
   }

   to {
      width: 100%;
   }
}

@keyframes blink-caret {
   from, to {
      border-color: transparent;
   }

   50% {
      border-color: #3b82f6;
   }
}

.floating {
   animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
   0%, 100% {
      transform: translateY(0px);
   }

   50% {
      transform: translateY(-10px);
   }
}

.glow {
   animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
   from {
      box-shadow: 0 0 5px rgba(59, 130, 246, 0.5);
   }

   to {
      box-shadow: 0 0 20px rgba(59, 130, 246, 0.8), 0 0 30px rgba(59, 130, 246, 0.6);
   }
}

.loading-dots {
   display: inline-flex;
   gap: 4px;
}

   .loading-dots span {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background-color: #3b82f6;
      animation: loading-dots 1.4s infinite ease-in-out both;
   }

      .loading-dots span:nth-child(1) {
         animation-delay: -0.32s;
      }

      .loading-dots span:nth-child(2) {
         animation-delay: -0.16s;
      }

@keyframes loading-dots {
   0%, 80%, 100% {
      transform: scale(0);
   }

   40% {
      transform: scale(1);
   }
}

.spinner {
   border: 3px solid #f3f3f3;
   border-top: 3px solid #3b82f6;
   border-radius: 50%;
   animation: spin 1s linear infinite;
}

@keyframes spin {
   0% {
      transform: rotate(0deg);
   }

   100% {
      transform: rotate(360deg);
   }
}

.progress-bar {
   background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 100%);
   animation: progress 2s ease-in-out infinite;
}

@keyframes progress {
   0% {
      width: 0%;
   }

   50% {
      width: 70%;
   }

   100% {
      width: 100%;
   }
}

.heartbeat {
   animation: heartbeat 1.5s ease-in-out infinite both;
}

@keyframes heartbeat {
   from {
      transform: scale(1);
   }

   14% {
      transform: scale(1.3);
   }

   28% {
      transform: scale(1);
   }

   42% {
      transform: scale(1.3);
   }

   70% {
      transform: scale(1);
   }
}

.wobble {
   animation: wobble 1s ease-in-out infinite;
}

@keyframes wobble {
   0% {
      transform: translateX(0%);
   }

   15% {
      transform: translateX(-25%) rotate(-5deg);
   }

   30% {
      transform: translateX(20%) rotate(3deg);
   }

   45% {
      transform: translateX(-15%) rotate(-3deg);
   }

   60% {
      transform: translateX(10%) rotate(2deg);
   }

   75% {
      transform: translateX(-5%) rotate(-1deg);
   }

   100% {
      transform: translateX(0%);
   }
}

/*  note */

.notebook-paper {
   background-size: 100% 40px;
   background-position: 0 0;
   padding: 16px 50px 20px 40px;
   min-height: 300px;
   position: relative;
   display: flex;
   flex-direction: column;
   justify-content: space-between;
}

   .notebook-paper::before {
      content: '';
      position: absolute;
      right: 40px;
      top: 0;
      bottom: 0;
      width: 2px;
      background: #ffb3b3;
   }
.snippet-text {
   font-size: 16px;
   line-height: 40px;
   margin: 0;
   position: relative;
   z-index: 1;
}

/* ناحیه ثابت پایین صفحه - با رنگ dark */
.comment-input-fixed-wrapper {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1e293b; /* dark background */
    border-top: 1px solid #334155;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
}

.register-comment-area-wrapper {
    padding: 12px 16px;
}

.textarea-container {
    position: relative;
    width: 100%;
}

/* استایل textarea با رنگ dark */
.comment-textarea {
    width: 100%;
    min-height: 44px;
    max-height: 120px;
    padding: 12px 16px 12px 56px; /* padding چپ برای دکمه */
    border: 1px solid #475569;
    border-radius: 12px;
    resize: none;
    font-size: 16px;
    line-height: 1.5;
    transition: all 0.2s ease;
    font-family: inherit;
    overflow-y: auto;
    background: #334155; /* dark background */
    color: #e2e8f0; /* light text */
    direction: rtl; /* پیش‌فرض راست‌چین */
    text-align: right;
}

    /* برای متن انگلیسی */
    .comment-textarea[dir="ltr"] {
        direction: ltr;
        text-align: left;
        padding: 12px 56px 12px 16px; /* padding راست برای دکمه */
    }

    .comment-textarea:focus {
        outline: none;
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    }

    .comment-textarea::placeholder {
        color: #64748b;
    }

/* دکمه ارسال داخل textarea */
.submit-btn-inside {
    position: absolute;
    right: 5px;
    bottom: 5px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    color: white;
    flex-shrink: 0; /* جلوگیری از کوچک شدن */
}

    .submit-btn-inside:hover {
        background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
        transform: scale(1.05);
    }

    .submit-btn-inside:active {
        transform: scale(0.95);
    }

    .submit-btn-inside:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

/* اسکرول بار سفارشی */
.comment-textarea::-webkit-scrollbar {
    width: 2px;
}

.comment-textarea::-webkit-scrollbar-track {
   background: #1e293b;
   border-radius: 100px;
   width: 2px;
}

.comment-textarea::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 100px;
}

    .comment-textarea::-webkit-scrollbar-thumb:hover {
        background: #64748b;
    }

/* responsive برای موبایل */
@@media (max-width: 640px) {
    .comment-input-fixed-wrapper {
        padding-bottom: max(env(safe-area-inset-bottom), 12px);
    }

    .register-comment-area-wrapper {
        padding: 10px 12px;
    }
}

.comment-input-fixed-wrapper {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
    transition: background 0.2s ease, border-color 0.2s ease;
}

html.dark .comment-input-fixed-wrapper {
    background: #1e293b;
    border-top-color: #334155;
}

.reply-section-sticky {
    padding: 10px 16px;
    animation: slideDown 0.2s ease-out;
}

.reply-section-sticky.hidden {
    display: none;
}

@@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.register-comment-area-wrapper {
    padding: 10px;
}

.textarea-container {
    position: relative;
    width: 100%;
}

.comment-textarea {
    width: 100%;
    min-height: 44px;
    max-height: 120px;
    padding: 12px 56px 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    resize: none;
    font-size: 16px;
    line-height: 1.5;
    transition: all 0.2s ease;
    font-family: inherit;
    overflow-y: auto;
    background: #f9fafb;
    color: #111827;
    direction: rtl;
    text-align: right;
}

html.dark .comment-textarea {
    background: #334155;
    color: #e2e8f0;
    border-color: #475569;
}

.comment-textarea[dir="ltr"] {
    direction: ltr;
    text-align: left;
}

.comment-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.comment-textarea::placeholder {
    color: #9ca3af;
}

html.dark .comment-textarea::placeholder {
    color: #64748b;
}

.submit-btn-inside {
    position: absolute;
    left: 5px;
    bottom: 5px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    color: white;
    flex-shrink: 0;
}

    .submit-btn-inside:hover {
        background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
        transform: scale(1.05);
    }

    .submit-btn-inside:active {
        transform: scale(0.95);
    }

    .submit-btn-inside:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

.comment-textarea::-webkit-scrollbar {
    width: 2px;
}

.comment-textarea::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 100px;
}

.comment-textarea::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

    .comment-textarea::-webkit-scrollbar-thumb:hover {
        background: #9ca3af;
    }

html.dark .comment-textarea::-webkit-scrollbar-track {
    background: #1e293b;
}

html.dark .comment-textarea::-webkit-scrollbar-thumb {
    background: #475569;
}

    html.dark .comment-textarea::-webkit-scrollbar-thumb:hover {
        background: #64748b;
    }

@@media (max-width: 640px) {
    .comment-input-fixed-wrapper {
        padding-bottom: max(env(safe-area-inset-bottom), 12px);
    }

    .register-comment-area-wrapper {
        padding: 10px 12px;
    }
}