/* Styles for the NutriQR Customer Dashboard */
.nutriqr-dashboard-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    padding: 2rem 1rem;
    max-width: 800px;
    margin: 2rem auto;
}

.nutriqr-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.nutriqr-points-display {
    background-color: #f0f7ff;
    border: 2px solid #cfe5ff;
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
}

.nutriqr-points-display.discount {
    background-color: #e8f5e9;
    border-color: #c8e6c9;
}

.nutriqr-points-display.discount span {
    color: #2e7d32;
    font-size: clamp(1.5rem, 6vw, 2.5rem);
    word-break: break-all;
}

.nutriqr-points-display.discount p {
    color: #388e3c;
}

.nutriqr-points-display p {
    margin: 0 0 0.5rem 0;
    font-weight: 600;
    color: #032b5a;
    font-size: 1.1rem;
}

.nutriqr-points-display span {
    font-size: 2.5rem;
    font-weight: 700;
    color: #0056b3;
}

#nutriqr-redeem-container {
    margin: 0 auto 2rem auto;
    text-align: center;
}

#nutriqr-redeem-btn {
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
    max-width: 300px;
}

.nutriqr-scan-history,
.nutriqr-redemption-history {
    list-style: none;
    padding: 0;
    margin-top: 2.5rem;
    text-align: left;
}

.nutriqr-history-section h4 {
    font-size: 1.5rem;
    color: #333;
    border-bottom: 2px solid #eee;
    padding-bottom: 0.5rem;
    margin: 2.5rem 0 1rem 0;
}

.nutriqr-scan-history li,
.nutriqr-redemption-history li {
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    border-left: 4px solid #007bff;
    overflow: hidden;
}

.nutriqr-scan-duplicate-label {
    font-weight: bold;
    color: #dc3545;
    margin-left: 10px;
    font-size: 0.9em;
}

.nutriqr-scan-history li strong,
.nutriqr-redemption-history li strong {
    color: #333;
}

.nutriqr-scan-history li small,
.nutriqr-redemption-history li small {
    color: #6c757d;
    display: block;
    margin-top: 5px;
}

.nutriqr-redemption-history li {
    border-left-color: #28a745;
    padding: 1rem;
}

.nutriqr-card .nutriqr-resend-container {
    border-top: 1px solid #eee;
    padding-top: 1.5rem;
    margin-top: 2rem;
}

.nutriqr-points-display.stats { 
    background-color: #f8f9fa; 
    border-color: #dee2e6; 
}
.nutriqr-points-display.stats span { 
    font-size: 1.5rem; 
    color: #495057; 
    word-break: break-word;
}
.nutriqr-points-display.stats p { 
    font-size: 1rem; 
    color: #6c757d; 
    margin-bottom: 0.8rem;
    line-height: 1.5;
}

.nutriqr-gamification-section { 
    margin-bottom: 2.5rem; 
}
.nutriqr-gamification-section h4 {
    font-size: 1.5rem;
    color: #333;
    text-align: center;
    margin-bottom: 1.5rem;
}
.nutriqr-achievements-container { 
    display: flex; 
    gap: 1rem; 
    justify-content: center; 
    flex-wrap: wrap; 
    margin-top: 1rem; 
}
.nutriqr-achievement-badge { 
    background-color: #e9ecef; 
    border: 1px solid #dee2e6; 
    border-radius: 20px; 
    padding: 0.5rem 1rem; 
    font-size: 0.9rem; 
    font-weight: 600; 
    color: #495057; 
}
.nutriqr-progress-bar-container { 
    margin-top: 1.5rem; 
}
.nutriqr-progress-bar-container p { 
    text-align: center; 
    margin: 0 0 0.5rem 0; 
    font-weight: 600; 
    color: #333; 
}
.nutriqr-progress-bar { 
    width: 100%; 
    height: 20px; 
    background-color: #e9ecef; 
    border-radius: 10px; 
    overflow: hidden; 
}
.nutriqr-progress-bar-fill { 
    height: 100%; 
    width: 0%; 
    background-color: #007bff; 
    border-radius: 10px; 
    transition: width 0.5s ease-in-out; 
}

