/* ===================================================================
   DAEY.COM.CO - HOJA DE ESTILOS DEL PANEL DE AFILIADO (MY LOCAL MLM)
   Versión: 3.0 (Reorganizada y Mejorada)
   =================================================================== */

/* ============================================= */
/* 1. ESTILOS GENERALES Y PANELES                */
/* ============================================= */
.my-local-mlm-dashboard .mlm-section,
.my-local-mlm-dashboard .mlm-tab-pane {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 25px;
    margin-bottom: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.my-local-mlm-dashboard h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1a202c;
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 15px;
}

.mlm-notice {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    border: 1px solid;
}
.mlm-notice.success { background-color: #d4edda; border-color: #c3e6cb; color: #155724; }
.mlm-notice.error { background-color: #f8d7da; border-color: #f5c6cb; color: #721c24; }

/* ============================================= */
/* 2. FORMULARIOS (LOGIN Y REGISTRO)             */
/* ============================================= */

/* --- 2.1 Formulario de Inicio de Sesión --- */
.mlm-login-form-wrapper {
    max-width: 480px; margin: 50px auto; padding: 35px 40px;
    background-color: #ffffff; border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.07); border: 1px solid #e2e8f0;
}
.mlm-login-form-wrapper h3 { text-align: center; font-size: 26px; margin-bottom: 30px; border-bottom: none; }
#mlm_loginform label { display: block; font-weight: 500; color: #4a5568; margin-bottom: 8px; font-size: 14px; }
#mlm_loginform input[type="text"],
#mlm_loginform input[type="password"] {
    width: 100%; height: 50px; padding: 10px 15px; font-size: 16px;
    border: 1px solid #cbd5e0; border-radius: 6px; background-color: #f7fafc;
}
#mlm_loginform .login-submit input[type="submit"] {
    width: 100%; background-color: #FF6210; color: #ffffff; font-size: 16px;
    font-weight: 600; text-transform: uppercase; padding: 15px; border: none; border-radius: 6px;
}

