/* Creadia Affiliate System Frontend Styles */

.creadia-affiliate-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

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

.affiliate-info {
    display: flex;
    gap: 15px;
    align-items: center;
}

.affiliate-code {
    background: #f0f0f0;
    padding: 8px 12px;
    border-radius: 4px;
    font-weight: bold;
    font-family: monospace;
}

.status, .rank {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.status-active { background: #d4edda; color: #155724; }
.status-pending { background: #fff3cd; color: #856404; }
.status-inactive { background: #f8d7da; color: #721c24; }
.status-validated { background: #d1ecf1; color: #0c5460; }
.status-rejected { background: #f8d7da; color: #721c24; }

.rank-regular { background: #e2e3e5; color: #383d41; }
.rank-gold { background: #ffeaa7; color: #6c5ce7; }
.rank-diamond { background: #74b9ff; color: #ffffff; }

.dashboard-nav ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
    border-bottom: 1px solid #e0e0e0;
}

.dashboard-nav li {
    margin-right: 20px;
}

.dashboard-nav a {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.dashboard-nav a:hover,
.dashboard-nav a.active {
    color: #007cba;
    border-bottom-color: #007cba;
}

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

.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #333!important;
    text-transform: uppercase;
}

.stat-number {
    font-size: 24px;
    font-weight: bold;
    color: #000;
}

.pending-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.pending-notice h3 {
    margin: 0 0 10px 0;
    color: #856404;
}

.deals-table,
.commissions-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.deals-table th,
.deals-table td,
.commissions-table th,
.commissions-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    color: #000;
}

.deals-table th,
.commissions-table th {
    background: #f8f9fa;
    font-weight: bold;
}

.client-info strong {
    display: block;
    color: #000;
}

.client-info small {
    color: #666;
    font-size: 12px;
}

.commission-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.summary-card h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 14px;
    text-transform: uppercase;
}

.summary-card .amount {
    font-size: 20px;
    font-weight: bold;
    color: #000;
}

.commission-type {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

.type-direct { background: #d1ecf1; color: #0c5460; }
.type-referral { background: #f0f4ff; color: #4c63d2; }

.network-stats {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

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

.stat-item .label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
}

.stat-item .value {
    font-size: 18px;
    font-weight: bold;
    color: #000;
}

.network-tree {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.network-level {
    list-style: none;
    padding: 0;
    margin: 0;
}

.network-item {
    margin: 10px 0;
    padding-left: 20px;
    border-left: 2px solid #e0e0e0;
    color: #000;
}

.level-1 .network-item {
    border-left-color: #007cba;
}

.level-2 .network-item {
    border-left-color: #ffeaa7;
}

.level-3 .network-item {
    border-left-color: #74b9ff;
}

.referral-info {
    display: flex;
    gap: 15px;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.referral-info .name {
    font-weight: bold;
    color: #000;
}

.referral-info .code {
    font-family: monospace;
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
    color: #000;
}

.referral-info .deals {
    font-size: 12px;
    color: #333;
}

.referral-link-section {
    margin-bottom: 30px;
}

.referral-link-section label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
}

.link-container {
    display: flex;
    gap: 10px;
}

.referral-link-input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
}

.copy-btn {
    padding: 12px 20px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.copy-btn:hover {
    background: #005a87;
}

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

.share-btn {
    display: inline-block;
    padding: 10px 15px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    text-align: center;
    min-width: 100px;
}

.share-btn.facebook { background: #3b5998; color: white; }
.share-btn.twitter { background: #1da1f2; color: white; }
.share-btn.linkedin { background: #0077b5; color: white; }
.share-btn.whatsapp { background: #25d366; color: white; }
.share-btn.email { background: #666; color: white; }

.performance-stats {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 30px;
    color: #000;
}

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

.perf-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.perf-item .label {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
}

.perf-item .value {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

/* Registration Form */
.creadia-registration-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.referral-notice {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
    color: #0c5460;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #000;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    background: #fff;
    color: #000;
}

.form-group input[type="checkbox"] {
    margin-right: 8px;
}

.submit-btn {
    width: 100%;
    padding: 15px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

.submit-btn:hover {
    background: #005a87;
}

.creadia-message {
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
}

.creadia-message.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.creadia-message.info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.creadia-message.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.creadia-login-notice {
    text-align: center;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #000;
}

.leads-table,
.calculator-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.leads-table th,
.leads-table td,
.calculator-table th,
.calculator-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    color: #000;
}

.leads-table th,
.calculator-table th {
    background: #f8f9fa;
    font-weight: bold;
}

.contact-info {
    font-size: 12px;
    color: #000;
}

.contact-info div {
    margin: 2px 0;
}

.leads-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.promotion-tips {
    background: #f0f4ff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
}

.tips-list p {
    margin: 8px 0;
    font-size: 14px;
    color: #000;
}

.link-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .dashboard-nav ul {
        flex-direction: column;
    }
    
    .dashboard-nav li {
        margin: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .commission-summary {
        grid-template-columns: 1fr;
    }
    
    .network-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .social-share {
        flex-direction: column;
    }
    
    .share-btn {
        min-width: auto;
    }
    
    .link-container {
        flex-direction: column;
    }
    
    .deals-table,
    .commissions-table {
        font-size: 14px;
    }
    
    .deals-table th,
    .deals-table td,
    .commissions-table th,
    .commissions-table td {
        padding: 8px 4px;
    }
}

/* QR Code Modal Styles */
.creadia-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.modal-body {
    padding: 24px;
}

.qr-code-container {
    text-align: center;
}

.qr-code-container img {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 16px;
    padding: 10px;
    background: white;
}

.qr-description {
    margin: 16px 0;
    color: #666;
    font-size: 14px;
}

.qr-url-container {
    display: flex;
    gap: 8px;
    margin: 16px 0;
    align-items: center;
}

.qr-url-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    background: #f8f9fa;
    color: #333;
    font-family: monospace;
}

.qr-actions {
    margin-top: 20px;
}

.download-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.download-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.qr-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    margin-left: 8px;
    transition: all 0.2s ease;
}

.qr-btn:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
}

.text-center {
    text-align: center;
}

.error-message {
    padding: 16px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #721c24;
    text-align: center;
}

#qr-loading {
    padding: 40px 20px;
    color: #666;
}

/* Referral link container adjustments for QR buttons */
.referral-link-container,
.link-container {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 8px 0;
}

.referral-link-input {
    flex: 1;
}

/* Mobile responsiveness for QR modal */
@media (max-width: 768px) {
    .modal-content {
        margin: 20px;
        width: calc(100% - 40px);
    }
    
    .modal-header {
        padding: 16px 20px 12px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .qr-url-container {
        flex-direction: column;
        gap: 12px;
    }
    
    .qr-url-input {
        width: 100%;
    }
    
    .copy-btn,
    .qr-btn {
        width: 100%;
        justify-content: center;
    }
    
    .referral-link-container,
    .link-container {
        flex-wrap: wrap;
    }
    
    .referral-link-input {
        width: 100%;
        margin-bottom: 8px;
    }
}