/**
 * Estilos compartidos para tarjetas de planes SaaS
 * Usado en: /admin-dashboard/saas/planes y /saas/planes
 */

/* === GRID DE PLANES === */
.planes-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

@media (max-width: 1400px) {
    .planes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .planes-grid {
        grid-template-columns: 1fr;
    }
}

/* === TARJETA DE PLAN === */
.plan-card {
    background: var(--card-bg, var(--tema-fondo-panel, #ffffff));
    border-radius: 24px;
    padding: 0;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    position: relative;
    transition: all 0.3s ease;
    border: 2px solid var(--border-color, var(--tema-borde-color, #e5e7eb));
    overflow: hidden;
}

.plan-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.plan-card.destacado {
    border-color: var(--primary-color, #4f46e5);
    box-shadow: 0 8px 32px rgba(79, 70, 229, 0.2);
}

.plan-card.actual {
    border-color: #28a745;
    box-shadow: 0 8px 32px rgba(40, 167, 69, 0.2);
}

/* === BORDES SEGÚN TIPO DE PLAN === */
.plan-card.gratuito {
    border-color: #6c757d !important;
}

.plan-card.basico {
    border-color: #0d6efd !important;
}

.plan-card.profesional {
    border-color: #28a745 !important;
}

.plan-card.agencia {
    border-color: #fd7e14 !important;
}

/* === ETIQUETA DEL PLAN (HEADER) === */
.etiqueta-plan {
    display: block;
    width: 100%;
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color, #4f46e5) 0%, #7c3aed 100%);
    color: #ffffff !important;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Etiqueta plan actual (verde) */
.etiqueta-plan.etiqueta-actual {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
}

/* Etiqueta plan gratuito (gris) */
.etiqueta-plan.etiqueta-gratuito {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%) !important;
    color: #ffffff !important;
}

/* Etiqueta plan básico (azul) */
.etiqueta-plan.etiqueta-basico {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%) !important;
    color: #ffffff !important;
}

/* Etiqueta plan profesional (verde) */
.etiqueta-plan.etiqueta-profesional {
    background: linear-gradient(135deg, #28a745 0%, #20803a 100%) !important;
    color: #ffffff !important;
}

/* Etiqueta plan agencia (naranja) */
.etiqueta-plan.etiqueta-agencia {
    background: linear-gradient(135deg, #fd7e14 0%, #e56b00 100%) !important;
    color: #ffffff !important;
}

/* === CUERPO DE LA TARJETA === */
.plan-card-body {
    padding: 1.5rem;
}

/* === HEADER CON ICONO Y DESCRIPCIÓN === */
.plan-header-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.plan-icono {
    width: 56px;
    height: 56px;
    min-width: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Colores de iconos por tipo de plan */
.plan-icono.icono-gratuito {
    background: #6c757d20 !important;
    color: #6c757d !important;
}

.plan-icono.icono-basico {
    background: #0d6efd20 !important;
    color: #0d6efd !important;
}

.plan-icono.icono-profesional {
    background: #28a74520 !important;
    color: #28a745 !important;
}

.plan-icono.icono-agencia {
    background: #fd7e1420 !important;
    color: #fd7e14 !important;
}

.plan-header-info {
    flex: 1;
}

.plan-nombre {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary, var(--tema-texto-primario, #1f2937));
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.plan-descripcion {
    font-size: 0.95rem;
    color: var(--text-secondary, var(--tema-texto-secundario, #6b7280));
    margin: 0;
    line-height: 1.4;
}

/* === PRECIO === */
.plan-precio {
    margin-bottom: 1rem;
}

.plan-precio .monto {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-primary, var(--tema-texto-primario, #1f2937));
}

.plan-precio .periodo {
    font-size: 1rem;
    color: var(--text-secondary, var(--tema-texto-secundario, #6b7280));
}

.plan-precio .gratis {
    font-size: 2rem;
    font-weight: 700;
    color: #28a745;
}

.gratis-subtexto {
    display: block;
    font-size: 1rem;
    color: #28a745;
    font-weight: 600;
    margin-top: -0.25rem;
    margin-bottom: 0.75rem;
}

/* === LISTA DE CARACTERÍSTICAS === */
.plan-caracteristicas {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem 0;
}

.plan-caracteristicas li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.4rem 0;
    font-size: 0.95rem;
    color: var(--text-secondary, var(--tema-texto-secundario, #6b7280));
}

.plan-caracteristicas li i {
    color: #28a745;
    margin-top: 3px;
    flex-shrink: 0;
    font-size: 1rem;
}

.plan-caracteristicas li.no-incluido {
    opacity: 0.5;
}

.plan-caracteristicas li.no-incluido i {
    color: #dc3545;
}

/* === ESTADO DEL PLAN === */
.plan-estado {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-bottom: 1rem;
    border-top: 1px solid var(--border-color, var(--tema-borde-color, #e5e7eb));
    border-bottom: 1px solid var(--border-color, var(--tema-borde-color, #e5e7eb));
    font-size: 0.95rem;
}

.plan-estado .estado-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* === BOTONES DE ACCIÓN === */
.plan-acciones {
    display: grid;
    gap: 0.75rem;
}

.btn-plan {
    width: 100%;
    padding: 0.85rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.btn-plan-primario {
    background: var(--primary-color, #4f46e5);
    color: white;
    border: none;
}

.btn-plan-primario:hover {
    background: var(--primary-dark, #4338ca);
    color: white;
    transform: translateY(-2px);
}

.btn-plan-secundario {
    background: transparent;
    color: var(--text-secondary, #6b7280);
    border: 1px solid var(--border-color, #e5e7eb);
}

.btn-plan-secundario:hover {
    background: var(--hover-bg, #f3f4f6);
    color: var(--text-primary, #1f2937);
}

/* === TEMA OSCURO === */
[data-theme="dark"] .plan-card,
.tema-oscuro .plan-card {
    background: #1f2937;
    border-color: #374151;
}

[data-theme="dark"] .plan-card.gratuito,
.tema-oscuro .plan-card.gratuito {
    border-color: #6c757d;
}

[data-theme="dark"] .plan-card.basico,
.tema-oscuro .plan-card.basico {
    border-color: #0d6efd;
}

[data-theme="dark"] .plan-card.profesional,
.tema-oscuro .plan-card.profesional {
    border-color: #28a745;
}

[data-theme="dark"] .plan-card.agencia,
.tema-oscuro .plan-card.agencia {
    border-color: #fd7e14;
}

[data-theme="dark"] .plan-nombre,
.tema-oscuro .plan-nombre {
    color: #f9fafb;
}

[data-theme="dark"] .plan-descripcion,
.tema-oscuro .plan-descripcion {
    color: #9ca3af;
}

[data-theme="dark"] .plan-precio .monto,
.tema-oscuro .plan-precio .monto {
    color: #f9fafb;
}

[data-theme="dark"] .plan-caracteristicas li,
.tema-oscuro .plan-caracteristicas li {
    color: #9ca3af;
}

[data-theme="dark"] .plan-estado,
.tema-oscuro .plan-estado {
    border-color: #374151;
}

[data-theme="dark"] .btn-plan-secundario,
.tema-oscuro .btn-plan-secundario {
    border-color: #374151;
    color: #9ca3af;
}

[data-theme="dark"] .btn-plan-secundario:hover,
.tema-oscuro .btn-plan-secundario:hover {
    background: #374151;
    color: #f9fafb;
}
