/**
 * WP Instagram Stories - Frontend Styles
 * شبیه‌سازی کامل UI اینستاگرام
 * 
 * @package WP_Instagram_Stories
 * @version 1.0.0
 */

/* ========================================
   1. GRID استوری‌ها
   ======================================== */

.wis-modal-nav,.wis-modal-close,#wisStoryDelete {
  padding: 0 !important;
  background: transparent !important;
}
.wis-modal-nav path {
  fill: #fff;
}
.wis-modal-nav svg {
  width: 40px;
  height: 40px;
}
#wisStoryDelete svg {
  fill: #fff;
	  width: 40px;
  height: 40px;
}

.wis-stories-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 20px 0;
    padding: 0 15px;
    overflow: hidden;
}
.wis-story-avatar img {
  width: 64px !important;
  height: 64px;
  object-fit: cover;
}
.wis-stories-container {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* پنهان کردن scrollbar */
.wis-stories-container::-webkit-scrollbar {
    height: 4px;
}

.wis-stories-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.wis-stories-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.wis-stories-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* آیتم استوری */
.wis-story-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 80px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.wis-story-item:hover {
    transform: scale(1.05);
}

.wis-story-avatar {
    position: relative;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* استوری دیده‌نشده (حلقه رنگی مثل اینستاگرام) */
.wis-story-item.wis-unseen .wis-story-avatar {
    background: conic-gradient(
        #feda75,
        #fa7e1e,
        #d62976,
        #962fbf,
        #4f5bd5,
        #feda75
    );
}

/* استوری دیده شده */
.wis-story-item.wis-seen .wis-story-avatar {
    background: #dbdbdb;
}

/* استوری خود کاربر */
.wis-upload-story .wis-story-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.wis-story-avatar img {
width: 100% !important;
  height: 100% !important;
  border-radius: 50% !important;
  object-fit: cover;
  border: 3px solid #fff !important;
}

/* آیکون آپلود */
.wis-upload-icon {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 24px;
    height: 24px;
    background: #0095f6;
    border-radius: 50%;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

/* Badge "شما" */
.wis-own-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #0095f6;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
}

/* نام کاربر */
.wis-story-username {
    font-size: 12px;
    color: #262626;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

/* تعداد استوری */
.wis-story-count {
    position: absolute;
    top: -5px;
    left: -5px;
    background: #ff3366;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid #fff;
}

/* پیام "استوری وجود ندارد" */
.wis-no-stories {
    width: 100%;
    text-align: center;
    padding: 10px 20px;
    color: #8e8e8e;
}

/* ========================================
   2. مودال آپلود
   ======================================== */

.wis-upload-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: wisFadeIn 0.3s ease;
}

@keyframes wisFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.wis-upload-modal-content {
    background: #fff;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    position: relative;
    animation: wisSlideUp 0.3s ease;
}

@keyframes wisSlideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.wis-close-upload {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 30px;
    color: #8e8e8e;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.wis-close-upload:hover {
    color: #262626;
}

.wis-upload-modal-content h2 {
    margin: 0 0 20px 0;
    font-size: 24px;
    color: #262626;
    text-align: center;
}

/* پیش‌نمایش تصویر */
.wis-image-preview {
    width: 100%;
    max-height: 400px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.wis-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* انتخاب فایل */
.wis-file-input-wrapper {
    margin-bottom: 20px;
}

.wis-file-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px;
    border: 2px dashed #dbdbdb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.wis-file-label:hover {
    border-color: #0095f6;
    background: #f7f9fc;
}

.wis-file-label svg {
    color: #0095f6;
}

.wis-file-label span {
    font-size: 16px;
    font-weight: 600;
    color: #262626;
}

.wis-file-label small {
    font-size: 12px;
    color: #8e8e8e;
}

#wisStoryImage {
    display: none;
}

/* محدودیت روزانه */
.wis-daily-limit-info {
    text-align: center;
    margin-bottom: 15px;
    padding: 10px;
    background: #f7f9fc;
    border-radius: 6px;
}

.wis-daily-limit-info small {
    color: #8e8e8e;
}

.wis-daily-limit-info strong {
    color: #0095f6;
}

/* دکمه‌های عملیات */
.wis-upload-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.wis-btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.wis-btn-primary {
    background: #0095f6;
    color: #fff;
}

.wis-btn-primary:hover {
    background: #0081d6;
}

.wis-btn-primary:disabled {
    background: transparent;
	color:var( --e-global-color-primary );
    cursor: not-allowed;
}

.wis-btn-secondary {
    background: #efefef;
    color: #262626;
}

.wis-btn-secondary:hover {
    background: #dbdbdb;
}

/* اسپینر */
.wis-spinner {
    animation: wisRotate 1s linear infinite;
}

@keyframes wisRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* پیام آپلود */
.wis-upload-message {
    padding: 12px;
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
}

.wis-upload-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.wis-upload-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ========================================
   3. مودال نمایش استوری (تمام صفحه)
   ======================================== */

.wis-story-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999999999999999999999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: wisFadeIn 0.3s ease;
}

