/* Affiliate Referral System Styles */
:root {
    --ars-primary: #007cba;
    --ars-primary-dark: #005a87;
    --ars-secondary: #50c878;
    --ars-success: #28a745;
    --ars-danger: #dc3545;
    --ars-warning: #ffc107;
    --ars-info: #17a2b8;
    --ars-light: #f8f9fa;
    --ars-dark: #343a40;
    --ars-border: #dee2e6;
    --ars-border-radius: 8px;
    --ars-shadow: 0 2px 10px rgba(0,0,0,0.1);
    --ars-transition: all 0.3s ease;
}

/* Reset and Base Styles */
.ars-registration-container *,
.ars-dashboard * {
    box-sizing: border-box;
}

/* Registration Form Styles */
.ars-registration-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ars-registration-header {
    text-align: center;
    margin-bottom: 40px;
}

.ars-registration-header h2 {
    color: var(--ars-primary);
    margin-bottom: 10px;
    font-size: 2.5rem;
    font-weight: 700;
}

.ars-registration-header p {
    color: #666;
    font-size: 1.2rem;
    margin: 0;
}

/* Benefits Grid */
.ars-benefits {
    margin-bottom: 40px;
}

.ars-benefit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.ars-benefit-item {
    text-align: center;
    padding: 20px;
    background: var(--ars-light);
    border-radius: var(--ars-border-radius);
    border: 2px solid transparent;
    transition: var(--ars-transition);
}

.ars-benefit-item:hover {
    border-color: var(--ars-primary);
    transform: translateY(-2px);
}

.ars-benefit-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.ars-benefit-item h3 {
    color: var(--ars-primary);
    margin: 10px 0 5px;
    font-size: 1.1rem;
}

.ars-benefit-item p {
    color: #666;
    margin: 0;
    font-size: 0.9rem;
}

/* Form Styles */
.ars-form {
    background: white;
    padding: 30px;
    border-radius: var(--ars-border-radius);
    box-shadow: var(--ars-shadow);
    margin-bottom: 20px;
}

.ars-form-section {
    margin-bottom: 30px;
}

.ars-form-section h3 {
    color: var(--ars-primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--ars-border);
}

.ars-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.ars-form-group {
    margin-bottom: 20px;
}

.ars-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--ars-dark);
}

.ars-form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--ars-border);
    border-radius: var(--ars-border-radius);
    font-size: 1rem;
    transition: var(--ars-transition);
}

.ars-form-group input:focus {
    outline: none;
    border-color: var(--ars-primary);
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.ars-form-group input.error {
    border-color: var(--ars-danger);
}

.ars-form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.85rem;
}

.ars-required {
    color: var(--ars-danger);
    font-size: 0.9rem;
}

/* Affiliate Code Field */
.ars-affiliate-code-wrapper {
    display: flex;
    gap: 10px;
}

.ars-affiliate-code-wrapper input {
    flex: 1;
}

