/* ========================================
   Loyalty Rewards Dashboard Styles
   ======================================== */

/* Main Container */
.lemcrm-rewards-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Points Header */
.lemcrm-points-header {
    background: linear-gradient(135deg, #cd5928 0%, #a84621 100%);
    color: #fff;
    padding: 40px 30px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(205, 89, 40, 0.3);
}

.points-display h2 {
    margin: 0 0 15px 0;
    font-size: 1.5rem;
    font-weight: 400;
    opacity: 0.95;
}

.points-value {
    font-size: 4rem;
    font-weight: 700;
    margin: 10px 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.points-subtitle {
    margin: 10px 0 0 0;
    font-size: 1rem;
    opacity: 0.9;
}

/* Filters Section */
.lemcrm-rewards-filters {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.filters-container {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-item {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.filter-search {
    flex: 2;
}

.filter-input,
.filter-select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fff;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: #cd5928;
    box-shadow: 0 0 0 3px rgba(205, 89, 40, 0.1);
}

.filter-search {
    position: relative;
}

.filter-search .search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 18px;
}

.btn-reset-filters {
    padding: 12px 24px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-reset-filters:hover {
    background: #e8e8e8;
}

/* Loading State */
.rewards-loading {
    text-align: center;
    padding: 60px 20px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #cd5928;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.rewards-loading p {
    color: #666;
    font-size: 16px;
}

/* Sections */
.rewards-section,
.coupons-section {
    margin-bottom: 50px;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 25px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 12px;
}

.title-icon {
    font-size: 2rem;
}

/* Rewards Grid */
.rewards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

/* Reward Card */
.reward-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.reward-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.reward-card.locked {
    opacity: 0.7;
}

.reward-card.locked:hover {
    transform: none;
}

.reward-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lock-icon {
    font-size: 4rem;
    opacity: 0.9;
}

.reward-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.reward-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.reward-card:hover .reward-image img {
    transform: scale(1.05);
}

.reward-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.reward-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #333;
    line-height: 1.3;
}

.reward-description {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 0 20px 0;
    flex: 1;
}

.reward-footer {
    border-top: 1px solid #f0f0f0;
    padding-top: 15px;
    margin-top: auto;
}

.reward-points {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.points-label {
    font-size: 0.85rem;
    color: #666;
}

.points-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #cd5928;
}

.points-needed {
    text-align: center;
    padding: 10px;
    background: #fff3cd;
    border-radius: 6px;
    margin-top: 10px;
    font-size: 0.9rem;
    color: #856404;
}

.needed-value {
    font-weight: 700;
    color: #d39e00;
}

.btn-redeem {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #cd5928 0%, #a84621 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(205, 89, 40, 0.3);
}

.btn-redeem:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(205, 89, 40, 0.4);
}

.btn-redeem:active {
    transform: translateY(0);
}

.btn-redeem:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

/* Coupons Grid */
.coupons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

/* Coupon Card */
.coupon-card {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.coupon-card:hover {
    border-color: #cd5928;
    box-shadow: 0 4px 16px rgba(205, 89, 40, 0.15);
}

.coupon-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.coupon-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: #333;
}

.coupon-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.coupon-status.active {
    background: #d4edda;
    color: #155724;
}

.coupon-status.used {
    background: #d1ecf1;
    color: #0c5460;
}

.coupon-status.expired {
    background: #f8d7da;
    color: #721c24;
}

.coupon-code-section {
    margin-bottom: 15px;
}

.coupon-code-section label {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.code-display {
    display: flex;
    gap: 10px;
    align-items: center;
}

.coupon-code {
    flex: 1;
    padding: 12px 15px;
    background: #f8f9fa;
    border: 2px dashed #cd5928;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: #cd5928;
    text-align: center;
    letter-spacing: 2px;
}

.btn-copy-code {
    padding: 12px 16px;
    background: #cd5928;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-copy-code:hover {
    background: #a84621;
}

.copy-icon {
    font-size: 1rem;
}

.coupon-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.detail-label {
    color: #666;
}

.detail-value {
    font-weight: 600;
    color: #333;
}

.discount-value {
    color: #28a745;
}

/* Empty States */
.no-rewards,
.no-coupons {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.no-rewards p,
.no-coupons p {
    font-size: 1.1rem;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .lemcrm-rewards-dashboard {
        padding: 15px;
    }

    .points-value {
        font-size: 3rem;
    }

    .filters-container {
        flex-direction: column;
    }

    .filter-item {
        min-width: 100%;
    }

    .rewards-grid {
        grid-template-columns: 1fr;
    }

    .coupons-grid {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .lemcrm-points-header {
        padding: 30px 20px;
    }

    .points-display h2 {
        font-size: 1.2rem;
    }

    .points-value {
        font-size: 2.5rem;
    }

    .points-subtitle {
        font-size: 0.9rem;
    }

    .reward-name {
        font-size: 1.1rem;
    }

    .coupon-name {
        font-size: 1rem;
    }

    .code-display {
        flex-direction: column;
    }

    .btn-copy-code {
        width: 100%;
        justify-content: center;
    }
}

/* Animation for new elements */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reward-card,
.coupon-card {
    animation: fadeInUp 0.4s ease-out;
}

/* SweetAlert2 Custom Styling */
.swal2-popup {
    border-radius: 12px;
}

.swal2-title {
    color: #333;
    font-weight: 600;
}

.swal2-confirm {
    background: linear-gradient(135deg, #cd5928 0%, #a84621 100%);
    border-radius: 6px;
    padding: 10px 30px;
}

.swal2-cancel {
    border-radius: 6px;
    padding: 10px 30px;
}

