/* CashGifts MLM Public Styles */

/* Global Styles */
.cashgifts-dashboard,
.cashgifts-registration,
.cashgifts-matrix-tree {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Dashboard Styles */
.dashboard-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    margin: -20px -20px 30px -20px;
}

.dashboard-header h1 {
    margin: 0 0 10px 0;
    font-size: 2.5em;
    font-weight: 300;
}

.member-status {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
}

.current-level {
    background: rgba(255,255,255,0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
}

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

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e1e8ed;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.stat-icon {
    font-size: 2.5em;
    margin-bottom: 15px;
    display: block;
}

.stat-content h3 {
    margin: 0 0 8px 0;
    font-size: 2.2em;
    color: #2c3e50;
    font-weight: 600;
}

.stat-content p {
    margin: 0;
    color: #7f8c8d;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* Content Sections */
.dashboard-content {
    display: grid;
    gap: 30px;
}

.content-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid #e1e8ed;
}

.content-section h2 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 1.5em;
    font-weight: 600;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

/* Referral Link */
.referral-link-box {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.referral-link-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 14px;
    background: #f8f9fa;
    color: #2c3e50;
}

.copy-link-btn {
    padding: 12px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
}

.copy-link-btn:hover {
    background: #2980b9;
}

.referral-note {
    color: #7f8c8d;
    font-style: italic;
    margin: 0;
}

/* Level Progression */
.level-progression h3 {
    color: #2c3e50;
    margin: 25px 0 15px 0;
    font-size: 1.3em;
    font-weight: 600;
}

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

.level-card {
    background: white;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.level-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #e1e8ed;
}

.level-card.current {
    border-color: #f39c12;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.2);
}

.level-card.current::before {
    background: #f39c12;
}

.level-card.completed {
    border-color: #27ae60;
    background: #f8fff9;
}

.level-card.completed::before {
    background: #27ae60;
}

.level-card.available {
    border-color: #3498db;
    cursor: pointer;
}

.level-card.available::before {
    background: #3498db;
}

.level-card.available:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.2);
}

.level-card.locked {
    opacity: 0.6;
    background: #f8f9fa;
}

.level-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.level-header h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.2em;
    font-weight: 600;
}

.level-status {
    font-size: 1.2em;
    font-weight: bold;
}

.level-status.completed {
    color: #27ae60;
}

.level-status.current {
    color: #f39c12;
}

.level-details p {
    margin: 8px 0;
    color: #7f8c8d;
    font-size: 14px;
}

.level-details strong {
    color: #2c3e50;
}

.upgrade-btn {
    width: 100%;
    padding: 12px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 15px;
    transition: background 0.3s ease;
}

.upgrade-btn:hover {
    background: #2980b9;
}

/* Payments List */
.payments-list {
    display: grid;
    gap: 15px;
}

.payment-item {
    background: #f8f9fa;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.payment-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.payment-info strong {
    color: #2c3e50;
    font-size: 1.2em;
}

.payment-info span {
    color: #7f8c8d;
    font-size: 14px;
}

.payment-info small {
    color: #95a5a6;
    font-size: 12px;
}

.payment-actions {
    display: flex;
    gap: 10px;
}

.confirm-payment-btn,
.pay-now-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.confirm-payment-btn {
    background: #27ae60;
    color: white;
}

.confirm-payment-btn:hover {
    background: #219a52;
}

.pay-now-btn {
    background: #e74c3c;
    color: white;
}

.pay-now-btn:hover {
    background: #c0392b;
}

/* Registration Styles */
.registration-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    margin: -20px -20px 40px -20px;
}

.registration-header h1 {
    margin: 0 0 15px 0;
    font-size: 2.5em;
    font-weight: 300;
}

.registration-header p {
    margin: 0 0 20px 0;
    font-size: 1.1em;
    opacity: 0.9;
}

.sponsor-info {
    background: rgba(255,255,255,0.2);
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
}

.registration-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.registration-form-container {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid #e1e8ed;
}

.registration-form {
    display: grid;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.form-group input {
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
}

.form-group small {
    color: #7f8c8d;
    font-size: 12px;
}

.checkbox-label {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label input {
    width: auto;
    margin: 0;
}

.register-btn {
    padding: 15px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: background 0.3s ease;
}

.register-btn:hover {
    background: #219a52;
}

.register-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

/* Registration Info */
.registration-info {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid #e1e8ed;
}

.registration-info h2 {
    margin: 0 0 25px 0;
    color: #2c3e50;
    font-size: 1.8em;
    font-weight: 600;
    text-align: center;
}

.info-section {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.info-section h3 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 1.1em;
    font-weight: 600;
}

.info-section p {
    margin: 0;
    color: #7f8c8d;
    line-height: 1.6;
}

.level-structure {
    margin-top: 30px;
}

.level-structure h3 {
    color: #2c3e50;
    margin: 20px 0 15px 0;
    font-size: 1.2em;
    font-weight: 600;
}

.levels-table {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1px;
    background: #e1e8ed;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.level-row {
    display: contents;
}

.level-row > span {
    background: white;
    padding: 12px 15px;
    text-align: center;
    font-weight: 500;
}

.level-row.header > span {
    background: #3498db;
    color: white;
    font-weight: 600;
}

/* Matrix Tree Styles */
.matrix-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 25px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid #e1e8ed;
}

.matrix-header h1 {
    margin: 0;
    color: #2c3e50;
    font-size: 2em;
    font-weight: 600;
}

.matrix-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.level-selector,
.stage-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.level-selector label,
.stage-selector label {
    font-weight: 600;
    color: #2c3e50;
}

.level-selector select,
.stage-selector select {
    padding: 8px 12px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 14px;
}

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

.button-primary:hover {
    background: #2980b9;
}

.matrix-info {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid #e1e8ed;
}

.matrix-info h2 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 1.5em;
    font-weight: 600;
}

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

