/* =========================================
   1. فونت‌ها و تنظیمات پایه
   ========================================= */
@font-face {
    font-family: 'Vazirmatn';
    src: url('../assets/fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../assets/fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background: #0a0d14;
    font-family: 'Vazirmatn', sans-serif;
    color: #e3e8f5;
}

input,
button,
textarea,
select {
    font-family: inherit;
    outline: none;
}

#neonWave {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
}

/* =========================================
   2. ناوبار (هدر سایت)
   ========================================= */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 70px;
    background: rgba(10, 13, 20, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 6%;
    z-index: 100;
    box-sizing: border-box;
    border-bottom: 1px solid rgba(30, 111, 255, 0.2);
}

.logo {
    color: #1e6fff;
    font-size: 26px;
    font-weight: 800;
    text-shadow: 0 0 12px #1e6fff;
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    align-items: center;
    overflow-x: auto;
    max-width: 70%;
    gap: 20px;
}

.nav-links a {
    color: #d8deef;
    text-decoration: none;
    transition: 0.3s ease;
}

.nav-links a:hover {
    color: #1e6fff;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 6px;
    z-index: 100;
}

.hamburger span {
    width: 30px;
    height: 3px;
    border-radius: 5px;
    background-color: #1e6fff;
    box-shadow: 0 0 8px #1e6fff;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

/* =========================================
   3. ساختار کلی گالری و فیلترها
   ========================================= */
.gallery-wrapper {
    padding-top: 100px;
    position: relative;
    z-index: 2;
}

.gallery-container {
    max-width: 470px;
    margin: 0 auto;
    padding: 10px;
}

.gallery-header {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.search-bar {
    padding: 12px 15px;
    width: 100%;
    box-sizing: border-box;
    background: rgba(15, 15, 20, 0.8);
    border: 1px solid #1e6fff;
    border-radius: 8px;
    color: #fff;
    transition: 0.3s ease;
}

.search-bar::placeholder {
    color: #888;
}

.search-bar:focus {
    box-shadow: 0 0 15px rgba(30, 111, 255, 0.5);
    border-color: #0ff;
}

.filters {
    display: flex;
    gap: 10px;
}

.filter-btn {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    background: rgba(15, 15, 20, 0.8);
    border: 1px solid #1e6fff;
    color: #1e6fff;
    text-shadow: 0 0 5px rgba(30, 111, 255, 0.5);
    transition: 0.3s ease;
}

.filter-btn:hover {
    background: rgba(30, 111, 255, 0.1);
}

.filter-btn.active {
    background: #1e6fff;
    color: #fff;
    box-shadow: 0 0 15px #1e6fff;
    text-shadow: none;
}

/* =========================================
   4. کارت پست‌ها
   ========================================= */
.post-card {
    background: linear-gradient(90deg, rgba(0, 255, 255, 0.05) 0%, transparent 100%), rgba(15, 15, 20, 0.8);
    border: 1px solid #0ff;
    border-radius: 12px;
    margin-bottom: 25px;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.1);
    transition: 0.4s;
}

.post-card:hover {
    border-color: #1e6fff;
    box-shadow: 0 0 20px rgba(30, 111, 255, 0.2);
}

.highlight-post {
    border: 2px solid #0ff !important;
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.6) !important;
    transition: 2s;
}

.post-header {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.post-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    margin-left: 12px;
    border: 2px solid #0ff;
    box-shadow: 0 0 8px #0ff;
}

.post-user-info a {
    text-decoration: none;
    color: #0ff;
    font-weight: bold;
    font-size: 16px;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
}

.post-actions {
    padding: 12px 15px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.post-likes {
    padding: 0 15px;
    font-weight: bold;
    font-size: 14px;
    color: #e3e8f5;
}

/* =========================================
   5. استایل کپشن و دکمه بیشتر (Read More)
   ========================================= */
.caption-container {
    padding: 8px 15px 20px;
    font-size: 14px;
    color: #c4cce0;
    line-height: 1.6;
}

.post-caption {
    transition: max-height 0.4s ease-in-out;
    overflow: hidden;
}

.post-caption .username {
    font-weight: bold;
    text-decoration: none;
    color: #0ff;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.4);
}

.post-caption.collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    /* حداکثر 3 خط */
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    max-height: 4.8em;
}

.post-caption.expanded {
    display: block;
    -webkit-line-clamp: unset;
    max-height: 2000px;
}

.read-more-btn {
    display: none;
    background: none;
    border: none;
    color: #0ff;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    padding: 5px 0 0 0;
    margin-top: 5px;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.4);
    transition: 0.3s ease;
}

.read-more-btn:hover {
    color: #1e6fff;
    text-shadow: 0 0 10px rgba(30, 111, 255, 0.6);
}

