/* ====================================
   Manus Rewards Hub - CSS
   ==================================== */

/* الأيقونة العائمة */
.rewards-trigger {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e72 100%);
    border: none;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
    transition: all 0.3s ease;
    z-index: 9997;
    animation: rewardsPulse 2s infinite;
}

.rewards-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 35px rgba(255, 107, 107, 0.6);
}

@keyframes rewardsPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 12px 35px rgba(255, 107, 107, 0.6);
    }
}

/* لوحة الجوائز */
.rewards-panel {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 400px;
    max-height: 600px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    z-index: 9996;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
}

.rewards-panel-closed {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    pointer-events: none;
}

.rewards-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* رأس اللوحة */
.rewards-header {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e72 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rewards-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

#close-rewards {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

#close-rewards:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* محتوى الجوائز */
.rewards-content {
    padding: 20px;
    max-height: 500px;
    overflow-y: auto;
}

/* بطاقة السحب */
.raffle-card {
    background: white;
    border: 2px solid #f0f0f0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.raffle-card:hover {
    border-color: #ff6b6b;
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.15);
    transform: translateY(-4px);
}

/* صورة الجائزة */
.raffle-image {
    width: 100%;
    height: 120px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.raffle-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* عنوان الجائزة */
.raffle-title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}

/* شريط التقدم */
.raffle-progress-container {
    margin-bottom: 12px;
}

.raffle-progress-bar {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
}

.raffle-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b 0%, #ff8e72 100%);
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

.raffle-progress-text {
    font-size: 12px;
    color: #666;
    display: flex;
    justify-content: space-between;
}

.raffle-progress-text .percentage {
    color: #ff6b6b;
    font-weight: 700;
}

/* شارة النار */
.fire-badge {
    display: inline-block;
    font-size: 14px;
    margin-left: 8px;
    animation: fireBounce 0.6s ease infinite;
}

@keyframes fireBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* زر الشراء */
.raffle-buy-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e72 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.raffle-buy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.4);
}

.raffle-buy-btn:active {
    transform: translateY(0);
}

.raffle-buy-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

/* صفحة الجوائز الكاملة */
.manus-rewards-page {
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.manus-rewards-page h1 {
    text-align: center;
    color: #333;
    margin-bottom: 10px;
    font-size: 2.5rem;
}

.subtitle {
    text-align: center;
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 40px;
}

/* شبكة السحوبات */
.rewards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

/* بطاقة السحب الكبيرة */
.raffle-card-large {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.raffle-card-large:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
}

.raffle-card-large-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.raffle-card-large-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* شارة الخصم */
.discount-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #ff6b6b;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

/* محتوى البطاقة */
.raffle-card-content {
    padding: 20px;
}

.raffle-card-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}

.raffle-card-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 16px;
    line-height: 1.5;
}

.raffle-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.stat-item {
    text-align: center;
}

.stat-label {
    font-size: 12px;
    color: #999;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #ff6b6b;
}

/* مدخل الكمية */
.quantity-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.quantity-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.quantity-btn:hover {
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.quantity-input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
}

/* لوحة الشرف */
.leaderboard {
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    border-radius: 12px;
    padding: 20px;
    margin-top: 40px;
}

.leaderboard h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

.winner-item {
    background: white;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.winner-rank {
    font-size: 20px;
    font-weight: 700;
    color: #ff6b6b;
    min-width: 30px;
}

.winner-info {
    flex: 1;
}

.winner-name {
    font-weight: 600;
    color: #333;
}

.winner-prize {
    font-size: 12px;
    color: #666;
}

/* محمل التحميل */
.loading-spinner {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.loading-spinner::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ff6b6b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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

/* الوضع الليلي */
body.dark-mode .rewards-panel {
    background: #2a2a2a;
    color: #e0e0e0;
}

body.dark-mode .raffle-card {
    background: #333;
    border-color: #444;
}

body.dark-mode .raffle-title,
body.dark-mode .raffle-card-title {
    color: #f0f0f0;
}

body.dark-mode .raffle-progress-text {
    color: #aaa;
}

body.dark-mode .rewards-grid {
    background: transparent;
}

body.dark-mode .raffle-card-large {
    background: #2a2a2a;
}

body.dark-mode .raffle-card-content {
    background: #2a2a2a;
}

body.dark-mode .raffle-card-description {
    color: #aaa;
}

body.dark-mode .raffle-stats {
    border-bottom-color: #444;
}

body.dark-mode .stat-label {
    color: #888;
}

body.dark-mode .quantity-input,
body.dark-mode .quantity-btn {
    background: #333;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode .leaderboard {
    background: #333;
}

body.dark-mode .winner-item {
    background: #2a2a2a;
}

body.dark-mode .winner-name {
    color: #f0f0f0;
}

body.dark-mode .winner-prize {
    color: #aaa;
}

/* استجابة الهاتف */
@media (max-width: 600px) {
    .rewards-panel {
        width: calc(100% - 40px);
        max-height: 80vh;
    }

    .rewards-grid {
        grid-template-columns: 1fr;
    }

    .manus-rewards-page h1 {
        font-size: 1.8rem;
    }

    .raffle-card-large-image {
        height: 150px;
    }
}
