/* ========================================
   HOROLUMEN - PANEL DE USUARIO CON TRACKING
   Estilos Unificados v3.0 - Noviembre 2025
   ======================================== */

/* Importar Sistema de Diseño Unificado */
@import url('../../../astrologia-cosmica/assets/css/unified-design-system.css');

/* Variables Específicas del Panel */
:root {
    --acpu-primary: var(--primary);
    --acpu-secondary: var(--secondary);
    --acpu-accent: var(--tertiary);
    --acpu-success: #10b981;
    --acpu-warning: #f59e0b;
    --acpu-danger: #ef4444;
    --acpu-dark: var(--background-primary);
    --acpu-light: var(--text-primary);
    --acpu-border: var(--border-primary);
    --acpu-glow: var(--shadow-glow);
}

/* ============================================
   WRAPPER PRINCIPAL
   ============================================ */
.acpu-panel-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    background: linear-gradient(135deg, #0b0f1a 0%, #1a1f3a 100%);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.acpu-panel-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(109, 40, 217, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(37, 99, 235, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* ============================================
   HEADER DEL PANEL
   ============================================ */
.acpu-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
    position: relative;
    z-index: 1;
}

.acpu-panel-title {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-300, #bbbaf6) 0%, var(--secondary-200, #8a8ab5) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.acpu-panel-stats {
    display: flex;
    gap: 20px;
    align-items: center;
}

.acpu-stat {
    text-align: center;
    padding: 12px 20px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid var(--acpu-border);
    border-radius: 12px;
}

.acpu-stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-300, #bbbaf6);
}

.acpu-stat-label {
    display: block;
    font-size: 12px;
    color: #cbd5e1;
    margin-top: 4px;
}

.acpu-refresh-btn {
    background: linear-gradient(135deg, var(--primary-700, #555490) 0%, var(--secondary, #3c3c84) 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.acpu-refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--acpu-glow);
}

.acpu-refresh-icon {
    transition: transform 0.5s;
}

.acpu-refresh-btn.rotating .acpu-refresh-icon {
    animation: acpu-spin 1s linear infinite;
}

@keyframes acpu-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   SECCIONES
   ============================================ */
.acpu-panel-section {
    margin-bottom: 50px;
    position: relative;
    z-index: 1;
}

.acpu-section-title {
    font-size: 24px;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--acpu-border);
}

/* ============================================
   GRID DE MÓDULOS
   ============================================ */
.acpu-modules-grid {
    display: grid;
    gap: 24px;
}

.acpu-grid-cards {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.acpu-grid-compact {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.acpu-module-card {
    background: rgba(17, 24, 39, 0.8);
    border: 1px solid var(--acpu-border);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.acpu-module-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--module-color), transparent);
    opacity: 0.8;
}

.acpu-module-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
    border-color: var(--module-color);
}

