:root {
    --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-inset-top: env(safe-area-inset-top, 0px);
    --safe-area-inset-left: env(safe-area-inset-left, 0px);
    --safe-area-inset-right: env(safe-area-inset-right, 0px);
}

@media (max-width: 768px) {
    .header,
    .footer {
        display: none !important;
    }
    
    .main-content {
        padding-bottom: 80px;
        padding-top: 60px;
        min-height: calc(100vh - 140px);
    }
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(17, 17, 17, 0.98);
    backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0.5rem;
    padding-bottom: calc(0.5rem + var(--safe-area-inset-bottom));
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 12px;
    transition: var(--transition);
    min-width: 56px;
    position: relative;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

.nav-item.active {
    color: var(--accent-primary);
    background: rgba(0, 255, 136, 0.1);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    top: -2px;
    width: 4px;
    height: 4px;
    background: var(--accent-primary);
    border-radius: 50%;
}

.nav-icon {
    font-size: 1.4rem;
    margin-bottom: 0.25rem;
    transition: var(--transition);
    display: block;
}

.nav-label {
    font-size: 0.65rem;
    font-weight: 600;
    transition: var(--transition);
}

.nav-item.active .nav-icon {
    transform: scale(1.1);
}

.nav-upload {
    background: var(--accent-gradient);
    color: #000 !important;
    border-radius: 50%;
    width: 52px;
    height: 52px;
    margin-top: -16px;
    box-shadow: 0 4px 20px rgba(0, 255, 136, 0.4);
    border: 3px solid var(--bg-primary);
}

.nav-upload .nav-icon {
    font-size: 1.6rem;
    margin-bottom: 0;
}

.nav-upload .nav-label {
    display: none;
}

.fab {
    position: fixed;
    bottom: 150px;
    right: 16px;
    width: 56px;
    height: 56px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 6px 25px rgba(0, 255, 136, 0.4);
    z-index: 999;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.fab:active {
    transform: scale(0.95);
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.6);
}

.mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(17, 17, 17, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    padding-top: calc(0.75rem + var(--safe-area-inset-top));
    z-index: 1001;
    height: 60px;
}

.mobile-menu-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: var(--transition);
}

.mobile-menu-btn:active {
    background: rgba(255, 255, 255, 0.1);
}

.mobile-logo {
    cursor: pointer;
}

.mobile-logo img {
    height: 32px;
    width: auto;
    filter: drop-shadow(0 0 10px rgba(0, 255, 136, 0.3));
}

.mobile-actions {
    display: flex;
    gap: 0.5rem;
}

.mobile-action-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: var(--transition);
}

.mobile-action-btn:active {
    background: rgba(255, 255, 255, 0.1);
}

.mobile-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    z-index: 2000;
    display: none;
    flex-direction: column;
}

.mobile-search-overlay.active {
    display: flex;
}

.search-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    padding-top: calc(1rem + var(--safe-area-inset-top));
    background: var(--bg-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    gap: 0.75rem;
}

.search-back {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.5rem;
}

.search-input-container {
    flex: 1;
    position: relative;
}

#mobileSearchInput {
    width: 100%;
    padding: 0.875rem 2.5rem 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 1rem;
}


.search-close {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.5rem;
}

.search-results-mobile {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 5, 5, 0.95);
    backdrop-filter: blur(10px);
    z-index: 2001;
    display: none;
}

.mobile-menu-overlay.active {
    display: block;
}

.mobile-menu-content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-secondary);
    border-radius: 20px 20px 0 0;
    padding: 1.5rem;
    padding-bottom: calc(1.5rem + var(--safe-area-inset-bottom));
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu-user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--accent-primary);
}

.menu-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.menu-user-details {
    display: flex;
    flex-direction: column;
}

.menu-user-details strong {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.menu-user-details span {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.menu-guest h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.menu-guest p {
    color: var(--text-secondary);
}

.menu-close {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.menu-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 12px;
    transition: var(--transition);
    font-weight: 500;
}

.menu-item:active {
    background: rgba(255, 255, 255, 0.1);
}

.menu-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.stories-container {
    padding: 1rem 0.5rem;
    margin-bottom: 1rem;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.stories-container::-webkit-scrollbar {
    display: none;
}

.stories-scroll {
    display: flex;
    gap: 1rem;
    padding: 0 0.5rem;
}

.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 70px;
    cursor: pointer;
}

.story-avatar {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--accent-primary);
    position: relative;
}

.story-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.add-icon {
    font-size: 1.5rem;
}

.story-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-align: center;
}

