@import url('../css/app.css');

.svg-arrow {
    transform: translate(-50%, 0);
    left: 50%;
}

.title-head {
    font-size: 6rem;
}

.overlay-slide {
    background: linear-gradient(to top, #000, transparent);
}

.story-user {
    cursor: pointer;
    text-align: center;
}

.content-switch {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    margin-left: 50px;
}

.story-user {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(to right, #d200bd, #f7b301);
    padding: 1px;
}

.story-item {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.story-user img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

/* Modal */
.story-modal {
    position: fixed;
    z-index: 999;
    display: none;
    width: 380px;
    height: 70vh;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 20px;
}

.story-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 998;
    background: rgba(2, 12, 27, 0.7);
}

.story-modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.story-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 28px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    z-index: 10;
}

.swiper-container-stories {
    width: 100%;
    height: 100%;
}

.swiper-slide-stories img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Progress bars */
.story-header {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    gap: 4px;
    z-index: 10;
}

.progress-container {
    display: flex;
    gap: 4px;
    width: 100%;
}

.progress-bar {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.4);
    overflow: hidden;
}

.progress-bar span {
    display: block;
    height: 100%;
    width: 0%;
    background: white;
}

.info-text.active {
    display: block;
}

.pattern-news {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%239C92AC' fill-opacity='0.2'%3E%3Cpath d='M0 38.59l2.83-2.83 1.41 1.41L1.41 40H0v-1.41zM0 1.4l2.83 2.83 1.41-1.41L1.41 0H0v1.41zM38.59 40l-2.83-2.83 1.41-1.41L40 38.59V40h-1.41zM40 1.41l-2.83 2.83-1.41-1.41L38.59 0H40v1.41zM20 18.6l2.83-2.83 1.41 1.41L21.41 20l2.83 2.83-1.41 1.41L20 21.41l-2.83 2.83-1.41-1.41L18.59 20l-2.83-2.83 1.41-1.41L20 18.59z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.back-svg::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: url('../images/Layer-7.png');
}

#articleRead p {
    font-family: IRANS-light, roboto, tahoma;
    text-align: justify;
}

:is(#articleRead h1, #articleRead h2, #articleRead h3, #articleRead h4, ) {
    font-family: IRANS-bold, roboto, tahoma;
}

/* ==============================
   AI Summary Button (ALWAYS-ON)
   - animation runs بدون hover/click
   ============================== */

.ai-btn {
    position: relative;
    isolation: isolate;
}

/* گرادیانت دور دکمه همیشه روشن */
.ai-btn .ai-border {
    opacity: 1 !important;
    background: linear-gradient(90deg,
            rgba(59, 130, 246, .75),
            rgba(99, 102, 241, .40),
            rgba(59, 130, 246, .12),
            transparent);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, .22) inset;
    animation: aiBorderPulse 2.6s ease-in-out infinite;
}

/* شاین همیشه حرکت کنه */
.ai-btn .ai-shine {
    opacity: .75 !important;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
    filter: blur(.25px);
    animation: aiShineMove 1.25s ease-in-out infinite;
}

/* اسپارک گوشه آیکن */
.ai-btn .ai-spark {
    opacity: 1 !important;
    background: radial-gradient(circle,
            rgba(99, 102, 241, 1) 0%,
            rgba(59, 130, 246, .85) 40%,
            transparent 72%);
    transform: scale(.75);
    animation: aiSparkPulse 1.25s ease-in-out infinite;
}

/* خود دکمه یکم زنده باشه */
.ai-btn:not(.is-loading):not(.is-done) {
    animation: aiIdleFloat 2.2s ease-in-out infinite;
}

/* Dark tuning */
html.dark .ai-btn .ai-border {
    background: linear-gradient(90deg,
            rgba(99, 102, 241, .80),
            rgba(56, 189, 248, .25),
            rgba(59, 130, 246, .10),
            transparent);
    box-shadow: 0 0 0 1px rgba(99, 102, 241, .26) inset;
}

html.dark .ai-btn .ai-shine {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .22), transparent);
}

/* Animations */
@keyframes aiBorderPulse {

    0%,
    100% {
        filter: saturate(1) brightness(1)
    }

    50% {
        filter: saturate(1.25) brightness(1.10)
    }
}

@keyframes aiIdleFloat {

    0%,
    100% {
        transform: translateY(0)
    }

    50% {
        transform: translateY(-1px)
    }
}

@keyframes aiShineMove {
    0% {
        transform: translateX(-40px) rotate(12deg)
    }

    100% {
        transform: translateX(340px) rotate(12deg)
    }
}

@keyframes aiSparkPulse {

    0%,
    100% {
        transform: scale(.75);
        filter: blur(0)
    }

    50% {
        transform: scale(1.2);
        filter: blur(.25px)
    }
}

