:root {
    --primary-gradient: linear-gradient(45deg, #ff007a, #ff0080, #ff0099, #ff00b3);
    --secondary-gradient: linear-gradient(45deg, #833ab4, #fd1d1d, #fcb045);
    --card-bg: #1a1a1a;
    --bg-color: #121212;
    --text-primary: #ffffff;
    --text-secondary: #a8a8a8;
    --border-color: #333333;
    --live-color: #ff3040;
    --story-border: linear-gradient(45deg, #ff007a, #ff0080, #ff0099);
    --accent-color: #ff007a;
    --accent-color-2: #833ab4;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    direction: rtl;
    overflow-x: hidden;
    padding-bottom: 70px; /* فضای برای منوی پایین */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* انیمیشن‌های کلی */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes glow {
    0% { box-shadow: 0 0 5px rgba(255, 0, 122, 0.5); }
    50% { box-shadow: 0 0 20px rgba(255, 0, 122, 0.8); }
    100% { box-shadow: 0 0 5px rgba(255, 0, 122, 0.5); }
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.animated {
    animation: fadeIn 0.8s ease-out;
}

.float-animation {
    animation: float 6s ease-in-out infinite;
}

.pulse-animation {
    animation: pulse 2s ease-in-out infinite;
}

.glow-animation {
    animation: glow 2s ease-in-out infinite;
}

.slide-in {
    animation: slideIn 0.5s ease-out;
}

/* نوار ناوبری */
.navbar {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 12px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 28px;
    font-weight: bold;
    background: var(--secondary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(131, 58, 180, 0.3);
}

.search-box {
    background: #2a2a2a;
    border-radius: 20px;
    padding: 10px 18px;
    width: 300px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    border: 1px solid #333;
}

.search-box:focus-within {
    box-shadow: 0 0 0 2px rgba(131, 58, 180, 0.3);
    border-color: var(--accent-color-2);
}

.search-box input {
    border: none;
    background: transparent;
    width: 100%;
    outline: none;
    padding: 5px;
    font-size: 15px;
    color: var(--text-primary);
}

.nav-icons {
    display: flex;
    gap: 22px;
}

.nav-icons i {
    font-size: 24px;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.nav-icons i:hover {
    color: var(--accent-color);
    transform: scale(1.1);
}

.active-nav {
    color: var(--accent-color) !important;
}

/* محتوای اصلی */
.main-content {
    display: flex;
    margin-top: 30px;
    gap: 25px;
}

.feed {
    flex: 2;
}

.sidebar {
    flex: 1;
    position: sticky;
    top: 80px;
    height: fit-content;
}

/* بخش استوری‌ها */
.stories-container {
    margin-bottom: 25px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.section-title i {
    color: var(--accent-color);
}

.stories {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    overflow-x: auto;
    gap: 20px;
    scrollbar-width: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.stories::-webkit-scrollbar {
    display: none;
}

.story {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    position: relative;
    transition: transform 0.3s ease;
}

.story:hover {
    transform: translateY(-5px);
}

.story-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    padding: 3px;
    background: var(--story-border);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 8px;
    position: relative;
    box-shadow: 0 4px 10px rgba(255, 0, 122, 0.3);
}

.story-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid var(--card-bg);
    object-fit: cover;
}

.story-type {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    border: 2px solid var(--card-bg);
}

.story-username {
    font-size: 13px;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
}

.live-badge {
    background: var(--primary-gradient);
    color: white;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 6px;
    margin-top: 5px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    box-shadow: 0 2px 8px rgba(255, 0, 122, 0.3);
}

/* پست ها */
.post {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    margin-bottom: 25px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.post.visible {
    opacity: 1;
    transform: translateY(0);
}

.post:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 18px;
    border-bottom: 1px solid var(--border-color);
}

.post-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.post-user img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-color);
}

.post-options {
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.post-options:hover {
    color: var(--accent-color);
}

.post-image {
    width: 100%;
    max-height: 600px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.post-image:hover {
    transform: scale(1.02);
}

.post-actions {
    padding: 15px 18px;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.post-actions-left {
    display: flex;
    gap: 18px;
}

.post-actions i {
    font-size: 26px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.post-actions i:hover {
    color: var(--accent-color);
    transform: scale(1.15);
}

.post-likes {
    padding: 0 18px;
    margin: 10px 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.post-likes-count {
    font-weight: 700;
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.post-caption {
    padding: 0 18px 15px;
    line-height: 1.6;
    color: var(--text-primary);
}

.post-time {
    padding: 0 18px 15px;
    color: var(--text-secondary);
    font-size: 13px;
}

/* سایدبار */
.profile-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.profile-info img {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-color);
}

.profile-text h3 {
    margin-bottom: 5px;
    color: var(--text-primary);
}

.profile-text p {
    color: var(--text-secondary);
    font-size: 14px;
}

.suggestions-title {
    display: flex;
    justify-content: space-between;
    margin-bottom: 18px;
    align-items: center;
}

.suggestions-title h3 {
    font-size: 16px;
    color: var(--text-secondary);
}

.suggestions-title a {
    color: var(--accent-color);
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.suggestions-title a:hover {
    opacity: 0.8;
}

.suggestion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.suggestion-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.suggestion-user img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-color);
}

.suggestion-info h4 {
    font-size: 14px;
    margin-bottom: 2px;
    color: var(--text-primary);
}

.suggestion-info p {
    color: var(--text-secondary);
    font-size: 12px;
}

.follow-btn {
    color: var(--accent-color);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.follow-btn:hover {
    opacity: 0.8;
}

/* منوی پایین */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    padding: 12px 0;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-secondary);
}

.nav-item.active {
    color: var(--accent-color);
}

.nav-item i {
    font-size: 24px;
    margin-bottom: 4px;
}

.nav-item span {
    font-size: 12px;
}

.nav-item:hover {
    color: var(--accent-color);
    transform: translateY(-3px);
}

/* انیمیشن‌ها و افکت‌ها */
.liked {
    color: #ed4956 !important;
    animation: heartBeat 0.6s ease;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(0.9); }
    75% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.count-up {
    animation: countUp 0.5s ease;
}

@keyframes countUp {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* ویوور استوری */
.story-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

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

.story-content img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

.story-close {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    font-size: 28px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.3s ease;
}

.story-close:hover {
    background: rgba(255, 0, 122, 0.5);
}

.story-username-header {
    position: absolute;
    top: 25px;
    color: white;
    font-weight: 600;
    font-size: 16px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.story-progress {
    display: flex;
    gap: 5px;
    position: absolute;
    top: 15px;
    width: 90%;
}

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

.progress-fill {
    height: 100%;
    background: var(--primary-gradient);
    width: 0%;
    transition: width 0.2s linear;
}

/* صفحه پرداخت برای لایو */
.payment-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
}

.payment-content {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    animation: pulse 2s infinite;
}

.payment-content h2 {
    margin-bottom: 15px;
    color: var(--text-primary);
    background: var(--secondary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.payment-content p {
    margin-bottom: 25px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.payment-options {
    display: flex;
    justify-content: center;
    margin-bottom: 25px;
}

.payment-option {
    border: 2px solid var(--accent-color-2);
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    background: rgba(131, 58, 180, 0.1);
}

.payment-icon {
    font-size: 30px;
    margin-bottom: 10px;
    color: var(--accent-color-2);
}

.pay-button {
    background: var(--secondary-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    box-shadow: 0 4px 15px rgba(131, 58, 180, 0.3);
}

.pay-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(131, 58, 180, 0.4);
}

.close-payment {
    position: absolute;
    top: 15px;
    left: 15px;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-payment:hover {
    color: var(--accent-color);
}

/* صفحه در حال اتصال */
.connecting-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 3000;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.connecting-content {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 40px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
}

.connecting-icon {
    font-size: 50px;
    color: var(--accent-color);
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

.connecting-content h2 {
    margin-bottom: 15px;
    color: var(--text-primary);
}

.connecting-content p {
    margin-bottom: 25px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #333;
    border-top: 5px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* رسپانسیو */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        display: none;
    }
    
    .search-box {
        display: none;
    }
    
    .stories, .post {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .payment-options {
        flex-direction: column;
    }

    .nav-icons {
        display: none;
    }

    .bottom-nav {
        display: flex;
    }
}

@media (min-width: 769px) {
    .bottom-nav {
        display: none;
    }
}