/* Simple, Modern and Clean Dashboard */

.sac-dashboard {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #ffffff;
}

.sac-dashboard-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.sac-dashboard-header h2 {
    font-size: 26px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #1a1a1a;
}

.sac-dashboard-header p {
    font-size: 15px;
    margin: 0;
    color: #666;
}

/* HIGH PRIORITY - Referral Actions (No background) */
.sac-referral-block-card {
    border: 2px solid #16a34a;
    border-radius: 8px;
    padding: 25px;
    margin: 25px 0;
}

.sac-referral-block-card h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #16a34a;
    text-align: center;
}

.sac-referral-link-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

.sac-referral-link-container input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    color: #1a1a1a;
    font-size: 14px;
    font-family: monospace;
}

.sac-copy-button {
    padding: 12px 18px;
    background: #16a34a;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.sac-copy-button:hover {
    background: #15803d;
}

.sac-share-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.sac-share-icon {
    width: 40px;
    height: 40px;
    font-size: 16px;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sac-share-icon.whatsapp {
    background: #25d366;
}

.sac-share-icon.sms {
    background: #1da1f2;
}

.sac-qr-wrap {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    display: inline-block;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.sac-qr-wrap canvas {
    background: white;
    border-radius: 4px;
    padding: 5px;
}

/* MEDIUM PRIORITY - Stats (Blue accent) */
.sac-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.sac-stat-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #3b82f6;
    border-radius: 6px;
    padding: 20px;
    text-align: center;
}

.sac-stat-card h3 {
    margin: 0 0 10px 0;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sac-code-display, .sac-price-display {
    font-size: 22px;
    font-weight: 700;
    margin: 5px 0 0 0;
    color: #1a1a1a;
}

/* Green color for store credit */
.sac-stat-card:nth-child(2) .sac-price-display {
    color: #16a34a;
}

/* Progress bar for Total Referrals card */
.sac-progress-container {
    margin-top: 12px;
}

.sac-progress-bar {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.sac-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.sac-progress-text {
    font-size: 11px;
    color: #666;
    text-align: center;
    font-weight: 500;
}

/* Store Credit Form Styling */
.sac-store-credit-form {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.sac-store-credit-form h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 15px 0;
}

.sac-credit-apply-form {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 15px;
}

.sac-credit-apply-form input[type="number"] {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    min-width: 120px;
}

.sac-credit-apply-form input[type="number"]:focus {
    outline: none;
    border-color: #3b82f6;
}

#sac_apply_credit_button {
    padding: 12px 18px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
    position: relative;
}

#sac_apply_credit_button:hover {
    background: #2563eb;
}

#sac_apply_credit_button.loading .button-text {
    visibility: hidden;
}

#sac_apply_credit_button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    margin-left: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: creditSpin 1s linear infinite;
}

@keyframes creditSpin {
    to {
        transform: rotate(360deg);
    }
}

#sac-credit-messages {
    margin-top: 10px;
}

#sac-credit-messages .woocommerce-message,
#sac-credit-messages .woocommerce-error {
    padding: 10px 15px;
    border-radius: 4px;
    margin: 5px 0;
}

#sac-credit-messages .woocommerce-message {
    background: #e6f7ea;
    border: 1px solid #b2e2c2;
    color: #217a3c;
}

#sac-credit-messages .woocommerce-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

/* LOW PRIORITY - Commission History (Neutral) */
.sac-section {
    margin-top: 30px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 25px;
}

.sac-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 20px 0;
}

.sac-commissions-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.sac-commissions-table th {
    background: #f8f9fa;
    padding: 12px 15px;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
}

.sac-commissions-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f1f5f9;
    color: #333;
    font-size: 14px;
}

.sac-commissions-table tr:last-child td {
    border-bottom: none;
}

.sac-commissions-table td[colspan="4"] {
    text-align: center;
    color: #999;
    padding: 30px 15px;
}

/* Toast */
.sac-toast {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    background: #16a34a;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
}

/* Mobile */
@media (max-width: 768px) {
    .sac-dashboard {
        padding: 15px;
        margin: 10px;
    }
    
    .sac-dashboard-header {
        padding: 20px 15px;
    }
    
    .sac-stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .sac-referral-block-card {
        padding: 20px 15px;
    }
    
    .sac-referral-link-container {
        flex-direction: column;
        gap: 10px;
    }
    
    /* Keep social icons inline on mobile */
    .sac-share-container {
        flex-direction: row;
        justify-content: center;
        gap: 10px;
    }
    
    .sac-section {
        padding: 20px 15px;
    }
    
    .sac-commissions-table th,
    .sac-commissions-table td {
        padding: 10px 8px;
        font-size: 12px;
    }
    
    .sac-toast {
        top: 10px;
        right: 10px;
        left: 10px;
    }
} 