/* استایل‌های کلی */
.cfs-projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    padding: 20px 0;
}
.cfs-projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    padding: 20px 0;
}
.cfs-project-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e9ecef;
    position: relative;
}

.cfs-project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.cfs-project-image {
    height: 200px;
    overflow: hidden;
    position: relative;
}

.cfs-project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.cfs-project-card:hover .cfs-project-image img {
    transform: scale(1.05);
}

.cfs-placeholder-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    font-weight: 500;
}

/* بج سبز برای نمایش تعداد سهام */
.cfs-share-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
    background: #458107;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    font-weight: bold;
    z-index: 2;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.cfs-share-badge.show {
    opacity: 1;
}

.cfs-project-content {
    padding: 20px;
    text-align: center;
}

.cfs-project-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
    line-height: 1.4;
}

/* نوار پیشرفت با انیمیشن از راست به چپ */
.cfs-progress-container {
    margin-bottom: 20px;
}

.cfs-progress-bar {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
    position: relative;
}

.cfs-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #7CB342 0%, #137b00 100%);
    border-radius: 6px;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

.cfs-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: -30px;
    width: 30px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
    animation: progressWave 2s infinite;
    transform: skewX(-20deg);
}

@keyframes progressWave {
    0% { right: -30px; }
    100% { right: 100%; }
}

.cfs-progress-text {
    font-size: 12px;
    color: #666;
    text-align: right;
    margin-bottom: 15px;
}

/* آمار پروژه */
.cfs-project-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 0 10px;
	background-color: #f5f5f5;
    border-radius: 9px;
    padding-top: 15px;
    padding-bottom: 9px;
}

.cfs-stat {
    text-align: center;
    flex: 1;
	
}

.cfs-stat-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

.cfs-stat-remaining {
    color: #e74c3c;
}

.cfs-stat-total {
    color: #2c3e50;
}

.cfs-stat-label {
    font-size: 12px;
    color: #666;
    font-weight: 400;
}

/* دکمه‌های اکشن */
.cfs-project-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    height: 55px;
}

.cfs-participate-btn {
    flex: 1;
    background: linear-gradient(135deg, #69c309 0%, #137b00 100%);
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 12px;
    font-size: 19px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 55px;
}

.cfs-participate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(124, 179, 66, 0.3);
}

.cfs-participate-btn:active {
    transform: translateY(0);
}

.cfs-minus-btn {
    width: 55px;
    height: 55px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cfs-minus-btn:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.cfs-project-price {
    font-size: 14px;
    color: #666;
    text-align: center;
    font-weight: 400;
    margin-top: 15px;
}

.cfs-project-disabled {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    color: #6c757d;
    font-style: italic;
}

/* نوار مشارکت شناور - سفید و عرض متناسب با محتوا */
.cfs-cart-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: white;
    color: #2c3e50;
    padding: 15px 25px;
    border-radius: 25px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    z-index: 1000;
    opacity: 0;
    transition: all 0.4s ease;
    border: 1px solid #e9ecef;
    width: auto;
    max-width: 90vw;
}

.cfs-cart-bar.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.cfs-cart-content {
    display: flex;
    align-items: center;
    gap: 20px;
    white-space: nowrap;
}

.cfs-cart-info {
    font-weight: 600;
    font-size: 14px;
    color: #666;
}

.cfs-cart-total {
    font-weight: 700;
    font-size: 16px;
    color: #2c3e50;
}

/* انیمیشن اعداد در نوار شناور */
.cfs-animated-number {
    display: inline-block;
    transition: all 0.3s ease;
}

.cfs-animated-number.updating {
    animation: numberPulse 0.4s ease;
}

@keyframes numberPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); color: #7CB342; }
}

.cfs-checkout-btn {
    background: linear-gradient(135deg, #69c309 0%, #137b00 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-size: 14px;
}

.cfs-checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40,167,69,0.3);
}