/* --- 2.2 Formulario de Registro --- */
.mlm-registration-form-wrapper {
    max-width: 600px; margin: 40px auto; padding: 30px 40px; background: #fff;
    border-radius: 8px; box-shadow: 0 5px 15px rgba(0,0,0,0.08); border: 1px solid #e2e8f0;
}
.mlm-registration-form-wrapper .mlm-form-field { margin-bottom: 20px; }
.mlm-registration-form-wrapper label { display: block; margin-bottom: 8px; font-weight: 500; color: #4a5568; font-size: 14px; }
.mlm-registration-form-wrapper input[type="text"],
.mlm-registration-form-wrapper input[type="email"],
.mlm-registration-form-wrapper input[type="password"],
.mlm-registration-form-wrapper input[type="tel"] {
    width: 100%; height: 48px; padding: 10px 15px; border: 1px solid #cbd5e0;
    border-radius: 6px; background-color: #f7fafc;
}
.mlm-registration-form-wrapper .mlm-form-row-split { display: flex; gap: 20px; }
.mlm-registration-form-wrapper .mlm-form-row-split .mlm-form-field { flex: 1; }
.mlm-registration-form-wrapper .mlm-password-wrapper { position: relative; }
.mlm-registration-form-wrapper .toggle-password-visibility { position: absolute; top: 40px; right: 15px; cursor: pointer; color: #a0aec0; }
.mlm-registration-form-wrapper button[type="submit"] {
    width: 100%; background-color: #FF6210; color: #ffffff; font-size: 16px;
    font-weight: 600; padding: 15px; border: none; border-radius: 6px;
}

/* ============================================= */
/* 3. NAVEGACIÓN Y PESTAÑAS (TABS)               */
/* ============================================= */
.mlm-tabs-nav { display: flex; list-style: none; padding: 0; margin: 20px 0 -1px 0; border-bottom: 1px solid #ddd; flex-wrap: wrap; }
.mlm-tabs-nav a {
    padding: 10px 20px; display: block; text-decoration: none !important; color: #555;
    border: 1px solid #ddd; border-bottom: none; margin-right: 5px; border-radius: 5px 5px 0 0; background-color: #f1f1f1;
}
.mlm-tabs-nav a:hover { background-color: #e9e9e9; }
.mlm-tabs-nav a.active { background-color: #f56a00; border-color: #f56a00; color: white; font-weight: bold; }
.mlm-tab-pane { display: none; }
.mlm-tab-pane.active { display: block; }
.mlm-tabs-mobile-nav { display: none; margin-bottom: 20px; }
.mlm-mobile-select { width: 100%; padding: 12px; font-size: 16px; border: 1px solid #ddd; border-radius: 5px; background-color: #fff; }

/* ============================================= */
/* 4. COMPONENTES REUTILIZABLES                  */
/* ============================================= */
/* --- 4.1 Copiar Enlace --- */
.mlm-copy-wrapper { display: flex; cursor: pointer; border: 1px solid #ccc; border-radius: 4px; padding: 5px; }
.mlm-copy-wrapper.copied { border-color: #4CAF50; background-color: #e8f5e9; }
.mlm-copy-wrapper input[type="text"] { flex-grow: 1; border: none; box-shadow: none; outline: none; background: transparent; }
.copy-icon::after { content: 'Copiar'; padding: 5px 10px; color: #555; font-size: 0.9em; }
.mlm-copy-wrapper.copied .copy-icon::after { content: '¡Copiado!'; color: #4CAF50; font-weight: bold; }

/* --- 4.2 Botones de Compartir --- */
.mlm-share-buttons { display: flex; flex-wrap: wrap; gap: 15px; margin-top: 15px; }
.mlm-share-buttons .button { display: inline-flex; align-items: center; gap: 8px; text-decoration: none !important; color: white !important; padding: 12px 20px !important; border-radius: 8px !important; font-weight: bold; border: none; }
.mlm-share-buttons .button-whatsapp { background-color: #25D366 !important; }
.mlm-share-buttons .button-facebook { background-color: #1877F2 !important; }

/* --- 4.3 Listas de Contacto --- */
.mlm-contact-list { list-style: none; padding: 0; }
.mlm-contact-list li { display: flex; justify-content: space-between; align-items: center; padding: 15px; border-bottom: 1px solid #eee; gap: 15px; }
.mlm-contact-list li:last-child { border-bottom: none; }
.mlm-contact-list .contact-info { display: flex; flex-direction: column; }
.mlm-contact-list .contact-info span { color: #555; font-size: 0.9em; }
.mlm-contact-list .contact-actions { display: flex; gap: 10px; white-space: nowrap; }
.mlm-contact-list .contact-actions .button { padding: 5px 10px; font-size: 0.9em; color: white; border-radius: 3px; }
.contact-actions .contact-button { background-color: #6c757d; }
.contact-actions .button-whatsapp { background-color: #25D366; }

/* ============================================= */
/* 5. SECCIONES ESPECÍFICAS DEL PANEL            */
/* ============================================= */

/* --- 5.1 Finanzas --- */
.mlm-finance-grid, .secondary-balance-boxes { display: flex; flex-wrap: wrap; gap: 20px; }
.main-balance-box { flex-basis: 100%; background-color: #eef7ff; }
.secondary-balance-boxes { flex-basis: 100%; }
.summary-box { flex-grow: 1; background-color: #f1f1f1; padding: 20px; border-radius: 5px; text-align: center; }
.summary-box h4 { margin: 0 0 10px 0; font-size: 1em; color: #555; border: none; padding: 0;}
.summary-box span { font-size: 1.8em; font-weight: bold; color: #000; }
.main-balance-box span { font-size: 2.2em; }
.mlm-commissions-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.mlm-commissions-table th, 
.mlm-commissions-table td { text-align: left; padding: 12px; border-bottom: 1px solid #ddd; }
.mlm-commissions-table th { background-color: #f8f8f8; }
.commission-status { padding: 4px 8px; border-radius: 12px; font-size: 0.8em; font-weight: bold; color: white; }
.status-pending { background-color: #ffc107; color: #000; }
.status-paid { background-color: #28a745; }
.status-cancelled { background-color: #dc3545; }
.status-processing_withdrawal { background-color: #17a2b8; }
.status-credited_wallet, .status-completed { background-color: #6f42c1; }
.status-withdrawn { background-color: #6c757d; }

/* --- 5.2 Árbol Visual --- */
/* ¡REGLA MEJORADA! Se define un alto y un fondo para asegurar el espacio. */
#mlm-chart-container {
    width: 100%;
    height: 70vh; /* Usa el 70% de la altura de la pantalla del dispositivo */
    min-height: 500px; /* Un mínimo para pantallas grandes */
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background-color: #fdfdfd;
}

/* --- 5.3 Centro de Notificaciones (ESTILOS MEJORADOS) --- */
.mlm-notification-center { position: relative; float: right; margin: 15px; }
#mlm-notification-bell { font-size: 24px; color: #555; text-decoration: none; position: relative; display: block; }
.mlm-notification-count {
    position: absolute; top: -5px; right: -10px; background-color: #d63638; color: white;
    border-radius: 50%; padding: 2px 6px; font-size: 10px; line-height: 1; border: 1px solid white;
}
.mlm-notification-dropdown {
    position: absolute; top: 100%; right: 0; width: 350px; max-height: 400px; overflow-y: auto;
    background-color: white; border: 1px solid #ddd; border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15); z-index: 1000;
}
.mlm-notification-header { padding: 10px 15px; font-weight: bold; border-bottom: 1px solid #eee; background-color: #f9f9f9; }
.mlm-notification-list { list-style: none; padding: 0; margin: 0; }
.mlm-notification-list li {
    padding: 12px 15px; border-bottom: 1px solid #f0f0f0; display: flex; align-items: center; gap: 15px;
}
.mlm-notification-list li:last-child { border-bottom: none; }
.mlm-notification-list li.unread { background-color: #eef7ff; }
.mlm-notification-list li .icon { font-size: 20px; flex-shrink: 0; width: 25px; text-align: center; }
.mlm-notification-list li .message { font-size: 14px; color: #333; line-height: 1.4; }
/* Iconos y colores para cada tipo de notificación */
.mlm-notification-list li .icon.fa-dollar-sign { color: #16a34a; } /* Verde para comisiones */
.mlm-notification-list li .icon.fa-user-plus { color: #2563eb; } /* Azul para referidos */
.mlm-notification-list li .icon.fa-check-circle { color: #9333ea; } /* Morado para retiros */
.mlm-notification-list li .icon.fa-info-circle { color: #64748b; } /* Gris para otros */


/* ============================================= */
/* 6. VISTA MÓVIL Y CORRECCIONES RESPONSIVAS     */
/* ============================================= */
@media (max-width: 768px) {
    .mlm-tabs-nav.desktop-tabs { display: none; }
    .mlm-tabs-mobile-nav { display: block; }
    .my-local-mlm-dashboard .mlm-section,
    .my-local-mlm-dashboard .mlm-tab-pane { padding: 15px; }
    .mlm-finance-grid, .secondary-balance-boxes { flex-direction: column; }
    .mlm-registration-form-wrapper .mlm-form-row-split { flex-direction: column; gap: 0; }
    
    .mlm-contact-list li { flex-direction: column; align-items: flex-start; gap: 12px; }
    .mlm-contact-list .contact-actions { width: 100%; margin-top: 10px; }
    .mlm-contact-list .contact-actions .button { flex-grow: 1; text-align: center; justify-content: center; }

    .mlm-commissions-table thead { display: none; }
    .mlm-commissions-table, .mlm-commissions-table tbody, .mlm-commissions-table tr, .mlm-commissions-table td { display: block; width: 100%; }
    .mlm-commissions-table tr { margin-bottom: 15px; border: 1px solid #ddd; border-radius: 5px; padding: 10px; }
    .mlm-commissions-table td { text-align: right; padding-left: 50%; position: relative; border-bottom: 1px solid #eee; }
    .mlm-commissions-table td:last-child { border-bottom: none; }
    .mlm-commissions-table td:before { content: attr(data-label); position: absolute; left: 10px; width: 45%; font-weight: bold; text-align: left; }
}