@keyframes modalIn {
    0% {
        transform: translateY(18px) scale(.96);
        opacity: 0;
    }

    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes modalOut {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translateY(18px) scale(.96);
        opacity: 0;
    }
}

@keyframes modalShine {
    0% {
        transform: translateX(0) rotate(12deg);
        opacity: 0;
    }

    15% {
        opacity: .9;
    }

    55% {
        opacity: .6;
    }

    100% {
        transform: translateX(520px) rotate(12deg);
        opacity: 0;
    }
}

#commentModal.show {
    display: flex;
}

#commentPanel.anim-in {
    animation: modalIn 360ms cubic-bezier(.2, .8, .2, 1) both;
}

#commentPanel.anim-out {
    animation: modalOut 260ms cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes contactShine {
    0% {
        transform: translateX(0) rotate(12deg);
        opacity: 0;
    }

    15% {
        opacity: .9;
    }

    55% {
        opacity: .6;
    }

    100% {
        transform: translateX(700px) rotate(12deg);
        opacity: 0;
    }
}

@keyframes adminShine {
    0% {
        transform: translateX(0);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translateX(360px);
        opacity: 0;
    }
}


/* لینک‌های سایدبار (یک‌دست و خفن) */
.admin-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .7rem .85rem;
    border-radius: .9rem;
    font-weight: 800;
    font-size: 12px;
    color: rgba(39, 39, 42, .92);
    transition: .2s ease;
    position: relative;
}

.dark .admin-link {
    color: rgba(244, 244, 245, .92);
}

.admin-link:hover {
    background: rgba(59, 130, 246, .08);
}

.dark .admin-link:hover {
    background: rgba(59, 130, 246, .12);
}

.admin-ico {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(244, 244, 245, 1);
    border: 1px solid rgba(228, 228, 231, .9);
    color: rgba(24, 24, 27, .85);
    flex: 0 0 auto;
}

.dark .admin-ico {
    background: rgba(255, 255, 255, .06);
    border-color: rgba(255, 255, 255, .10);
    color: rgba(244, 244, 245, .95);
}

/* active حالت خاص (Glow + گرادینت) */
.admin-active {
    background: linear-gradient(90deg, rgba(59, 130, 246, .18), rgba(59, 130, 246, .06), transparent);
    border: 1px solid rgba(59, 130, 246, .25);
    box-shadow: 0 18px 55px -45px rgba(59, 130, 246, .55);
}

.dark .admin-active {
    border-color: rgba(56, 189, 248, .25);
    box-shadow: 0 18px 55px -45px rgba(56, 189, 248, .45);
}

.admin-mini {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .7rem .6rem;
    border-radius: .9rem;
    font-weight: 900;
    font-size: 11px;
    color: rgba(39, 39, 42, .9);
    background: rgba(244, 244, 245, 1);
    border: 1px solid rgba(228, 228, 231, .9);
    transition: .2s ease;
}

.dark .admin-mini.admin-active {
    background: #3b82f6;
    color: rgba(255, 255, 255, 0.9);
}

.admin-mini:hover {
    background: rgba(228, 228, 231, .65);
}

.dark .admin-mini {
    color: rgba(244, 244, 245, .92);
    background: rgba(255, 255, 255, .06);
    border-color: rgba(255, 255, 255, .10);
}

.dark .admin-mini:hover {
    background: rgba(255, 255, 255, .10);
}

header details > div.absolute {
    z-index: 50;
}

/* prettier swiper bullets */
.swiper-pagination-bullet{
  opacity: .6;
  transform: scale(.9);
}
.swiper-pagination-bullet-active{
  opacity: 1;
  transform: scale(1.05);
}

.heroSwiper .swiper-button-next::after, .heroSwiper .swiper-button-prev::after {
    font-size: 25px;
}

.footer-link3{
  display:block;
  width:fit-content;
  margin-inline:auto; /* center on mobile */
  position:relative;
  padding-right:14px; /* RTL bullet */
  transition:.2s ease;
  color:inherit;
  opacity:.92;
}
@media (min-width:1024px){
  .footer-link3{ margin-inline:0; } /* align right on desktop */
}
.footer-link3:before{
  content:"";
  position:absolute;
  right:0;
  top:0.65em;
  width:6px;
  height:6px;
  border-radius:999px;
  background: rgba(59,130,246,.55);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.footer-link3:hover{
  transform: translateX(-2px);
  opacity:1;
}
.footer-link3:after{
  content:"";
  position:absolute;
  right:14px;
  bottom:-6px;
  width:0;
  height:2px;
  border-radius:999px;
  background: linear-gradient(90deg,#60a5fa,#0f172a);
  transition:.25s ease;
}
.dark .footer-link3:after{
  background: linear-gradient(90deg,#93c5fd,#ffffff);
}
.footer-link3:hover:after{ width:calc(100% - 14px); }