/* auth/rewards-style.css */

:root {
    --primary-gradient: linear-gradient(135deg, #5b3bb0 0%, #4a2f91 100%);
    --gold-gradient: linear-gradient(135deg, #FFD700 0%, #FDB931 100%);
    --glass-bg: rgba(255, 255, 255, 0.95);
    --card-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

/* =================================================================== */
/* --- 1. Hero Stats Section --- */
/* =================================================================== */
.rewards-hero-section {
    background: var(--primary-gradient);
    border-radius: 16px;
    padding: 30px;
    color: white;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    box-shadow: 0 10px 25px rgba(91, 59, 176, 0.25);
    position: relative;
    overflow: hidden;
    gap: 20px;
}

.rewards-hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    pointer-events: none;
}

.hero-content {
    flex: 1 1 300px;
    min-width: 0; /* Fix flexbox overflow */
    z-index: 2;
}

.hero-content h2 {
    margin: 0 0 10px 0;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: normal; 
    line-height: 1.3;
}

.hero-content p {
    margin: 0;
    opacity: 0.9;
    font-size: 1.05rem;
    line-height: 1.5;
}

.stats-cards {
    display: flex;
    gap: 15px;
    z-index: 2;
}

.stat-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid rgba(255,255,255,0.2);
    min-width: 140px;
    flex: 1;
}

.stat-card .icon-box {
    background: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.stat-label { font-size: 0.85rem; opacity: 0.9; white-space: nowrap; }
.stat-value { font-size: 1.1rem; font-weight: 700; line-height: 1.2; }

/* =================================================================== */
/* --- 2. Navigation Tabs (Text Color Fixes) --- */
/* =================================================================== */
.rewards-tabs-wrapper {
    width: 100%;
    overflow: hidden;
    margin-bottom: 25px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2); /* Semi-transparent border */
}

.rewards-tabs-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding-bottom: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.rewards-tabs-container::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    background: none;
    border: none;
    font-size: 1.05rem;
    font-weight: 600;
    /* FIX: Light transparent color for visibility on purple background */
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 12px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-shrink: 0;
}

.tab-btn:hover {
    color: #ffffff; /* White on hover */
    background-color: rgba(255, 255, 255, 0.1);
}

.tab-btn.active {
    color: #5b3bb0; /* Purple text */
    background-color: #ffffff; /* White background pill */
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    position: relative;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #ffffff;
    border-radius: 3px 3px 0 0;
}

/* =================================================================== */
/* --- 3. Available Rewards Grid (Cards) --- */
/* =================================================================== */
.rewards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.reward-card {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    border: 1px solid #f0f0f0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    /* FIX: Reset text color for white card */
    color: #333;
}

.reward-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(91, 59, 176, 0.15);
}

.reward-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 5px;
    background: var(--primary-gradient);
}

.reward-card h4 {
    margin: 0 0 8px 0;
    font-size: 1.15rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.reward-card .value {
    font-size: 1.6rem;
    font-weight: 800;
    color: #5b3bb0;
    margin-bottom: 12px;
}

.reward-card .description {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 15px;
    flex-grow: 1;
}

/* Progress Section */
.condition {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    border: 1px solid #eee;
    color: #555;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    margin-top: 8px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #5b3bb0, #8e44ad);
    border-radius: 4px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.claim-button {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: none;
    background: var(--primary-gradient);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(91, 59, 176, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.claim-button:hover:not(:disabled) {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(91, 59, 176, 0.4);
}

.claim-button:disabled {
    background: #e0e0e0;
    color: #999;
    box-shadow: none;
    cursor: not-allowed;
}

.claim-button.manual-claim {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.3);
}

/* =================================================================== */
/* --- 4. Wallet/Coupons Grid (Tickets) --- */
/* =================================================================== */
.coupons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.claimed-reward-item {
    background: white;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.05));
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    /* Ticket jagged edges */
    background-image: radial-gradient(circle at 0 50%, transparent 10px, white 11px), radial-gradient(circle at 100% 50%, transparent 10px, white 11px);
    background-size: 51% 100%;
    background-position: 0 0, 100% 0;
    background-repeat: no-repeat;
    padding: 0 12px;
    transition: transform 0.2s ease;
    color: #333;
}

.claimed-reward-item:hover {
    transform: translateY(-3px);
}

.claimed-reward-item::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 12px;
    right: 12px;
    height: 1px;
    border-top: 2px dashed #e9ecef;
    z-index: 1;
}

.claimed-reward-item .ticket-top {
    padding: 20px 15px 10px 15px;
    text-align: center;
    background: white;
    z-index: 2;
}

.claimed-reward-item .ticket-bottom {
    padding: 10px 15px 20px 15px;
    background: white;
    z-index: 2;
    text-align: center;
}

