* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.2em;
    opacity: 0.9;
}

.tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    overflow-x: auto;
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    color: #666;
    transition: all 0.3s;
    white-space: nowrap;
}

.tab-btn:hover {
    background: #e9ecef;
    color: #333;
}

.tab-btn.active {
    background: white;
    color: #667eea;
    border-bottom: 3px solid #667eea;
}

.tab-content {
    display: none;
    padding: 30px;
    animation: fadeIn 0.3s;
}

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

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

.card {
    background: white;
    border-radius: 10px;
    padding: 20px;
}

.card h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.card h3 {
    color: #764ba2;
    margin: 20px 0 15px;
    font-size: 1.3em;
}

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

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-right: 10px;
    margin-bottom: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.result {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    display: none;
}

.result.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    display: block;
}

.result.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    display: block;
}

.result pre {
    margin-top: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 5px;
    overflow-x: auto;
    font-size: 0.9em;
}

hr {
    margin: 30px 0;
    border: none;
    border-top: 2px solid #e9ecef;
}

.fee-calculator {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
}

.fee-calculator h3 {
    margin: 0;
    color: #667eea;
}

#calculated-fee {
    font-size: 1.5em;
    font-weight: bold;
    color: #764ba2;
}

.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading.hidden {
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    color: white;
    margin-top: 20px;
    font-size: 1.2em;
}

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

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

.stat-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.stat-card h4 {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.stat-card .value {
    font-size: 2em;
    font-weight: bold;
    color: #667eea;
}

.progress-section {
    margin: 20px 0;
}

.progress-bar-container {
    background: #e9ecef;
    height: 30px;
    border-radius: 15px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    transition: width 0.5s ease;
}

/* Matrix Tree Styles */
.matrix-tree {
    margin-top: 30px;
}

.matrix-level {
    margin: 30px 0;
}

.matrix-level h4 {
    color: #667eea;
    margin-bottom: 15px;
}

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

.matrix-node {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    min-width: 150px;
    text-align: center;
    transition: all 0.3s;
}

.matrix-node:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.matrix-node.root {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.matrix-node .node-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.matrix-node .node-username {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.matrix-node.root .node-username {
    color: rgba(255, 255, 255, 0.8);
}

.matrix-node .node-plan {
    font-size: 0.8em;
    background: #667eea;
    color: white;
    padding: 3px 8px;
    border-radius: 5px;
    display: inline-block;
    margin-top: 5px;
}

.matrix-node.root .node-plan {
    background: rgba(255, 255, 255, 0.2);
}

.empty-slot {
    background: #fff;
    border: 2px dashed #ccc;
    color: #999;
    font-style: italic;
}

/* Compensation Plan Styles */
.compensation-intro {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.plan-section {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.plan-breakdown {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.bonus-item {
    display: grid;
    grid-template-columns: 2fr 1fr 3fr;
    gap: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    align-items: center;
}

.bonus-item.highlight {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border: 2px solid #667eea;
}

.bonus-name {
    font-weight: bold;
    color: #333;
}

.bonus-amount {
    font-size: 1.2em;
    font-weight: bold;
    color: #667eea;
    text-align: center;
}

.bonus-desc {
    color: #666;
    font-size: 0.9em;
}

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

.explanation-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
}

.explanation-item h4 {
    color: #667eea;
    margin-bottom: 10px;
}

.progression-chart {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

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

.plan-badge {
    background: #667eea;
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
}

.plan-fee {
    font-size: 0.9em;
    color: #666;
}

.plan-arrow {
    font-size: 1.5em;
    color: #667eea;
}

.progression-note {
    text-align: center;
    color: #666;
    font-style: italic;
    margin-top: 15px;
}

/* Transaction Styles */
.transaction-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 15px;
    align-items: center;
}

.transaction-item.credit {
    border-left: 4px solid #28a745;
}

.transaction-item.debit {
    border-left: 4px solid #dc3545;
}

.transaction-date {
    font-size: 0.9em;
    color: #666;
}

.transaction-memo {
    font-weight: 500;
}

.transaction-amount {
    font-size: 1.2em;
    font-weight: bold;
}

.transaction-amount.credit {
    color: #28a745;
}

.transaction-amount.debit {
    color: #dc3545;
}

.transaction-type {
    font-size: 0.8em;
    padding: 3px 8px;
    border-radius: 5px;
    background: #667eea;
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }
    
    .subtitle {
        font-size: 1em;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .bonus-item {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .matrix-nodes {
        flex-direction: column;
        align-items: center;
    }
    
    .progression-chart {
        flex-direction: column;
    }
    
    .plan-arrow {
        transform: rotate(90deg);
    }
    
    .transaction-item {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* Add these styles to your existing style.css */

/* Task Management Styles */
.tasks-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.tasks-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.tasks-section h3 {
    color: #667eea;
    margin-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.task-item {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    transition: all 0.3s;
}

.task-item.pending {
    border-left: 4px solid #ffc107;
}

.task-item.completed {
    border-left: 4px solid #28a745;
    opacity: 0.8;
}

.task-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

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

.task-icon {
    font-size: 1.2em;
}

.task-type {
    font-weight: bold;
    color: #333;
    flex-grow: 1;
    margin-left: 10px;
}

.task-value {
    font-weight: bold;
    color: #28a745;
    font-size: 1.1em;
}

.task-description {
    color: #666;
    margin-bottom: 10px;
    line-height: 1.4;
}

.task-meta {
    font-size: 0.8em;
    color: #999;
    margin-bottom: 10px;
}

.task-actions {
    text-align: right;
}

.task-status {
    text-align: center;
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 0.9em;
}

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

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9em;
}

.no-tasks {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 20px;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.modal-header h3 {
    margin: 0;
    color: #667eea;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #999;
}

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

.modal-body {
    padding: 20px;
}

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

.task-modal-info {
    margin-bottom: 20px;
}

.task-modal-info h4 {
    color: #333;
    margin-bottom: 15px;
}

.task-link {
    text-align: center;
    margin: 15px 0;
}

.verification-hint {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 5px;
    padding: 10px;
    margin-top: 15px;
    font-size: 0.9em;
}

/* Responsive Design for Tasks */
@media (max-width: 768px) {
    .tasks-container {
        grid-template-columns: 1fr;
    }
    
    .task-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .task-value {
        align-self: flex-end;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
    }
}