.ars-verify-btn {
    padding: 12px 20px;
    background: var(--ars-secondary);
    color: white;
    border: none;
    border-radius: var(--ars-border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: var(--ars-transition);
}

.ars-verify-btn:hover {
    background: #45b369;
}

.ars-verify-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Status Messages */
.ars-status-message {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.ars-status-message .success {
    color: var(--ars-success);
    background: #d4edda;
}

.ars-status-message .error {
    color: var(--ars-danger);
    background: #f8d7da;
}

/* Terms Checkbox */
.ars-terms {
    margin: 20px 0;
}

.ars-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.95rem;
}

.ars-checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* Buttons */
.ars-form-actions {
    text-align: center;
    margin-top: 30px;
}

.ars-btn-primary {
    background: var(--ars-primary);
    color: white;
    padding: 15px 40px;
    border: none;
    border-radius: var(--ars-border-radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--ars-transition);
    min-width: 200px;
}

.ars-btn-primary:hover:not(:disabled) {
    background: var(--ars-primary-dark);
    transform: translateY(-2px);
}

.ars-btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.ars-btn-secondary {
    background: white;
    color: var(--ars-primary);
    border: 2px solid var(--ars-primary);
    padding: 10px 20px;
    border-radius: var(--ars-border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--ars-transition);
}

.ars-btn-secondary:hover {
    background: var(--ars-primary);
    color: white;
}

/* Messages */
.ars-message {
    margin-top: 20px;
    text-align: center;
}

.ars-message .success {
    color: var(--ars-success);
    background: #d4edda;
    padding: 15px;
    border-radius: var(--ars-border-radius);
    border: 1px solid #c3e6cb;
}

.ars-message .error {
    color: var(--ars-danger);
    background: #f8d7da;
    padding: 15px;
    border-radius: var(--ars-border-radius);
    border: 1px solid #f5c6cb;
}

.ars-login-link {
    text-align: center;
    margin-top: 20px;
}

/* Dashboard Styles */
.ars-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ars-dashboard-header {
    text-align: center;
    margin-bottom: 40px;
}

.ars-dashboard-header h1 {
    color: var(--ars-primary);
    margin-bottom: 10px;
    font-size: 2.5rem;
}

.ars-dashboard-header p {
    color: #666;
    font-size: 1.1rem;
}

/* Stats Grid */
.ars-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.ars-stat-card {
    background: white;
    padding: 25px;
    border-radius: var(--ars-border-radius);
    box-shadow: var(--ars-shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--ars-transition);
}

.ars-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.ars-stat-icon {
    font-size: 2.5rem;
    padding: 15px;
    border-radius: 50%;
    background: var(--ars-light);
}

.ars-earnings .ars-stat-icon { background: #e8f5e8; }
.ars-total-earnings .ars-stat-icon { background: #e3f2fd; }
.ars-referrals .ars-stat-icon { background: #fff3e0; }
.ars-conversion .ars-stat-icon { background: #fce4ec; }

.ars-stat-content h3 {
    margin: 0 0 5px;
    font-size: 2rem;
    font-weight: 700;
    color: var(--ars-primary);
}

.ars-stat-content p {
    margin: 0;
    color: #666;
    font-size: 0.95rem;
}

/* Dashboard Navigation */
.ars-dashboard-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--ars-border);
    padding-bottom: 10px;
}

.ars-nav-btn {
    background: none;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    border-radius: var(--ars-border-radius);
    transition: var(--ars-transition);
}

.ars-nav-btn:hover {
    background: var(--ars-light);
    color: var(--ars-primary);
}

.ars-nav-btn.active {
    background: var(--ars-primary);
    color: white;
}

/* Tab Content */
.ars-tab-panel {
    display: none;
}

.ars-tab-panel.active {
    display: block;
}

/* Cards */
.ars-card {
    background: white;
    padding: 25px;
    border-radius: var(--ars-border-radius);
    box-shadow: var(--ars-shadow);
    margin-bottom: 20px;
}

.ars-card h3 {
    color: var(--ars-primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--ars-border);
}

.ars-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.ars-full-width {
    grid-column: 1 / -1;
}

/* Quick Actions */
.ars-quick-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ars-quick-actions button {
    padding: 12px 20px;
    border-radius: var(--ars-border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--ars-transition);
}

/* Recent Activity */
.ars-recent-activity {
    max-height: 300px;
    overflow-y: auto;
}

.ars-activity-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--ars-border);
}

.ars-activity-item:last-child {
    border-bottom: none;
}

.ars-activity-info strong {
    color: var(--ars-dark);
}

.ars-tier {
    background: var(--ars-secondary);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    margin-left: 10px;
}

.ars-activity-amount {
    font-weight: 700;
    color: var(--ars-success);
}

/* Performance Grid */
.ars-performance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.ars-performance-item {
    text-align: center;
    padding: 20px;
    background: var(--ars-light);
    border-radius: var(--ars-border-radius);
}

.ars-performance-item h4 {
    font-size: 2rem;
    color: var(--ars-primary);
    margin-bottom: 5px;
}

.ars-performance-item p {
    color: #666;
    margin: 0;
}

/* Marketing Tools */
.ars-marketing-tools {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.ars-tool-section {
    padding: 20px 0;
    border-bottom: 1px solid var(--ars-border);
}

.ars-tool-section:last-child {
    border-bottom: none;
}

.ars-tool-section label {
    display: block;
    font-weight: 600;
    color: var(--ars-dark);
    margin-bottom: 10px;
}

.ars-link-container {
    display: flex;
    gap: 10px;
}

.ars-link-container input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid var(--ars-border);
    border-radius: var(--ars-border-radius);
    font-family: monospace;
    background: var(--ars-light);
}

.ars-copy-btn {
    padding: 12px 20px;
    background: var(--ars-primary);
    color: white;
    border: none;
    border-radius: var(--ars-border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: var(--ars-transition);
}

.ars-copy-btn:hover {
    background: var(--ars-primary-dark);
}

.ars-code-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ars-affiliate-code {
    font-family: monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ars-primary);
    background: var(--ars-light);
    padding: 10px 20px;
    border-radius: var(--ars-border-radius);
    border: 2px dashed var(--ars-primary);
}

.ars-qr-container {
    display: flex;
    align-items: center;
    gap: 20px;
}

#qr-code {
    padding: 10px;
    background: white;
    border: 2px solid var(--ars-border);
    border-radius: var(--ars-border-radius);
}