/* =========================================
   6. اسلایدر و تصاویر
   ========================================= */
.slider-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #000;
    display: flex;
    align-items: center;
}

.slider-track {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    width: 100%;
}

.slide-item {
    min-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide-item img,
.slide-item video,
.custom-video {
    width: 100%;
    max-height: 580px;
    object-fit: cover;
    display: block;
}

.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    background: rgba(10, 13, 20, 0.7);
    border: 1px solid #0ff;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    transition: 0.3s ease;
}

.slider-nav:hover {
    background: #0ff;
    box-shadow: 0 0 10px #0ff;
}

.nav-prev {
    right: 10px;
}

.nav-next {
    left: 10px;
}

.slider-dots {
    position: absolute;
    bottom: 10px;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 6px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: 0.3s ease;
}

.dot.active {
    background: #0ff;
    transform: scale(1.3);
    box-shadow: 0 0 5px #0ff;
}

/* =========================================
   7. ویدیو پلیر سفارشی
   ========================================= */
.custom-video-container {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
}

.custom-video {
    cursor: pointer;
}

.video-btn {
    position: absolute;
    z-index: 5;
    cursor: pointer;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(10, 13, 20, 0.6);
    border: 2px solid #0ff;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
    transition: opacity 0.4s ease, transform 0.3s ease, background 0.3s ease;
    pointer-events: none;
    opacity: 1;
}

.css-icon-play {
    width: 0;
    height: 0;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-left: 18px solid #fff;
    margin-left: 6px;
    transition: 0.3s ease;
}

.css-icon-pause {
    width: 14px;
    height: 20px;
    border-left: 5px solid #fff;
    border-right: 5px solid #fff;
    box-sizing: border-box;
    transition: 0.3s;
}

.custom-video-container.is-playing .video-btn {
    opacity: 0 !important;
}

/* نوار پیشرفت ویدیو */
.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 10px 0;
    z-index: 10;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    transition: opacity 0.3s ease;
}

.custom-video-container.is-playing .video-controls {
    opacity: 0;
}

.progress-container {
    width: 95%;
    margin: 0 auto;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    transition: height 0.2s ease;
}

.progress-container:hover {
    height: 8px;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: #0ff;
    border-radius: 2px;
    box-shadow: 0 0 10px #0ff;
    transition: width 0.1s linear;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    right: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 8px #fff, 0 0 15px #0ff;
    opacity: 0;
    transition: 0.2s;
}

.progress-container:hover .progress-fill::after {
    opacity: 1;
}

@media (hover: hover) {
    .custom-video-container.is-playing:hover .video-btn {
        opacity: 1 !important;
        background: rgba(10, 13, 20, 0.4);
        transform: scale(0.9);
    }

    .custom-video-container.is-playing:hover .video-controls {
        opacity: 1;
    }

    .video-btn:hover {
        background: rgba(0, 255, 255, 0.2);
        box-shadow: 0 0 25px #0ff;
        transform: scale(1.1);
    }
}

/* =========================================
   8. دکمه‌ها و آیکون‌های SVG (ماسک)
   ========================================= */
.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-mask {
    display: inline-block;
    width: 35px;
    height: 35px;
    background-color: #e3e8f5;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    transition: all 0.3s ease;
}

.icon-like {
    -webkit-mask-image: url('../assets/icons/heart.svg');
    mask-image: url('../assets/icons/heart.svg');
    -webkit-mask-size: 100%;
    mask-size: 100%;
}

.icon-share {
    -webkit-mask-image: url('../assets/icons/share.svg');
    mask-image: url('../assets/icons/share.svg');
    -webkit-mask-size: 85%;
    mask-size: 85%;
}

.icon-chevron-right {
    -webkit-mask-image: url('../assets/icons/chevron-right.svg');
    mask-image: url('../assets/icons/chevron-right.svg');
    -webkit-mask-size: 60%;
    mask-size: 60%;
    background-color: #0ff;
}

.icon-chevron-left {
    -webkit-mask-image: url('../assets/icons/chevron-left.svg');
    mask-image: url('../assets/icons/chevron-left.svg');
    -webkit-mask-size: 60%;
    mask-size: 60%;
    background-color: #0ff;
}

.slider-nav:hover .icon-chevron-right,
.slider-nav:hover .icon-chevron-left {
    background-color: #000;
}