.ticket-title { font-weight: 700; color: #333; font-size: 1.1rem; display: block;}
.ticket-value { color: #28a745; font-weight: 800; font-size: 1.4rem; display: block; margin: 5px 0;}
.ticket-date { color: #999; font-size: 0.8rem; display: block; margin-bottom: 5px;}

.code-container {
    background: #f8f9fa;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    gap: 10px;
}

.code-text {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: #333;
    font-size: 1rem;
    letter-spacing: 1px;
    word-break: break-all;
}

.copy-code-btn {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}
.copy-code-btn:hover { background: #5b3bb0; color: white; border-color: #5b3bb0; }
.copy-code-btn box-icon { width: 18px; height: 18px; fill: currentColor; }

/* =================================================================== */
/* --- 5. Expander/Details Logic --- */
/* =================================================================== */
.reward-info-toggle {
    margin-top: 10px; 
    font-size: 0.9rem; 
    color: #5b3bb0; 
    cursor: pointer;
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 5px;
    padding: 5px;
    user-select: none;
    font-weight: 600;
}

.reward-info-toggle:hover {
    text-decoration: underline;
}

/* DEFAULT STATE: HIDDEN */
.reward-info-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.35s ease-out, opacity 0.3s ease-out, margin 0.3s ease, padding 0.3s ease;
    background-color: #f8f9fa;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #555;
    text-align: right;
    line-height: 1.6;
    padding: 0 15px; 
}

/* EXPANDED STATE: VISIBLE */
.reward-info-content.expanded {
    max-height: 600px;
    opacity: 1;
    margin-top: 10px;
    padding: 15px;
    border: 1px solid #eee;
}

/* =================================================================== */
/* --- 6. Standard Mobile Adjustments (Tablets/Big Phones) --- */
/* =================================================================== */
@media (max-width: 768px) {
    .rewards-hero-section {
        flex-direction: column;
        align-items: stretch;
        padding: 25px 20px;
        text-align: center;
        gap: 15px;
    }

    .hero-content { flex: 0 0 auto; width: 100%; }
    .hero-content h2 { justify-content: center; font-size: 1.6rem; }

    /* Stats cards side-by-side */
    .stats-cards {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-card {
        min-width: 0; 
        padding: 12px;
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }

    .stat-card .icon-box { width: 35px; height: 35px; }
    .stat-card box-icon { width: 20px; height: 20px; }
    .stat-value { font-size: 1.1rem; }

    /* Tabs Alignment */
    .rewards-tabs-container {
        justify-content: flex-start;
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Grid reset to 1 column */
    .rewards-grid, .coupons-grid {
        grid-template-columns: 1fr; 
        gap: 15px;
    }
}

/* =================================================================== */
/* --- 7. ULTRA-SMALL SCREEN FIXES (Phones <= 360px) --- */
/* =================================================================== */
@media (max-width: 360px) {
    
    /* 1. Hero: Stack Everything & Reduce Sizes */
    .rewards-hero-section {
        padding: 20px 15px;
        gap: 15px;
    }
    
    .hero-content h2 {
        font-size: 1.4rem; /* Smaller Title */
        flex-wrap: wrap; /* Allow icon to wrap if needed */
    }
    
    .hero-content p {
        font-size: 0.9rem;
    }

    /* Stack Stats Cards Vertically on tiny screens to prevent overflow */
    .stats-cards {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-card {
        min-width: 0; 
        padding: 12px;
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .stat-value {
        font-size: 1rem;
    }

    /* 2. Cards: Fix Padding */
    .reward-card {
        padding: 15px;
    }
    
    .reward-card h4 {
        font-size: 1.1rem;
    }
    
    .reward-card .value {
        font-size: 1.4rem;
    }

    /* 3. Tabs: Make text smaller */
    .tab-btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
}

/* Shimmer Loader */
.shimmer-loader {
    height: 200px;
    background: #f6f7f8;
    background-image: linear-gradient(to right, #f6f7f8 0%, #edeef1 20%, #f6f7f8 40%, #f6f7f8 100%);
    background-repeat: no-repeat;
    background-size: 800px 200px; 
    animation: placeholderShimmer 1s linear infinite forwards;
    border-radius: 16px;
}
@keyframes placeholderShimmer { 0% { background-position: -468px 0; } 100% { background-position: 468px 0; } }

/* Empty State */
.empty-state {
    text-align: center;
    padding: 30px 15px;
    color: rgba(255, 255, 255, 0.8); /* Changed to light color for visibility */
}
.empty-state box-icon { margin-bottom: 15px; opacity: 0.5; width: 48px; height: 48px; fill: white; }
.empty-state h3 { margin-bottom: 8px; color: white; font-size: 1.1rem; }
.empty-state p { font-size: 0.9rem; }
