/* extracted from application/views/views/tiliv/home/home.php */
.stories-container {
            display: flex;
            overflow-x: auto;
            padding: 10px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border-bottom: 1px solid #dbdbdb;
            scrollbar-width: none;
            border-radius: 15px;
            margin: 10px;
        }
        
        .stories-container::-webkit-scrollbar {
            display: none;
        }
        
        .story-item {
            flex-shrink: 0;
            margin: 0 8px;
            cursor: pointer;
            text-align: center;
            transition: all 0.3s ease;
        }
        
        .story-item:hover {
            transform: translateY(-5px);
        }
        
        .story-avatar {
            width: 64px;
            height: 64px;
            border-radius: 50%;
            position: relative;
            margin: 0 auto 8px;
            transition: all 0.3s ease;
        }
        
        .story-avatar img {
            width: 100%;
            height: 100%;
            border-radius: 50%;
            object-fit: cover;
            position: relative;
            z-index: 1;
        }
        
        /* استوری دیده شده - نوار خاکستری */
        .story-avatar.viewed::before {
            content: '';
            position: absolute;
            top: -3px;
            left: -3px;
            right: -3px;
            bottom: -3px;
            border: 3px solid #c7c7c7;
            border-radius: 50%;
        }
        
        /* استوری دیده نشده - نوار رنگی */
        .story-avatar.unviewed::before {
            content: '';
            position: absolute;
            top: -3px;
            left: -3px;
            right: -3px;
            bottom: -3px;
            background: linear-gradient(45deg, #ff6b6b, #ee5a24, #feca57, #5f27cd);
            border-radius: 50%;
            animation: rotating 2s linear infinite;
        }
        
        @keyframes rotating {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }
        
        /* دکمه افزودن استوری */
        .story-avatar.add-story {
            border: 3px dashed #ffffff;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(255, 255, 255, 0.2);
            backdrop-filter: blur(10px);
        }
        
        .story-avatar.add-story::before {
            display: none;
        }
        
        .add-icon {
            font-size: 28px;
            color: #ffffff;
            font-weight: bold;
        }
        
        .story-username {
            font-size: 12px;
            color: #ffffff;
            max-width: 66px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            text-shadow: 0 1px 3px rgba(0,0,0,0.3);
            font-weight: 500;
        }
        
        /* مودال نمایش استوری */
        .story-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.9);
            z-index: 9999;
        }
        
        .story-modal.show {
            display: block;
        }
        
        .story-content {
            position: relative;
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .story-media {
            max-width: 400px;
            max-height: 80vh;
            border-radius: 12px;
            position: relative;
            box-shadow: 0 10px 30px rgba(0,0,0,0.3);
        }
        
        .story-media img,
        .story-media video {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 12px;
        }
        
        /* هدر استوری */
        .story-header {
            position: absolute;
            top: 20px;
            left: 20px;
            right: 20px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            z-index: 2;
            background: rgba(0,0,0,0.5);
            border-radius: 10px;
            padding: 10px;
        }
        
        /* نوار پیشرفت چندگانه */
        .story-progress-container {
            display: flex;
            gap: 4px;
            flex: 1;
            margin: 0 15px;
        }
        
        .story-progress {
            flex: 1;
            height: 3px;
            background: rgba(255,255,255,0.3);
            border-radius: 2px;
            position: relative;
        }
        
        .story-progress-bar {
            height: 100%;
            background: white;
            border-radius: 2px;
            width: 0%;
            transition: width 0.1s linear;
        }
        
        .story-user-info {
            display: flex;
            align-items: center;
            color: white;
        }
        
        .story-user-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            margin-left: 12px;
            border: 2px solid white;
        }
        
        .story-user-avatar img {
            width: 100%;
            height: 100%;
            border-radius: 50%;
            object-fit: cover;
        }
        
        .story-user-name {
            font-weight: 600;
            text-shadow: 0 1px 3px rgba(0,0,0,0.5);
        }
        
        .close-story {
            background: rgba(0,0,0,0.6);
            border: none;
            color: white;
            cursor: pointer;
            width: 35px;
            height: 35px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .close-story:hover {
            background: rgba(0,0,0,0.8);
        }
        
        /* کنترل‌های استوری */
        .story-controls {
            position: absolute;
            bottom: 20px;
            left: 20px;
            right: 20px;
            display: flex;
            gap: 10px;
            background: rgba(0,0,0,0.6);
            padding: 12px;
            border-radius: 15px;
        }
        
        .story-input {
            flex: 1;
            padding: 10px 15px;
            border: 1px solid rgba(255,255,255,0.3);
            border-radius: 15px;
            background: rgba(255,255,255,0.1);
            color: white;
            font-size: 14px;
        }
        
        .story-input:focus {
            outline: none;
            border-color: #007bff;
        }
        
        .story-input::placeholder {
            color: rgba(255,255,255,0.7);
        }
        
        .story-btn {
            background: transparent;
            border: none;
            color: white;
            cursor: pointer;
            padding: 10px;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .story-btn:hover {
            background: rgba(255,255,255,0.2);
        }
        
        .story-btn.liked {
            color: #ff3040;
        }
        
        /* دکمه‌های ناوبری */
        .story-nav {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            background: rgba(0,0,0,0.6);
            border: none;
            color: white;
            cursor: pointer;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 3;
        }
        
        .story-nav:hover {
            background: rgba(0,0,0,0.8);
        }
        
        .story-nav.prev {
           right : 20px;
        }
        
        .story-nav.next {
            left: 20px;
        }
        
        /* مودال آپلود استوری */
        .upload-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.8);
            z-index: 10000;
        }
        
        .upload-modal.show {
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .upload-content {
            background: white;
            border-radius: 15px;
            padding: 25px;
            max-width: 450px;
            width: 90%;
            box-shadow: 0 10px 30px rgba(0,0,0,0.3);
        }
        
        .upload-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }
        
        .upload-header h3 {
            margin: 0;
            font-size: 20px;
            color: #333;
        }
        
        .upload-header button {
            background: #f8f9fa;
            border: none;
            color: #666;
            cursor: pointer;
            width: 35px;
            height: 35px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .upload-tabs {
            display: flex;
            margin-bottom: 20px;
            background: #f8f9fa;
            border-radius: 10px;
            padding: 3px;
        }
        
        .upload-tab {
            flex: 1;
            padding: 10px;
            text-align: center;
            background: transparent;
            border: none;
            cursor: pointer;
            color: #666;
            border-radius: 8px;
            font-weight: 500;
        }
        
        .upload-tab.active {
            background: white;
            color: #007bff;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }
        
        .file-upload-area {
            border: 2px dashed #ddd;
            border-radius: 10px;
            padding: 40px;
            text-align: center;
            margin-bottom: 20px;
            background: #fafafa;
        }
        
        .file-upload-area:hover {
            border-color: #007bff;
        }
        
        .text-story-area {
            display: none;
        }
        
        .text-story-area.active {
            display: block;
        }
        
        .story-text-input {
            width: 100%;
            height: 100px;
            padding: 12px;
            border: 1px solid #ddd;
            border-radius: 10px;
            resize: none;
            font-size: 14px;
        }
        
        .story-text-input:focus {
            outline: none;
            border-color: #007bff;
        }
        
        .color-picker {
            display: flex;
            gap: 8px;
            margin: 15px 0;
            justify-content: center;
        }
        
        .color-option {
            width: 30px;
            height: 30px;
            border-radius: 50%;
            border: 2px solid transparent;
            cursor: pointer;
        }
        
        .color-option.selected {
            border-color: #007bff;
        }
        
        .upload-btn {
            width: 100%;
            padding: 12px;
            background: #007bff;
            color: white;
            border: none;
            border-radius: 10px;
            font-size: 16px;
            font-weight: 500;
            cursor: pointer;
        }
        
        .upload-btn:hover {
            background: #0056b3;
        }

       .upload-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.loading-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* نمایش فایل انتخاب شده */
.file-selected {
    background: #e8f5e8;
    border-color: #28a745;
    color: #155724;
}

.selected-file-info {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #007bff;
    text-align: center;
}

.selected-file-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
    word-break: break-word;
}

.selected-file-size {
    font-size: 12px;
    color: #666;
    background: #e9ecef;
    padding: 3px 8px;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 10px;
}

.file-preview {
    width: 120px;
    height: 120px;
    margin: 10px auto;
    border-radius: 10px;
    object-fit: cover;
    display: block;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

        
        /* مودال آمار استوری */
        .stats-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.8);
            z-index: 10001;
        }
        
        .stats-modal.show {
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .stats-content {
            background: white;
            border-radius: 15px;
            padding: 25px;
            max-width: 450px;
            width: 90%;
            max-height: 80vh;
            overflow-y: auto;
            box-shadow: 0 10px 30px rgba(0,0,0,0.3);
        }
        
        .stats-tabs {
            display: flex;
            margin-bottom: 20px;
            background: #f8f9fa;
            border-radius: 10px;
            padding: 3px;
        }
        
        .stats-tab {
            flex: 1;
            padding: 10px;
            text-align: center;
            background: transparent;
            border: none;
            cursor: pointer;
            color: #666;
            border-radius: 8px;
            font-weight: 500;
        }
        
        .stats-tab.active {
            background: white;
            color: #007bff;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }
        
        .user-item {
            display: flex;
            align-items: center;
            padding: 12px 0;
            border-bottom: 1px solid #f0f0f0;
        }
        
        .user-item:last-child {
            border-bottom: none;
        }
        
        .user-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            margin-left: 12px;
        }
        
        .user-avatar img {
            width: 100%;
            height: 100%;
            border-radius: 50%;
            object-fit: cover;
        }
        
        .user-info {
            flex: 1;
        }
        
        .user-name {
            font-weight: 500;
            color: #333;
            margin-bottom: 2px;
        }
        
        .user-username {
            font-size: 12px;
            color: #999;
        }
        
        .profile-btn {
            background: #f8f9fa;
            border: 1px solid #ddd;
            color: #333;
            padding: 6px 12px;
            border-radius: 15px;
            font-size: 12px;
            cursor: pointer;
            text-decoration: none;
        }
        
        .profile-btn:hover {
            background: #e9ecef;
            text-decoration: none;
            color: #333;
        }

        /* ری استوری */
        .repost-indicator {
            position: absolute;
            top: 65px;
            left: 20px;
            right: 20px;
            background: rgba(0,0,0,0.7);
            color: white;
            padding: 8px 12px;
            border-radius: 8px;
            font-size: 12px;
            z-index: 3;
        }

        .repost-name {
            color: #fff;
            cursor: pointer;
            text-decoration: underline;
        }

        .repost-name:hover {
            color: #ccc;
        }

        /* منشن */
        .mention {
            color: #007bff;
            font-weight: bold;
            text-decoration: none;
        }

        .mention:hover {
            text-decoration: underline;
        }
 .share-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 10002;
}

