/* =============================================
   General Styles
   ============================================= */
.saved-posts-notice {
    padding: 15px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    text-align: center;
    margin-bottom: 20px;
}

.notice {
    padding: 12px 20px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease-out;
    max-width: 350px;
}

.notice-success {
    background: #4CAF50;
    color: white;
    border-left: 4px solid #388E3C;
}

.notice-error {
    background: #F44336;
    color: white;
    border-left: 4px solid #D32F2F;
}

.notice-info {
    background: #2196F3;
    color: white;
    border-left: 4px solid #1976D2;
}

.notice.is-dismissible {
    position: relative;
    padding-right: 38px;
}

.notice-dismiss {
    position: absolute;
    top: 0;
    right: 1px;
    padding: 10px;
    color: white;
    text-decoration: none;
}

.notice-dismiss:hover {
    color: white;
    opacity: 0.8;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* =============================================
   Layout Styles
   ============================================= */
.saved-posts-container {
    margin: 0 auto;
    width: 100%;
}

.saved-posts-list {
    display: grid;
    gap: 20px;
}

/* Default Grid Layout */
.saved-posts-layout-grid .saved-posts-list {
    grid-template-columns: repeat(var(--grid-columns, 3), 1fr);
}

/* List Layout */
.saved-posts-layout-list .saved-posts-list {
    grid-template-columns: 1fr;
}

.saved-posts-layout-list .saved-post-item {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
}

/* =============================================
   Item Styles
   ============================================= */
.saved-post-item {
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    background-color: #fff;
}

.saved-post-item:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-3px);
}

/* =============================================
   Thumbnail Styles
   ============================================= */
.saved-post-thumbnail {
    margin-bottom: 15px;
    overflow: hidden;
    border-radius: 4px;
}

.saved-post-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
    object-fit: cover;
}

.saved-post-item:hover .saved-post-thumbnail img {
    transform: scale(1.03);
}

/* =============================================
   Content Styles
   ============================================= */
.saved-post-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.saved-post-title {
    margin: 0 0 10px;
    font-size: 18px;
    line-height: 1.4;
    color: #333;
}

.saved-post-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.saved-post-title a:hover {
    color: #0073aa;
}

.saved-post-excerpt {
    color: #666;
    margin: 0 0 15px;
    font-size: 14px;
    line-height: 1.6;
    flex: 1;
}

/* =============================================
   Button Styles
   ============================================= */
   
   /* Save Button Styles */
.elementor-save-post-button-wrapper {
    display: inline-block;
}

.save-post-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    border: none;
    transition: all 0.3s ease;
    padding: 12px 24px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Save Button Loading Styles */
.save-post-button {
    position: relative;
}

.save-post-button.loading {
    position: relative; /* تضمین می‌کند اسپینر داخل دکمه قرار می‌گیرد */
    pointer-events: none; /* غیرفعال کردن کلیک هنگام لودینگ */
    background:#336AEA !important;
    
}

.save-post-button.loading .elementor-button-text {
    opacity: 0; /* بهتر از `visibility: hidden` است چون انیمیشن پذیر است */
}

.save-post-button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px; /* جایگزین بهتر برای transform: translate */
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    box-sizing: border-box;
    z-index: 1; /* مطمئن شوید اسپینر بالای سایر عناصر است */
}

   
   
.remove-saved-post {
    background-color: #f44336;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: flex-start;
    font-size: 14px;
    position: relative;
}

.remove-saved-post:hover {
    background-color: #d32f2f;
    transform: translateY(-2px);
}

.remove-saved-post.loading {
    color: transparent !important;
    pointer-events: none;
}

.remove-saved-post.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    box-sizing: border-box;
}

/* حالت عادی */
.saved-post-button-position-static .saved-post-item .remove-saved-post {
    position: relative;
}

/* حالت مطلق */
.saved-post-button-position-absolute .saved-post-item {
    position: relative;
}

.saved-post-button-position-absolute .saved-post-item .remove-saved-post {
    position: absolute;
    margin: 0 !important;
}

/* =============================================
   Pagination Styles
   ============================================= */
.saved-posts-pagination {
    margin-top: 30px;
    text-align: center;
}

.saved-posts-pagination a,
.saved-posts-pagination span {
    display: inline-block;
    padding: 5px 12px;
    margin-right: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.saved-posts-pagination a:hover {
    background-color: #f5f5f5;
}

.saved-posts-pagination span.current {
    background-color: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

/* =============================================
   Responsive Styles
   ============================================= */
@media (max-width: 1024px) {
    .saved-posts-layout-grid .saved-posts-list {
        grid-template-columns: repeat(var(--grid-columns-tablet, 2), 1fr);
    }
    
    .saved-posts-layout-list .saved-post-item {
        flex-direction: row;
    }
}

@media (max-width: 768px) {
    .saved-posts-layout-grid .saved-posts-list {
        grid-template-columns: repeat(var(--grid-columns-mobile, 1), 1fr);
    }
    
    .saved-posts-layout-list .saved-post-item {
        flex-direction: column;
    }
    
    .saved-posts-layout-list .saved-post-thumbnail {
        margin-right: 0;
        margin-bottom: 15px;
    }
}

/* =============================================
   Animations
   ============================================= */
/* اسپینر لودینگ */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}