#scan-map-container { 
    margin-bottom: 2.5rem; 
}
#scan-map-container h4 {
    font-size: 1.5rem;
    color: #333;
    text-align: center;
    margin-bottom: 1rem;
}
#scan-map { 
    height: 350px; 
    width: 100%; 
    border-radius: 0.75rem; 
    border: 1px solid #ddd; 
}

.nutriqr-scan-history summary { 
    padding: 1rem; 
    cursor: pointer; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}
.nutriqr-scan-history summary::after { 
    content: '▼'; 
    font-size: 0.8em;
    color: #6c757d;
    transition: transform 0.2s;
}
details[open] > summary::after { 
    transform: rotate(-180deg);
}

.nutriqr-scan-details { 
    padding: 0 1rem 1rem 1rem; 
    background-color: #fff; 
    border-top: 1px solid #eee; 
}
.nutriqr-scan-details-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); 
    gap: 0.5rem 1.5rem; 
    padding-top: 1rem;
}
.nutriqr-scan-details p { 
    margin: 0.1rem 0;
    font-size: 0.9rem; 
    color: #495057;
    padding-bottom: 0.2rem;
    border-bottom: 1px solid #e0e0e0;
}
.nutriqr-scan-details p strong { 
    color: #212529; 
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    margin-bottom: 2px;
}
.nutriqr-scan-details a { 
    color: #007bff; 
    text-decoration: none; 
}
.nutriqr-scan-details a:hover { 
    text-decoration: underline; 
}

.nutriqr-history-instruction {
    font-size: 0.9em;
    color: #6c757d;
    text-align: center;
    margin: -0.5rem 0 1rem 0;
}

/* Filter and Claim Button */
.nutriqr-filter-bar.vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.nutriqr-filter-bar.vertical .date-inputs {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 250px;
}

.nutriqr-filter-bar.vertical label {
    font-weight: 600;
    font-size: 0.9em;
    color: #495057;
}

.nutriqr-filter-bar.vertical input[type="date"] {
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

#nutriqr-claim-container {
    margin: 1.5rem auto 2.5rem auto;
    text-align: center;
}

.nutriqr-refresh-container {
    margin-bottom: 1.5rem;
    text-align: center;
}

.nutriqr-refresh-container .nutriqr-btn {
    width: auto;
    padding: 0.6rem 1.5rem;
    font-size: 1rem;
}

/* NEW FEATURE: Styles for the referral hub on the dashboard. */
.nutriqr-referral-hub {
    background-color: #f0f7ff;
    border: 1px solid #cfe5ff;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2.5rem 0;
    text-align: center;
}
.nutriqr-referral-hub h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    color: #032b5a;
}
.nutriqr-referral-hub p {
    margin: 0 auto 1.5rem auto;
    color: #666;
    max-width: 400px;
}
.nutriqr-referral-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 1.5rem 0;
    font-size: 1rem;
    color: #495057;
}
.nutriqr-referral-stats strong {
    color: #0056b3;
}

/* --- NEW STYLES FOR REFERRAL PERFORMANCE SECTION --- */
.nutriqr-referral-performance {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px dashed #cfe5ff;
}
.nutriqr-referral-performance h4 {
    font-size: 1.2rem;
    color: #032b5a;
    margin-bottom: 0;
}
.nutriqr-referee-products-list {
    margin-top: 1.5rem;
    text-align: left;
}
.nutriqr-referee-products-list h5 {
    font-size: 1rem;
    color: #333;
    margin: 0 0 0.5rem 0;
}
.nutriqr-referee-products-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.nutriqr-referee-products-list li {
    background-color: #fff;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    border: 1px solid #e9ecef;
}
.nutriqr-referee-products-list li strong {
    display: block;
    color: #212529;
}
.nutriqr-referee-products-list li small {
    color: #6c757d;
    font-size: 0.9em;
}
/* --- END NEW STYLES --- */