/*
 * Frontend styles for NutriBox Referral Plugin
 */

/* General Styles */
.nutribox-referral-dashboard {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Dashboard Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.dashboard-header h2 {
    margin: 0;
    color: #2c3e50;
    font-size: 28px;
    font-weight: 600;
}

.ambassador-badge {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.3);
}

.ambassador-badge .badge-icon {
    margin-right: 8px;
    font-size: 16px;
}

/* Stats Overview */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.stat-card.wallet-balance {
    border-left: 4px solid #27ae60;
}

.stat-card.total-referrals {
    border-left: 4px solid #3498db;
}

.stat-card.monthly-referrals {
    border-left: 4px solid #9b59b6;
}

.stat-card.total-rewards {
    border-left: 4px solid #e74c3c;
}

.stat-icon {
    font-size: 24px;
    margin-right: 15px;
    opacity: 0.8;
}

.stat-content h3 {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
}

/* Tabs */
.dashboard-tabs {
    margin-top: 30px;
}

.tab-navigation {
    display: flex;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 25px;
    overflow-x: auto;
}

.tab-button {
    background: none;
    border: none;
    padding: 15px 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #6c757d;
    transition: all 0.3s ease;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
}

.tab-button:hover {
    color: #2c3e50;
    background-color: #f8f9fa;
}

.tab-button.active {
    color: #2c3e50;
    border-bottom-color: #3498db;
    background-color: #f8f9fa;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Referral Section */
.referral-section {
    max-width: 800px;
}

.section-description {
    font-size: 16px;
    color: #6c757d;
    margin-bottom: 25px;
    line-height: 1.6;
}

.referral-code-display,
.referral-link-display {
    margin-bottom: 25px;
}

.referral-code-display label,
.referral-link-display label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 14px;
}

.code-input-group,
.link-input-group {
    display: flex;
    gap: 10px;
}

.code-input-group input,
.link-input-group input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 16px;
    font-family: 'Monaco', 'Menlo', monospace;
    background: #f8f9fa;
    color: #2c3e50;
}

.copy-button {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.copy-button:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.copy-button:active {
    transform: translateY(0);
}

/* Sharing Options */
.sharing-options {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.sharing-options h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
}

.share-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.share-button {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.share-button.email {
    background: #e74c3c;
    color: white;
}

.share-button.whatsapp {
    background: #25d366;
    color: white;
}

.share-button.copy-link {
    background: #6c757d;
    color: white;
}

.share-button:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}

/* Rewards Info */
.ambassador-rewards-info,
.customer-rewards-info {
    margin-top: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
}

.ambassador-rewards-info h4,
.customer-rewards-info h4 {
    margin: 0 0 15px 0;
    color: white;
}

.reward-structure {
    display: grid;
    gap: 10px;
}

.reward-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.reward-item:last-child {
    border-bottom: none;
}

.reward-item strong {
    font-weight: 600;
}

.reward-item span {
    font-size: 16px;
    font-weight: 500;
}

/* Wallet Section */
.wallet-section {
    max-width: 800px;
}

.wallet-balance-card {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.wallet-balance-card h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    opacity: 0.9;
}

.balance-amount {
    font-size: 36px;
    font-weight: 700;
    margin: 10px 0;
    display: block;
}

.balance-note {
    margin: 15px 0 0 0;
    opacity: 0.9;
    font-size: 14px;
}

/* Transactions Table */
.recent-transactions {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.recent-transactions h4 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 20px;
}

.transactions-table,
.referrals-table {
    width: 100%;
    overflow-x: auto;
}

.transactions-table table,
.referrals-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.transactions-table th,
.referrals-table th,
.transactions-table td,
.referrals-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.transactions-table th,
.referrals-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.amount.positive {
    color: #27ae60;
    font-weight: 600;
}

.amount.negative {
    color: #e74c3c;
    font-weight: 600;
}

.load-more-transactions {
    width: 100%;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    color: #2c3e50;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.load-more-transactions:hover {
    background: #e9ecef;
}

.no-transactions,
.no-referrals {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-completed {
    background: #d1ecf1;
    color: #0c5460;
}

.status-rewarded {
    background: #d4edda;
    color: #155724;
}

.status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

.reward-amount.positive {
    color: #27ae60;
    font-weight: 600;
}

.reward-pending {
    color: #f39c12;
    font-style: italic;
}

.reward-none {
    color: #6c757d;
}

/* Ambassador Tools */
.ambassador-section {
    max-width: 800px;
}

.ambassador-stats {
    margin-bottom: 30px;
}

.ambassador-stat-card {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3);
}

.ambassador-stat-card h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 5px;
}

.stat-item .stat-value {
    font-size: 24px;
    font-weight: 700;
}

.ambassador-tools {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.ambassador-tools h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
}

.tool-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tool-button {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    text-decoration: none;
    color: #2c3e50;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.tool-button:hover {
    border-color: #3498db;
    background: #f8f9fa;
    transform: translateY(-1px);
}

#qr-code-container {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 20px;
}

#qr-code-container h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
}

/* Copy CTA Button */
.copy-code-cta {
    background: #3498db;
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.copy-code-cta:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nutribox-referral-dashboard {
        padding: 15px;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .tab-navigation {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .tab-button {
        flex: 1;
        min-width: auto;
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .code-input-group,
    .link-input-group {
        flex-direction: column;
    }
    
    .share-buttons {
        flex-direction: column;
    }
    
    .share-button {
        justify-content: center;
    }
    
    .tool-buttons {
        flex-direction: column;
    }
    
    .stat-grid {
        grid-template-columns: 1fr;
    }
    
    .reward-structure {
        gap: 5px;
    }
    
    .reward-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .dashboard-header h2 {
        font-size: 24px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .balance-amount {
        font-size: 28px;
    }
    
    .transactions-table,
    .referrals-table {
        font-size: 14px;
    }
    
    .transactions-table th,
    .referrals-table th,
    .transactions-table td,
    .referrals-table td {
        padding: 8px 12px;
    }
}