.posts-feed {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0 0.5rem;
}

.post-card-mobile {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.post-header-mobile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
}

.post-user-avatar-mobile {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
}

.post-user-avatar-mobile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-user-info-mobile {
    flex: 1;
}

.post-username-mobile {
    font-weight: 600;
    font-size: 0.95rem;
}

.post-time-mobile {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.post-more-mobile {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
}

.post-image-mobile {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.post-actions-mobile {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 1rem;
}

.post-action-group {
    display: flex;
    gap: 1rem;
}

.post-action-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: var(--transition);
}

.post-action-btn:active {
    transform: scale(1.1);
}

.post-action-btn.active {
    color: var(--accent-primary);
}

.post-stats-mobile {
    padding: 0 1rem 0.75rem;
}

.post-likes-mobile {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.post-title-mobile {
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.post-description-mobile {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .modal-content {
        width: 95vw;
        max-width: none;
        margin: 0;
        border-radius: 0;
        height: 100vh;
        max-height: 100vh;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        transform: none;
        animation: modalSlideUp 0.3s ease;
    }
    
    @keyframes modalSlideUp {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }
    
    .modal-close {
        top: 1rem;
        right: 1rem;
        background: rgba(0, 0, 0, 0.5);
        color: white;
    }
    
    .upload-area {
        padding: 3rem 1rem;
    }
    
    .upload-icon {
        font-size: 3rem;
    }
}

@media (hover: none) and (pointer: coarse) {
    .post-card:hover {
        transform: none;
    }
    
    .btn-primary:active,
    .btn-secondary:active,
    .btn-upload:active {
        transform: scale(0.98);
    }
    
    .nav-item:active {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .post-action-btn:active {
        transform: scale(1.1);
    }
}

@media (max-width: 768px) {
    .posts-feed,
    .stories-container,
    .search-results-mobile {
        -webkit-overflow-scrolling: touch;
        transform: translateZ(0);
    }
    
    .post-card-mobile {
        transform: translateZ(0);
        will-change: transform;
    }
    
    .nav-item,
    .post-action-btn,
    .mobile-action-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .post-image-mobile {
        loading: lazy;
        decoding: async;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #050505;
        --bg-secondary: #111111;
        --bg-card: #151515;
    }
}

@media (prefers-contrast: high) {
    :root {
        --text-secondary: #ffffff;
        --text-muted: #cccccc;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .bottom-nav {
        display: none;
    }
    
    .mobile-header {
        display: none;
    }
    
    .header {
        display: flex !important;
    }
    
    .main-content {
        padding-top: 0;
        padding-bottom: 0;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .posts-feed {
        padding: 0 1rem;
    }
    
    .stories-container {
        padding: 1rem;
    }
}

@media (max-width: 360px) {
    .nav-label {
        font-size: 0.6rem;
    }
    
    .nav-icon {
        font-size: 1.2rem;
    }
    
    .mobile-header {
        padding: 0.5rem;
    }
    
    .posts-feed {
        padding: 0 0.25rem;
    }
}

@media (max-width: 768px) {
    .bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(17, 17, 17, 0.98);
        backdrop-filter: blur(20px) saturate(180%);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        display: flex;
        justify-content: space-around;
        align-items: center;
        padding: 0.5rem;
        padding-bottom: calc(0.5rem + var(--safe-area-inset-bottom));
        z-index: 1000;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    }

    .fab {
        position: fixed;
        bottom: 100px;
        right: 16px;
        width: 56px;
        height: 56px;
        background: var(--accent-gradient);
        border: none;
        border-radius: 50%;
        cursor: pointer;
        box-shadow: 0 6px 25px rgba(0, 255, 136, 0.4);
        z-index: 999;
        transition: var(--transition);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.4rem;
    }

    .mobile-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background: rgba(17, 17, 17, 0.95);
        backdrop-filter: blur(20px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 1rem;
        padding-top: calc(0.75rem + var(--safe-area-inset-top));
        z-index: 1001;
        height: 60px;
    }

    .header {
        display: none !important;
    }
    
    .main-content {
        padding-bottom: 80px;
        padding-top: 60px;
        min-height: calc(100vh - 140px);
    }
}

@media (min-width: 769px) {
    .bottom-nav,
    .fab,
    .mobile-header,
    .mobile-search-overlay,
    .mobile-menu-overlay {
        display: none !important;
    }
    
    .header {
        display: block !important;
    }
    
    .main-content {
        padding-top: 3rem;
        padding-bottom: 3rem;
        min-height: calc(100vh - 160px);
    }
}

/* Mobile Search Styles */
.search-result-item-mobile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-card);
    margin-bottom: 0.5rem;
    border-radius: var(--border-radius);
}

.search-result-item-mobile:active {
    transform: scale(0.98);
    background: rgba(0, 255, 136, 0.1);
}

.search-result-image {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.search-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
    line-height: 1.3;
}

.search-result-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.search-result-user {
    font-size: 0.8rem;
    color: var(--accent-primary);
    font-weight: 500;
}

.search-result-tags {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
}

.search-result-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.search-loading, .search-error, .search-no-results {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.search-no-results .no-results-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-results-text {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.no-results-hint {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Mobile Search Overlay Improvements */
.mobile-search-overlay.active {
    display: block;
    animation: slideInUp 0.3s ease;
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.search-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 1;
}

.search-input-container {
    flex: 1;
    position: relative;
}

#mobileSearchInput {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

#mobileSearchInput:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: var(--accent-glow);
}

.search-input-container .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-back, .search-close {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-back:active, .search-close:active {
    background: rgba(255, 255, 255, 0.1);
}

.search-results-mobile {
    padding: 1rem;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    background: var(--bg-primary);
}

/* Mobile Menu Improvements */
.mobile-menu-overlay.active {
    display: block;
    animation: slideInLeft 0.3s ease;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Bottom Navigation Active States */
.nav-item.active {
    color: var(--accent-primary);
    background: rgba(0, 255, 136, 0.1);
    transform: translateY(-2px);
}

/* Touch Improvements */
@media (max-width: 768px) {
    button, .btn-primary, .btn-secondary, .nav-item, .search-result-item-mobile {
        min-height: 44px;
        min-width: 44px;
    }
    
    .post-card:active {
        transform: scale(0.98);
    }
}










/* استایل برای کارت‌های پست در موبایل - مخفی کردن دکمه‌های action به صورت پیش‌فرض */
@media (max-width: 768px) {
    .post-card {
        position: relative;
        overflow: hidden;
    }

    .post-overlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.8) 100%);
        display: flex;
        align-items: flex-end;
        justify-content: center;
        padding: 1rem;
        opacity: 0;
        transition: all 0.3s ease;
        z-index: 2;
    }

    .post-actions {
        display: flex;
        gap: 0.5rem;
        transform: translateY(20px);
        transition: all 0.3s ease;
        width: 100%;
        justify-content: center;
    }

    /* نمایش overlay و actions هنگام لمس/هاور */
    .post-card:active .post-overlay,
    .post-card:focus .post-overlay,
    .post-card:hover .post-overlay {
        opacity: 1;
    }

    .post-card:active .post-actions,
    .post-card:focus .post-actions,
    .post-card:hover .post-actions {
        transform: translateY(0);
    }

    /* استایل دکمه‌های action در موبایل */
    .post-action {
        background: rgba(255, 255, 255, 0.95);
        border: none;
        border-radius: 25px;
        padding: 0.75rem 1.25rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        cursor: pointer;
        transition: all 0.2s ease;
        font-size: 0.9rem;
        font-weight: 600;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
        min-height: 44px;
        min-width: 44px;
        justify-content: center;
    }

    .post-action:active {
        background: var(--accent-primary);
        transform: scale(0.95);
    }

    .action-icon {
        font-size: 1.1rem;
    }

    /* بهبود UX برای لمس */
    .post-card {
        -webkit-tap-highlight-color: transparent;
        cursor: pointer;
    }

    /* برای دستگاه‌های با قابلیت هاور (تبلت‌ها) */
    @media (hover: hover) {
        .post-card:hover .post-overlay {
            opacity: 1;
        }
        
        .post-card:hover .post-actions {
            transform: translateY(0);
        }
    }

    /* برای دستگاه‌های لمسی */
    @media (hover: none) {
        .post-card:active .post-overlay {
            opacity: 1;
        }
        
        .post-card:active .post-actions {
            transform: translateY(0);
        }
        
        /* اضافه کردن delay برای تجربه بهتر */
        .post-overlay {
            transition: opacity 0.2s ease;
        }
        
        .post-actions {
            transition: transform 0.2s ease;
        }
    }
}

/* استایل برای حالت focus برای دسترسی بهتر */
@media (max-width: 768px) {
    .post-card:focus {
        outline: 2px solid var(--accent-primary);
        outline-offset: 2px;
    }
    
    .post-card:focus .post-overlay {
        opacity: 1;
    }
    
    .post-card:focus .post-actions {
        transform: translateY(0);
    }
}

/* بهبود استایل برای کارت‌های پست در فید موبایل */
@media (max-width: 768px) {
    .posts-masonry .post-card {
        margin-bottom: 1rem;
    }
    
    .posts-masonry .post-overlay {
        border-radius: 16px;
    }
    
    .posts-masonry .post-actions {
        padding: 0 0.5rem;
    }
}

/* استایل برای ویدیوها در موبایل */
@media (max-width: 768px) {
    .post-media-container {
        position: relative;
    }
    
    .post-media-container video {
        width: 100%;
        height: auto;
        border-radius: 12px;
    }
    
    /* اطمینان از اینکه overlay روی ویدیوها هم کار کند */
    .post-media-container + .post-overlay {
        border-radius: 12px;
    }
}

/* بهبود responsive برای دکمه‌ها در صفحات کوچک‌تر */
@media (max-width: 360px) {
    .post-actions {
        gap: 0.25rem;
    }
    
    .post-action {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
    
    .action-icon {
        font-size: 1rem;
    }
}

/* استایل برای حالت loading */
@media (max-width: 768px) {
    .post-card.loading .post-overlay {
        display: none;
    }
    
    .post-card.loading .post-actions {
        display: none;
    }
}

/* پشتیبانی از حالت reduced motion */
@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
    .post-overlay,
    .post-actions,
    .post-action {
        transition: none;
    }
    
    .post-card:active .post-actions,
    .post-card:focus .post-actions,
    .post-card:hover .post-actions {
        transform: none;
    }
}


/* استایل‌های جدید برای منوی کشویی */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

.mobile-menu-content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-secondary);
    border-radius: 20px 20px 0 0;
    padding: 1.5rem;
    padding-bottom: calc(1.5rem + var(--safe-area-inset-bottom));
    transform: translateY(100%);
    animation: slideUp 0.3s ease forwards;
    max-height: 80vh;
    overflow-y: auto;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.2rem;
}

.menu-close {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: var(--transition);
}

.menu-close:active {
    background: rgba(255, 255, 255, 0.1);
}

.menu-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 12px;
    transition: var(--transition);
    font-weight: 500;
    position: relative;
}