/* دکمه بستن */
.wis-modal-close {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #fff;
    transition: all 0.3s;
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wis-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* دکمه‌های ناوبری */
.wis-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #fff;
    transition: all 0.3s;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wis-modal-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.wis-nav-prev {
    left: 20px;
}

.wis-nav-next {
    right: 20px;
}

/* محتوای استوری */
.wis-story-content {
    position: relative;
    width: 100%;
    max-width: 500px;
    height: 90vh;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Progress Bars */
.wis-story-progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    gap: 4px;
    padding: 10px;
    z-index: 10;
}

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

.wis-progress-fill {
    width: 0;
    height: 100%;
    background: #fff;
    transition: none;
    will-change: width;
}

.wis-progress-bar.active .wis-progress-fill {
    animation: wisProgressFill 5s linear forwards;
}

@keyframes wisProgressFill {
    from { width: 0; }
    to { width: 100%; }
}

.wis-progress-bar.completed .wis-progress-fill {
    width: 100%;
}

/* هدر استوری */
.wis-story-header {
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
}

.wis-story-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wis-story-avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #fff;
    object-fit: cover;
}

.wis-story-user-details {
    display: flex;
    flex-direction: column;
}

.wis-story-username-text {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.wis-story-time {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* دکمه حذف */
.wis-story-delete {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #fff;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wis-story-delete:hover {
    background: rgba(255, 51, 102, 0.8);
}

/* تصویر استوری */
.wis-story-image-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.wis-story-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* لودینگ */
.wis-story-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
}

/* فوتر استوری */
.wis-story-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 100%);
    z-index: 10;
}

/* دکمه لایک */
.wis-like-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    cursor: pointer;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.wis-like-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.wis-like-btn.liked,
.wis-like-btn.wis-liked {
    background: rgba(255, 51, 102, 0.8);
}

.wis-like-btn.liked .wis-like-icon{
    fill: #fff;
    animation: wisHeartBeat 0.5s ease;
}
.wis-like-btn.wis-liked .wis-like-icon {
    fill: red !important;
	stroke:red !important;
   
}

@keyframes wisHeartBeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(0.9); }
    75% { transform: scale(1.1); }
}
/* بازدیدها */
.wis-story-views {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    font-size: 14px;
    margin-left: auto;
}

/* ========================================
   4. Responsive Design
   ======================================== */

@media (max-width: 768px) {
    .wis-stories-wrapper {
        padding: 0 10px;
    }
    
    .wis-story-item {
        min-width: 70px;
    }
    
    .wis-story-avatar {
        width: 60px;
        height: 60px;
    }
    
    .wis-story-content {
        max-width: 100%;
        height: 100vh;
        border-radius: 0;
    }
    
    .wis-modal-nav {
        display: none;
    }
    
    .wis-upload-modal-content {
        width: 95%;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .wis-story-avatar {
        width: 56px;
        height: 56px;
    }
    
    .wis-story-username {
        font-size: 11px;
    }
}