@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

:root {
    /* Paleta Moderna - Modo Claro */
    --bg-color: #f0f2f5;
    --text-color: #2d3748;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --primary-color: #4f46e5;
    /* Indigo vibrante */
    --primary-hover: #4338ca;
    --secondary-color: #10b981;
    /* Verde esmeralda */
    --accent-color: #f59e0b;
    /* Ambar */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 0.75rem;
}

body.tema-oscuro {
    /* Paleta Moderna - Modo Oscuro con MEJOR CONTRASTE */
    --bg-color: #0f172a;
    --text-color: #e2e8f0;
    --card-bg: #1e293b;
    --border-color: #334155;
    --primary-color: #818cf8;
    --primary-hover: #a5b4fc;
    --secondary-color: #34d399;
    --accent-color: #fbbf24;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Componentes Generales */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    border-radius: 0.5rem;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

.form-control,
.form-select {
    background-color: var(--bg-color);
    color: var(--text-color);
    border-color: var(--border-color);
    border-radius: 0.5rem;
    padding: 0.6rem;
}

body.tema-oscuro .form-control,
body.tema-oscuro .form-select {
    background-color: #334155;
    color: #f1f5f9;
    border-color: #475569;
}

body.tema-oscuro .form-control:focus {
    background-color: #475569;
    color: #f1f5f9;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(129, 140, 248, 0.25);
}

/* Mejorar contraste de textos en modo oscuro */
body.tema-oscuro h1,
body.tema-oscuro h2,
body.tema-oscuro h3,
body.tema-oscuro h4,
body.tema-oscuro h5,
body.tema-oscuro h6 {
    color: #f1f5f9;
}

body.tema-oscuro .text-muted {
    color: #cbd5e1 !important;
}

body.tema-oscuro .lead {
    color: #e2e8f0;
}

body.tema-oscuro p {
    color: #e2e8f0;
}

body.tema-oscuro a {
    color: #a5b4fc;
}

body.tema-oscuro a:hover {
    color: #c7d2fe;
}

body.tema-oscuro .card {
    color: #e2e8f0;
}

body.tema-oscuro .btn-outline-secondary {
    color: #e2e8f0;
    border-color: #475569;
}

body.tema-oscuro .btn-outline-secondary:hover {
    background-color: #475569;
    color: #f1f5f9;
}

body.tema-oscuro .badge {
    color: #0f172a;
}

body.tema-oscuro footer a {
    color: #94a3b8;
    text-decoration: none;
}

body.tema-oscuro footer a:hover {
    color: #cbd5e1;
}

/* Imágenes de Producto */
.imagen-producto-contenedor {
    width: 100%;
    height: 280px;
    overflow: hidden;
    background-color: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
}

.imagen-producto {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card:hover .imagen-producto {
    transform: scale(1.05);
}

/* Botón WhatsApp */
.btn-whatsapp {
    background-color: #25D366;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: background-color 0.2s;
}

.btn-whatsapp:hover {
    background-color: #128C7E;
    color: white;
}

/* Comentarios y Calificaciones */
.comentario-card {
    background-color: var(--bg-color);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-left: 4px solid var(--primary-color);
}

.calificacion-badge {
    background-color: var(--accent-color);
    color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: bold;
    font-size: 0.9rem;
}

/* Contadores Home */
.contador-box {
    text-align: center;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.contador-numero {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.contador-label {
    font-size: 1.1rem;
    color: var(--text-color);
    opacity: 0.8;
}

/* Testimonios */
.testimonio-card {
    height: 100%;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    position: relative;
}

.testimonio-quote {
    font-size: 1.1rem;
    font-style: italic;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.testimonio-autor {
    font-weight: 700;
    color: var(--primary-color);
}

/* Accordion en modo oscuro */
body.tema-oscuro .accordion-item {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

body.tema-oscuro .accordion-button {
    background-color: var(--card-bg);
    color: #f1f5f9;
}

body.tema-oscuro .accordion-button:not(.collapsed) {
    background-color: #334155;
    color: #f1f5f9;
}

body.tema-oscuro .accordion-body {
    background-color: var(--card-bg);
    color: #e2e8f0;
}

/* ========== ESTILOS PANEL ADMINISTRADOR ========== */

/* Tarjetas KPI */
.kpi-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.kpi-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
}

.kpi-content {
    flex: 1;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text-color);
}

.kpi-value-small {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.kpi-label {
    font-size: 0.875rem;
    color: var(--text-color);
    opacity: 0.7;
    margin-top: 0.25rem;
}

/* Tablas Admin */
.admin-table {
    background-color: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
}

.admin-table thead {
    background-color: var(--primary-color);
    color: white;
}

.admin-table thead th {
    border: none;
    padding: 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.admin-table tbody tr:hover {
    background-color: rgba(79, 70, 229, 0.05);
}

body.tema-oscuro .admin-table tbody tr:hover {
    background-color: rgba(129, 140, 248, 0.1);
}

.admin-table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

/* Tarjetas de Testimonios Admin */
.testimonio-admin-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.testimonio-admin-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

/* Responsive para KPIs */
@media (max-width: 768px) {
    .kpi-card {
        padding: 1rem;
    }

    .kpi-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }

    .kpi-value {
        font-size: 1.5rem;
    }

    line-height: 1;
    margin-bottom: 0.5rem;
}

.contador-label {
    font-size: 1.1rem;
    color: var(--text-color);
    opacity: 0.8;
}

/* Testimonios */
.testimonio-card {
    height: 100%;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    position: relative;
}

.testimonio-quote {
    font-size: 1.1rem;
    font-style: italic;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.testimonio-autor {
    font-weight: 700;
    color: var(--primary-color);
}

/* Accordion en modo oscuro */
body.tema-oscuro .accordion-item {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

body.tema-oscuro .accordion-button {
    background-color: var(--card-bg);
    color: #f1f5f9;
}

body.tema-oscuro .accordion-button:not(.collapsed) {
    background-color: #334155;
    color: #f1f5f9;
}

body.tema-oscuro .accordion-body {
    background-color: var(--card-bg);
    color: #e2e8f0;
}

/* ========== ESTILOS PANEL ADMINISTRADOR ========== */

/* Tarjetas KPI */
.kpi-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.kpi-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
}

.kpi-content {
    flex: 1;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text-color);
}

.kpi-value-small {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.kpi-label {
    font-size: 0.875rem;
    color: var(--text-color);
    opacity: 0.7;
    margin-top: 0.25rem;
}

/* Tablas Admin */
.admin-table {
    background-color: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
}

.admin-table thead {
    background-color: var(--primary-color);
    color: white;
}

.admin-table thead th {
    border: none;
    padding: 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.admin-table tbody tr:hover {
    background-color: rgba(79, 70, 229, 0.05);
}

body.tema-oscuro .admin-table tbody tr:hover {
    background-color: rgba(129, 140, 248, 0.1);
}

.admin-table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

/* Tarjetas de Testimonios Admin */
.testimonio-admin-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.testimonio-admin-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

/* Responsive para KPIs */
@media (max-width: 768px) {
    .kpi-card {
        padding: 1rem;
    }

    .kpi-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }

    .kpi-value {
        font-size: 1.5rem;
    }

    .kpi-value-small {
        font-size: 1.25rem;
    }
}

/* Mejoras para modo oscuro en tablas */
body.tema-oscuro .admin-table {
    color: #e2e8f0;
}

body.tema-oscuro .admin-table thead {
    background-color: #334155;
}

body.tema-oscuro .table-hover tbody tr:hover {
    background-color: rgba(129, 140, 248, 0.1);
}

/* Botones de acción en tablas */
.btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.btn-group-sm .btn i {
    font-size: 0.875rem;
}

.admin-table .btn-group {
    white-space: nowrap;
}

.admin-table .btn-outline-info:hover {
    color: #fff;
    background-color: #0dcaf0;
    border-color: #0dcaf0;
}

.admin-table .btn-outline-primary:hover {
    color: #fff;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.admin-table .btn-outline-danger:hover {
    color: #fff;
    background-color: #dc3545;
    border-color: #dc3545;
}

/* Responsive para tablas con acciones */
@media (max-width: 768px) {
    .admin-table {
        font-size: 0.875rem;
    }

    .admin-table .btn-group-sm .btn {
        padding: 0.2rem 0.4rem;
        font-size: 0.75rem;
    }

    .admin-table .btn-group-sm .btn i {
        font-size: 0.75rem;
    }
}