.menu-item:active {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(0.98);
}

.menu-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.menu-text {
    flex: 1;
}

.menu-badge {
    background: var(--accent-primary);
    color: #000;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.logout-item {
    color: #ff6b6b;
    margin-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

/* بهبود استایل‌های موجود */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(17, 17, 17, 0.98);
    backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0.5rem;
    padding-bottom: calc(0.5rem + var(--safe-area-inset-bottom));
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 12px;
    transition: var(--transition);
    min-width: 56px;
    position: relative;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

.nav-item.active {
    color: var(--accent-primary);
    background: rgba(0, 255, 136, 0.1);
}

.nav-icon {
    font-size: 1.4rem;
    margin-bottom: 0.25rem;
    transition: var(--transition);
}

.nav-label {
    font-size: 0.65rem;
    font-weight: 600;
}

.nav-upload {
    background: var(--accent-gradient);
    color: #000 !important;
    border-radius: 50%;
    width: 52px;
    height: 52px;
    margin-top: -16px;
    box-shadow: 0 4px 20px rgba(0, 255, 136, 0.4);
    border: 3px solid var(--bg-primary);
}

.nav-upload .nav-icon {
    font-size: 1.6rem;
    margin-bottom: 0;
}

.nav-upload .nav-label {
    display: none;
}

.fab {
    position: fixed;
    bottom: 100px;
    right: 16px;
    width: 56px;
    height: 56px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 6px 25px rgba(0, 255, 136, 0.4);
    z-index: 999;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.fab:active {
    transform: scale(0.95);
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.6);
}

/* بهبود responsive */
@media (max-width: 768px) {
    .mobile-menu-content {
        padding: 1rem;
        padding-bottom: calc(1rem + var(--safe-area-inset-bottom));
    }
    
    .menu-item {
        padding: 0.875rem;
    }
    
    .menu-icon {
        font-size: 1.1rem;
    }
}

@media (max-width: 360px) {
    .nav-label {
        font-size: 0.6rem;
    }
    
    .nav-icon {
        font-size: 1.2rem;
    }
    
    .menu-item {
        padding: 0.75rem;
    }
}