/* Social Share */
.ars-social-share {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ars-social-btn {
    padding: 10px 15px;
    border: none;
    border-radius: var(--ars-border-radius);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: var(--ars-transition);
}

.ars-social-btn.whatsapp { background: #25d366; }
.ars-social-btn.facebook { background: #1877f2; }
.ars-social-btn.twitter { background: #1da1f2; }
.ars-social-btn.telegram { background: #0088cc; }

.ars-social-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

/* Tables */
.ars-table-responsive {
    overflow-x: auto;
}

.ars-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.ars-table th,
.ars-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--ars-border);
}

.ars-table th {
    background: var(--ars-light);
    font-weight: 600;
    color: var(--ars-dark);
}

.ars-table tr:hover {
    background: #f8f9fa;
}

.ars-code {
    font-family: monospace;
    background: var(--ars-light);
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.ars-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.ars-status.active { background: #d4edda; color: #155724; }
.ars-status.inactive { background: #f8d7da; color: #721c24; }
.ars-status.pending { background: #fff3cd; color: #856404; }
.ars-status.approved { background: #d1ecf1; color: #0c5460; }
.ars-status.completed { background: #d4edda; color: #155724; }
.ars-status.failed { background: #f8d7da; color: #721c24; }
.ars-status.processing { background: #e2e3e5; color: #383d41; }

.ars-tier-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
}

.ars-tier-badge.tier-1 { background: var(--ars-success); }
.ars-tier-badge.tier-2 { background: var(--ars-info); }

/* Empty State */
.ars-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

/* Payout Section */
.ars-payout-info {
    background: var(--ars-light);
    padding: 15px;
    border-radius: var(--ars-border-radius);
    margin-bottom: 20px;
}

.ars-payout-info p {
    margin: 5px 0;
}

.ars-payout-list {
    max-height: 300px;
    overflow-y: auto;
}

.ars-payout-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--ars-border);
}

.ars-payout-item:last-child {
    border-bottom: none;
}

.ars-payout-date {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-top: 5px;
}

/* Profile Section */
.ars-affiliate-info {
    background: var(--ars-light);
    padding: 20px;
    border-radius: var(--ars-border-radius);
    margin-top: 20px;
}

.ars-affiliate-info h4 {
    color: var(--ars-primary);
    margin-bottom: 15px;
}

.ars-affiliate-info p {
    margin: 8px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ars-registration-container,
    .ars-dashboard {
        padding: 15px;
    }
    
    .ars-form-row {
        grid-template-columns: 1fr;
    }
    
    .ars-benefit-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ars-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .ars-dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .ars-dashboard-nav {
        justify-content: center;
    }
    
    .ars-nav-btn {
        font-size: 0.9rem;
        padding: 10px 15px;
    }
    
    .ars-link-container {
        flex-direction: column;
    }
    
    .ars-qr-container {
        flex-direction: column;
    }
    
    .ars-social-share {
        justify-content: center;
    }
    
    .ars-table {
        font-size: 0.9rem;
    }
    
    .ars-performance-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .ars-benefit-grid {
        grid-template-columns: 1fr;
    }
    
    .ars-performance-grid {
        grid-template-columns: 1fr;
    }
    
    .ars-registration-header h2 {
        font-size: 2rem;
    }
    
    .ars-dashboard-header h1 {
        font-size: 2rem;
    }
}

/* Additional CSS for JavaScript Components */

/* Loading Spinner */
.ars-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.ars-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notifications */
.ars-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    z-index: 10000;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideIn 0.3s ease-out;
}

.ars-notification-success {
    background: #28a745;
}

.ars-notification-error {
    background: #dc3545;
}

.ars-notification-info {
    background: #17a2b8;
}

.ars-notification-warning {
    background: #ffc107;
    color: #212529;
}

.ars-notification .close-btn {
    background: none;
    border: none;
    color: inherit;
    font-size: 18px;
    cursor: pointer;
    margin-left: 10px;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ars-notification .close-btn:hover {
    opacity: 0.7;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Tooltips */
.ars-tooltip {
    position: absolute;
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 10001;
    max-width: 200px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.ars-tooltip:after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

/* Modal Styles */
.ars-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
}

.ars-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ars-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.ars-modal-content {
    position: relative;
    background: white;
    border-radius: 8px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: modalZoom 0.3s ease-out;
}

.ars-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.ars-modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

@keyframes modalZoom {
    from {
        transform: scale(0.7);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

body.modal-open {
    overflow: hidden;
}

/* Copy Button States */
.ars-copy-btn.copied {
    background: #28a745 !important;
    color: white !important;
}

/* Password Strength Indicator */
#password-strength {
    display: none;
    margin-top: 5px;
    font-size: 12px;
    font-weight: 600;
}

/* Error States */
.error-message {
    display: block;
    margin-top: 5px;
    color: #dc3545;
    font-size: 12px;
}

input.error,
select.error,
textarea.error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25) !important;
}

/* Success States */
.success {
    color: #28a745 !important;
}

.error {
    color: #dc3545 !important;
}

/* Button Loading States */
.btn-loader {
    display: none;
}

button[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .ars-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .ars-modal-content {
        margin: 20px;
        width: calc(100% - 40px);
        padding: 20px;
    }
    
    .ars-tooltip {
        max-width: 150px;
        font-size: 11px;
    }
}