.share-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-content {
    background: white;
    border-radius: 15px;
    padding: 25px;
    max-width: 450px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
}

.share-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.share-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.share-header button {
    background: #f8f9fa;
    border: none;
    color: #666;
    cursor: pointer;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-container {
    margin-bottom: 20px;
}

.search-container input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 14px;
}

.search-container input:focus {
    outline: none;
    border-color: #007bff;
}

.contacts-list {
    flex: 1;
    overflow: hidden;
    max-height: 400px;
}
.contact-item img{
    height:40px !important;
    margin-left:10px;
}

.contact-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
}

.contact-item:last-child {
    border-bottom: none;
}

.contact-item:hover {
    background: #f8f9fa;
    margin: 0 -10px;
    padding: 12px 10px;
    border-radius: 8px;
}

.contact-info {
    flex: 1;
    margin-left: 12px;
}

.contact-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
}

.contact-username {
    font-size: 12px;
    color: #999;
}

.share-contact-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
}

.share-contact-btn:hover {
    background: #0056b3;
}

/* Cleaned static inline styles — home story controls */
.story-color-black{background:#000000;}
.story-color-red{background:#ff0000;}
.story-color-green{background:#00ff00;}
.story-color-blue{background:#0000ff;}
.story-color-yellow{background:#ffff00;}
.story-color-magenta{background:#ff00ff;}
.story-color-gradient-one{background:linear-gradient(45deg,#667eea,#764ba2);}
.story-color-gradient-two{background:linear-gradient(45deg,#f093fb,#f5576c);}