.action-btn:hover .icon-mask {
    background-color: #0ff;
    filter: drop-shadow(0 0 8px #0ff);
    transform: scale(1.15);
}

.action-btn.liked .icon-like {
    -webkit-mask-image: url('../assets/icons/heart-solid.svg');
    mask-image: url('../assets/icons/heart-solid.svg');
    background-color: #ff2a5f;
    filter: drop-shadow(0 0 10px rgba(255, 42, 95, 0.8));
    transform: scale(1.1);
    -webkit-mask-size: 100%;
    mask-size: 100%;
}

/* دکمه لود مور */
.load-more-btn {
    display: block;
    width: 100%;
    padding: 15px;
    margin-bottom: 40px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s ease;
    font-size: 15px;
    background: rgba(15, 15, 20, 0.8);
    border: 1px dashed #1e6fff;
    color: #1e6fff;
    text-shadow: 0 0 5px rgba(30, 111, 255, 0.5);
}

.load-more-btn:hover {
    background: rgba(30, 111, 255, 0.1);
    border-style: solid;
    box-shadow: 0 0 15px rgba(30, 111, 255, 0.3);
}

/* دکمه بازگشت سینگل پست */
.back-btn-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 25px;
    width: 100%;
}

.back-to-gallery {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(90deg, rgba(0, 255, 255, 0.1) 0%, transparent 100%), rgba(15, 15, 20, 0.8);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 12px;
    color: #0ff;
    font-size: 15px;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.back-to-gallery .icon-chevron-right {
    width: 18px;
    height: 18px;
    background-color: #0ff;
    transition: all 0.3s ease;
}

.back-to-gallery:hover {
    background: rgba(0, 255, 255, 0.1);
    border-color: #0ff;
    color: #fff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.4);
    transform: translateY(-2px);
}

.back-to-gallery:hover .icon-chevron-right {
    background-color: #fff;
    transform: translateX(3px);
}

/* =========================================
   9. مودال تایید (Modal)
   ========================================= */
.modal-overlay {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 13, 20, 0.85);
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal-box {
    position: relative;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    padding: 35px 25px;
    background: linear-gradient(135deg, rgba(15, 15, 20, 0.95), rgba(20, 25, 30, 0.95));
    border: 1px solid #1e6fff;
    border-radius: 15px;
    box-sizing: border-box;
    overflow-y: auto;
    text-align: center;
    color: #fff;
    box-shadow: 0 0 30px rgba(30, 111, 255, 0.3);
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #ff2a5f;
    font-size: 32px;
    line-height: 1;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s ease;
}

.close-modal:hover {
    color: #fff;
    text-shadow: 0 0 15px #ff2a5f;
    transform: scale(1.1) rotate(90deg);
}

.modal-box h3 {
    margin-top: 0;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(30, 111, 255, 0.2);
    font-size: 22px;
    color: #1e6fff;
    text-shadow: 0 0 10px rgba(30, 111, 255, 0.5);
}

.modal-box p {
    font-size: 15px;
    margin-bottom: 15px;
    color: #a0c4ff;
}

.modal-box input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 20px;
    box-sizing: border-box;
    text-align: center;
    direction: ltr;
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid #1e6fff;
    color: #fff;
    border-radius: 8px;
    font-size: 18px;
    letter-spacing: 2px;
    transition: 0.3s ease;
}

.modal-box input[type="text"]:focus {
    box-shadow: 0 0 15px rgba(30, 111, 255, 0.5);
    border-color: #0ff;
    background-color: rgba(30, 111, 255, 0.1);
}

.modal-box button {
    width: 100%;
    padding: 12px 0;
    background: rgba(30, 111, 255, 0.15);
    color: #fff;
    border: 1px solid #1e6fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 1px;
    transition: 0.3s ease;
}

.modal-box button:hover {
    background: #1e6fff;
    box-shadow: 0 0 20px #1e6fff;
    transform: translateY(-2px);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* =========================================
   10. تنظیمات ریسپانسیو موبایل
   ========================================= */
@media (max-width: 768px) {
    .navbar {
        padding: 14px 6%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .logo {
        width: auto;
        padding-left: 6%;
        margin-bottom: 0;
    }

    .hamburger {
        display: flex;
        padding-right: 6%;
        cursor: pointer;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        max-width: 100%;
        background: linear-gradient(90deg, rgba(0, 255, 255, 0.1) 0%, transparent 100%), rgba(15, 15, 20, 0.98);
        backdrop-filter: blur(15px);
        border-bottom: 2px solid #1e6fff;
        flex-direction: column;
        align-items: center;
        gap: 25px;
        display: none !important;
        padding: 0;
    }

    .nav-links.active {
        display: flex !important;
        padding: 30px 0;
        animation: slideDown 0.3s ease-in-out forwards;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .hamburger.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    .nav-links a {
        font-size: 15px;
    }

    .modal-box {
        width: 95%;
        padding: 25px 15px;
    }

    .modal-box h3 {
        font-size: 18px;
        margin-bottom: 15px;
    }

    .modal-box input[type="text"] {
        font-size: 16px;
        padding: 10px;
        margin-bottom: 15px;
    }

    .close-modal {
        top: 10px;
        right: 15px;
        font-size: 28px;
    }
}