/* پروژه تکی */
.cfs-single-project {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.cfs-single-project-stats {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.cfs-quick-amounts {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.cfs-quick-amount {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    color: #495057;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
}

.cfs-quick-amount:hover,
.cfs-quick-amount.active {
    background: #007bff;
    border-color: #007bff;
    color: white;
    transform: translateY(-2px);
}

.cfs-max-shares {
    text-align: center;
    font-size: 12px;
    color: #6c757d;
    margin-top: 10px;
}

/* ریسپانسیو */
@media (max-width: 768px) {
    .cfs-projects-grid {
        grid-template-columns: 1fr;
        padding: 10px;
    }

    .cfs-cart-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .cfs-cart-bar {
        left: 10px;
        right: 10px;
        padding: 12px 15px;
        transform: translateX(0) translateY(100px);
        max-width: none;
        width: calc(100% - 20px);
    }

    .cfs-cart-bar.show {
        transform: translateX(0) translateY(0);
    }
}

/* استایل‌های پیام‌های سیستم */
.cfs-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 10px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    max-width: 300px;
    font-size: 14px;
}

.cfs-message.show {
    transform: translateX(0);
    opacity: 1;
}

.cfs-message-success {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.cfs-message-error {
    background: linear-gradient(135deg, #dc3545, #e74c3c);
}

.cfs-message-warning {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    color: #212529;
}

.cfs-message-info {
    background: linear-gradient(135deg, #17a2b8, #007bff);
}

/* انیمیشن برای تغییر اعداد سهام */
.cfs-stat-remaining.updating,
.cfs-remaining-shares.updating {
    animation: shareCountUpdate 0.4s ease;
    background: linear-gradient(90deg, transparent, rgba(231, 76, 60, 0.1), transparent);
    border-radius: 5px;
    padding: 2px 5px;
}

@keyframes shareCountUpdate {
    0% { 
        transform: scale(1);
        background-color: transparent;
    }
    50% { 
        transform: scale(1.1);
        background-color: rgba(231, 76, 60, 0.15);
        color: #e74c3c;
    }
    100% { 
        transform: scale(1);
        background-color: transparent;
    }
}

/* استایل بهبود یافته برای input سهام */
.cfs-share-input[type="number"] {
    width: 80px;
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.2s ease;
}

.cfs-share-input[type="number"]:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    outline: none;
}

/* کنترل‌های سهام در صفحه تکی */
.cfs-share-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.cfs-share-minus,
.cfs-share-plus {
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cfs-share-minus {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.cfs-share-minus:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

.cfs-share-plus {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.cfs-share-plus:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

/* بهبود badge سهام */
.cfs-share-badge {
    animation: badgeShow 0.3s ease when .show class is added;
}

@keyframes badgeShow {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* حالت غیرفعال برای دکمه‌هایی که سهام کافی ندارند */
.cfs-participate-btn:disabled,
.cfs-share-plus:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.cfs-participate-btn:disabled:hover,
.cfs-share-plus:disabled:hover {
    background: #6c757d;
    transform: none;
    box-shadow: none;
}

/* نمایش تعداد سهام در دسترس */
.cfs-available-shares {
    font-size: 12px;
    color: #28a745;
    text-align: center;
    margin-top: 5px;
    font-weight: 500;
}

.cfs-available-shares.low-stock {
    color: #ffc107;
}

.cfs-available-shares.out-of-stock {
    color: #dc3545;
}

/* ریسپانسیو برای پیام‌ها */
@media (max-width: 768px) {
    .cfs-message {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100px);
    }

    .cfs-message.show {
        transform: translateY(0);
    }

    .cfs-share-controls {
        gap: 10px;
    }

    .cfs-share-minus,
    .cfs-share-plus {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

/* انیمیشن لودینگ برای بروزرسانی سبد خرید */
.cfs-cart-updating {
    position: relative;
    overflow: hidden;
}

.cfs-cart-updating::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: cartLoading 1s infinite;
}

@keyframes cartLoading {
    0% { left: -100%; }
    100% { left: 100%; }
}