.stat-item {
    text-align: center;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e1e8ed;
}

.stat-item strong {
    display: block;
    font-size: 2em;
    color: #3498db;
    margin-bottom: 8px;
    font-weight: 600;
}

.stat-item span {
    color: #7f8c8d;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* Matrix Container */
.matrix-container {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid #e1e8ed;
    overflow-x: auto;
}

.matrix-node {
    background: white;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    margin: 10px;
    min-width: 120px;
    transition: all 0.3s ease;
}

.matrix-node.root-node {
    border-color: #3498db;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    transform: scale(1.1);
}

.matrix-node.active-node {
    border-color: #27ae60;
    background: #f8fff9;
}

.matrix-node.inactive-node {
    border-color: #e74c3c;
    background: #fff8f8;
}

.matrix-node.empty-node {
    border: 2px dashed #bdc3c7;
    background: #f8f9fa;
    color: #7f8c8d;
}

.node-avatar {
    margin-bottom: 10px;
}

.node-avatar img {
    border-radius: 50%;
    border: 2px solid #e1e8ed;
}

.empty-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #bdc3c7;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    margin: 0 auto;
}

.node-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.node-info strong {
    font-size: 14px;
    font-weight: 600;
}

.node-info small {
    font-size: 12px;
    color: #7f8c8d;
}

.matrix-level {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.matrix-branch {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Matrix Legend */
.matrix-legend {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid #e1e8ed;
}

.matrix-legend h3 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 1.3em;
    font-weight: 600;
}

.legend-items {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid;
}

.legend-color.active {
    background: #f8fff9;
    border-color: #27ae60;
}

.legend-color.inactive {
    background: #fff8f8;
    border-color: #e74c3c;
}

.legend-color.empty {
    background: #f8f9fa;
    border: 2px dashed #bdc3c7;
}

/* Matrix Explanation */
.matrix-explanation {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid #e1e8ed;
}

.matrix-explanation h3 {
    margin: 0 0 25px 0;
    color: #2c3e50;
    font-size: 1.5em;
    font-weight: 600;
    text-align: center;
}

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

.explanation-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.explanation-item h4 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 1.1em;
    font-weight: 600;
}

.explanation-item p {
    margin: 0;
    color: #7f8c8d;
    line-height: 1.6;
}

/* Status Badges */
.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

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

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

/* Notifications */
.cashgifts-notice {
    background: #e7f3ff;
    border-left: 4px solid #3498db;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 4px;
}

.cashgifts-error {
    background: #ffebee;
    border-left: 4px solid #e74c3c;
    padding: 15px 20px;
    margin: 20px 0;
    color: #721c24;
    border-radius: 4px;
}

.cashgifts-success {
    background: #edf7ed;
    border-left: 4px solid #27ae60;
    padding: 15px 20px;
    margin: 20px 0;
    color: #2e7d32;
    border-radius: 4px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 4px 25px rgba(0,0,0,0.2);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 15px;
}

.close:hover {
    color: #000;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 25px;
}

.button-secondary {
    padding: 10px 20px;
    background: #95a5a6;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
}

.button-secondary:hover {
    background: #7f8c8d;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .cashgifts-dashboard,
    .cashgifts-registration,
    .cashgifts-matrix-tree {
        padding: 15px;
    }
    
    .dashboard-header,
    .registration-header {
        margin: -15px -15px 25px -15px;
        padding: 25px 15px;
    }
    
    .dashboard-header h1,
    .registration-header h1 {
        font-size: 2em;
    }
    
    .dashboard-stats {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .stat-card {
        padding: 20px 15px;
    }
    
    .stat-content h3 {
        font-size: 1.8em;
    }
    
    .registration-content {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .levels-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .matrix-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .matrix-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .matrix-stats {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .matrix-level {
        gap: 10px;
    }
    
    .matrix-node {
        min-width: 100px;
        padding: 12px;
        margin: 5px;
    }
    
    .explanation-grid {
        grid-template-columns: 1fr;
    }
    
    .legend-items {
        flex-direction: column;
        gap: 15px;
    }
    
    .payment-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .payment-actions {
        align-self: stretch;
        justify-content: flex-end;
    }
}

@media (max-width: 480px) {
    .levels-table {
        font-size: 12px;
    }
    
    .level-row > span {
        padding: 8px 10px;
    }
    
    .modal-content {
        margin: 5% auto;
        padding: 20px;
        width: 95%;
    }
    
    .matrix-container {
        padding: 15px;
    }
    
    .form-group input {
        padding: 10px 12px;
    }
}
.cashgifts-notification.error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px;
    border: 1px solid #f5c6cb;
    margin: 10px 0;
    position: relative;
}
.cashgifts-notification .notification-close {
    position: absolute;
    right: 10px;
    top: 10px;
    cursor: pointer;
}

.cashgifts-login {
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
}

.login-header {
    text-align: center;
    margin-bottom: 20px;
}

.login-form .form-group {
    margin-bottom: 15px;
}

.login-form label {
    display: block;
    margin-bottom: 5px;
}

.login-form input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.login-btn {
    width: 100%;
    padding: 10px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.login-btn:hover {
    background-color: #005177;
}