.acpu-module-icon {
    font-size: 48px;
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.acpu-module-title {
    font-size: 20px;
    font-weight: 700;
    color: #e2e8f0;
    margin: 0 0 8px 0;
}

.acpu-module-subtitle {
    font-size: 14px;
    color: #94a3b8;
    margin: 0 0 12px 0;
}

.acpu-module-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.acpu-status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.acpu-status-generated {
    background: rgba(5, 150, 105, 0.2);
    color: #6ee7b7;
}

.acpu-status-pending {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.acpu-status-locked {
    background: rgba(220, 38, 38, 0.2);
    color: #fca5a5;
}

.acpu-module-date {
    font-size: 12px;
    color: #64748b;
}

.acpu-module-excerpt {
    font-size: 14px;
    color: #94a3b8;
    line-height: 1.6;
    margin: 12px 0;
}

.acpu-module-actions {
    margin-top: 16px;
}

.acpu-module-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(11, 15, 26, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.acpu-lock-icon {
    font-size: 64px;
    opacity: 0.5;
}

/* ============================================
   BOTONES
   ============================================ */
.acpu-btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    text-align: center;
}

.acpu-btn-primary {
    background: linear-gradient(135deg, var(--primary-700, #555490) 0%, var(--secondary, #3c3c84) 100%);
    color: white;
}

.acpu-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--acpu-glow);
}

.acpu-btn-secondary {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
    border: 1px solid var(--acpu-border);
}

.acpu-btn-accent {
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
    color: white;
}

.acpu-btn-gradient {
    background: linear-gradient(135deg, #a78bfa 0%, #60a5fa 50%, #34d399 100%);
    background-size: 200% auto;
    color: white;
    animation: acpu-gradient-shift 3s ease infinite;
}

@keyframes acpu-gradient-shift {

    0%,
    100% {
        background-position: 0% center;
    }

    50% {
        background-position: 100% center;
    }
}

.acpu-btn-locked {
    background: rgba(220, 38, 38, 0.2);
    color: #fca5a5;
    cursor: not-allowed;
}

.acpu-btn-lg {
    padding: 16px 32px;
    font-size: 18px;
}

/* ============================================
   SUSCRIPCIONES
   ============================================ */
.acpu-subscriptions-list {
    display: grid;
    gap: 20px;
}

.acpu-subscription-card {
    background: rgba(17, 24, 39, 0.8);
    border: 1px solid var(--acpu-border);
    border-radius: 16px;
    padding: 24px;
}

.acpu-sub-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.acpu-sub-plan {
    font-size: 22px;
    font-weight: 700;
    color: #e2e8f0;
    margin: 0;
}

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

.acpu-sub-detail {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.acpu-detail-label {
    font-size: 12px;
    color: #94a3b8;
    text-transform: uppercase;
}

.acpu-detail-value {
    font-size: 16px;
    color: #e2e8f0;
    font-weight: 600;
}

.acpu-amount {
    color: #6ee7b7;
}

.acpu-sub-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ============================================
   BADGES
   ============================================ */
.acpu-badge {
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.acpu-badge-success {
    background: rgba(5, 150, 105, 0.2);
    color: #6ee7b7;
}

.acpu-badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.acpu-badge-danger {
    background: rgba(220, 38, 38, 0.2);
    color: #fca5a5;
}

.acpu-badge-info {
    background: rgba(37, 99, 235, 0.2);
    color: #93c5fd;
}

.acpu-badge-secondary {
    background: rgba(100, 116, 139, 0.2);
    color: #cbd5e1;
}

/* ============================================
   TABLA DE PAGOS
   ============================================ */
.acpu-payments-table {
    overflow-x: auto;
}

.acpu-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(17, 24, 39, 0.8);
    border-radius: 12px;
    overflow: hidden;
}

.acpu-table thead tr {
    background: rgba(109, 40, 217, 0.1);
}

.acpu-table th {
    padding: 16px;
    text-align: left;
    font-weight: 700;
    color: #a78bfa;
    text-transform: uppercase;
    font-size: 12px;
}

.acpu-table td {
    padding: 16px;
    border-top: 1px solid var(--acpu-border);
    color: #e2e8f0;
}

.acpu-link-invoice {
    color: #60a5fa;
    text-decoration: none;
    transition: color 0.3s;
}

.acpu-link-invoice:hover {
    color: #93c5fd;
}

/* ============================================
   UPGRADES
   ============================================ */
.acpu-upgrades-section {
    display: grid;
    gap: 24px;
}

.acpu-upgrade-card {
    background: linear-gradient(135deg, rgba(109, 40, 217, 0.1) 0%, rgba(37, 99, 235, 0.1) 100%);
    border: 2px solid var(--acpu-border);
    border-radius: 16px;
    padding: 32px;
}

.acpu-upgrade-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.acpu-upgrade-title {
    font-size: 26px;
    font-weight: 700;
    color: #e2e8f0;
    margin: 0;
}

.acpu-upgrade-price {
    text-align: right;
}

.acpu-price-amount {
    font-size: 32px;
    font-weight: 700;
    color: #6ee7b7;
}

.acpu-price-period {
    font-size: 14px;
    color: #94a3b8;
}

.acpu-upgrade-desc {
    color: #cbd5e1;
    margin-bottom: 20px;
    font-size: 16px;
}

.acpu-upgrade-benefits {
    margin-bottom: 24px;
}

.acpu-upgrade-benefits h4 {
    color: #a78bfa;
    margin-bottom: 12px;
}

.acpu-upgrade-benefits ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.acpu-upgrade-benefits li {
    padding: 8px 0;
    color: #e2e8f0;
    font-size: 15px;
}

/* ============================================
   RECOMENDACIONES
   ============================================ */
.acpu-recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.acpu-recommendation-card {
    background: rgba(17, 24, 39, 0.8);
    border: 1px solid var(--acpu-border);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    transition: all 0.3s;
}

.acpu-recommendation-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.acpu-rec-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.acpu-rec-title {
    font-size: 18px;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 12px;
}

.acpu-rec-desc {
    font-size: 14px;
    color: #94a3b8;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* ============================================
   ESTADOS VACÍOS
   ============================================ */
.acpu-empty-state {
    text-align: center;
    padding: 60px 20px;
}

.acpu-empty-icon {
    font-size: 72px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.acpu-empty-message {
    font-size: 16px;
    color: #94a3b8;
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ============================================
   LOGIN REQUERIDO
   ============================================ */
.acpu-login-required {
    text-align: center;
    padding: 80px 20px;
    background: rgba(17, 24, 39, 0.8);
    border-radius: 16px;
}

.acpu-login-icon {
    font-size: 72px;
    margin-bottom: 20px;
}

.acpu-login-required h3 {
    font-size: 28px;
    color: #e2e8f0;
    margin-bottom: 16px;
}

.acpu-login-required p {
    font-size: 16px;
    color: #94a3b8;
    margin-bottom: 32px;
}

/* ============================================
   LOADER
   ============================================ */
.acpu-panel-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(11, 15, 26, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 20px;
}

.acpu-loader-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(139, 92, 246, 0.2);
    border-top-color: #a78bfa;
    border-radius: 50%;
    animation: acpu-spin 1s linear infinite;
}

.acpu-loader-text {
    color: #cbd5e1;
    margin-top: 20px;
    font-size: 16px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .acpu-panel-header {
        flex-direction: column;
        text-align: center;
    }

    .acpu-panel-stats {
        flex-direction: column;
        width: 100%;
    }

    .acpu-stat {
        width: 100%;
    }

    .acpu-grid-cards,
    .acpu-grid-compact {
        grid-template-columns: 1fr;
    }

    .acpu-sub-details {
        grid-template-columns: 1fr;
    }

    .acpu-recommendations-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   NUEVOS ESTILOS PARA TRACKING 2025
   ============================================ */

/* Panel mejorado con tracking */
.astro-panel-enhanced {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: var(--font-family);
    background: var(--background-primary);
    color: var(--text-primary);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(142, 140, 240, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Header del panel */
.panel-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 20px;
    background: var(--button-gradient);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.panel-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.panel-subtitle {
    font-size: 1.1rem;
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
}

/* Estadísticas de actividad */
.activity-stats {
    margin-bottom: 40px;
    padding: 25px;
    background: var(--background-secondary);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.activity-stats h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-primary);
    text-align: center;
}

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

.stat-card {
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-card.critical {
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    color: white;
}

.stat-card.important {
    background: var(--button-gradient);
    color: white;
}

.stat-card.unused {
    background: linear-gradient(135deg, #bb6bd9, #c44569);
    color: white;
}

.stat-card.activity {
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    color: white;
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Secciones de módulos */
.used-modules,
.available-modules,
.recommendations {
    margin-bottom: 40px;
    padding: 25px;
    background: var(--background-secondary);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.used-modules h3,
.available-modules h3,
.recommendations h3 {
    font-size: 1.5rem;
    margin-bottom: 25px;
    color: var(--text-primary);
    text-align: center;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

/* Grillas de módulos */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Cards de módulos */
.module-card {
    padding: 20px;
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.module-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(142, 140, 240, 0.25);
}

.module-card.used.critical {
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    color: white;
}

.module-card.used.important {
    background: var(--button-gradient);
    color: white;
}

.module-card.available.critical {
    background: var(--background-primary);
    border-color: #ff6b6b;
    color: var(--text-primary);
}

.module-card.available.important {
    background: var(--background-primary);
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.module-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.module-icon {
    font-size: 1.8rem;
    margin-right: 12px;
}

.module-name {
    font-weight: 600;
    font-size: 1.1rem;
    flex: 1;
}

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

.usage-count {
    font-size: 0.9rem;
    opacity: 0.8;
}

.usage-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.usage-badge.explorado {
    background: rgba(255, 255, 255, 0.2);
}

.usage-badge.experto {
    background: #ffd700;
    color: #000;
}

.module-last-used {
    font-size: 0.8rem;
    opacity: 0.7;
    font-style: italic;
}

.module-category {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
    margin-bottom: 15px;
}

.module-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 15px;
    padding: 10px 0;
}

.tracking-info {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    background: rgba(142, 140, 240, 0.05);
    border-radius: 8px;
    border: 1px dashed var(--primary-color);
}

.tracking-info p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Botones de acción */
.explore-button,
.rec-action {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--button-gradient);
    color: white;
}

.explore-button:hover,
.rec-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(142, 140, 240, 0.4);
}

/* Cards de recomendaciones */
.recommendation-card {
    display: flex;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid var(--primary-color);
    background: var(--background-primary);
    transition: all 0.3s ease;
}

.recommendation-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 35px rgba(142, 140, 240, 0.2);
}

.recommendation-card.high {
    border-color: #ff6b6b;
}

.rec-icon {
    font-size: 2.5rem;
    margin-right: 20px;
    display: flex;
    align-items: center;
}

.rec-content {
    flex: 1;
}

.rec-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--text-primary);
}

.rec-description {
    font-size: 0.95rem;
    margin: 0 0 15px 0;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Mensaje adicional */
.more-modules {
    text-align: center;
    margin-top: 20px;
    font-style: italic;
    color: var(--text-secondary);
    padding: 15px;
    background: rgba(142, 140, 240, 0.05);
    border-radius: 8px;
    border: 1px dashed var(--primary-color);
}

.panel-welcome {
    text-align: center;
    padding: 40px 20px;
    background: var(--background-secondary);
    border-radius: var(--border-radius);
}

/* Responsive para tracking */
@media (max-width: 768px) {
    .astro-panel-enhanced {
        padding: 15px;
        margin: 10px;
    }

    .panel-title {
        font-size: 2rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .modules-grid {
        grid-template-columns: 1fr;
    }

    .recommendations-grid {
        grid-template-columns: 1fr;
    }

    .recommendation-card {
        flex-direction: column;
        text-align: center;
    }

    .rec-icon {
        margin-right: 0;
        margin-bottom: 15px;
        justify-content: center;
    }
}