/**
 * Resenas — Dark Tech Theme (matches tienda homepage)
 */

/* ── Reset & Base ── */
* { margin: 0; padding: 0; box-sizing: border-box; }

body.resenas-page {
    font-family: 'DM Sans', 'Inter', sans-serif;
    background: #080d1a;
    min-height: 100vh;
    color: #e2e8f0;
}

/* ── Header ── */
.resenas-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    padding: 2.5rem 0 2rem;
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(59, 130, 246, 0.15);
    padding-top: 2rem;
}

.resenas-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 600px 300px at 20% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 70%),
        radial-gradient(ellipse 400px 200px at 80% 30%, rgba(139, 92, 246, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.resenas-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

.header-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.header-icon i {
    font-size: 1.75rem;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-title {
    font-family: 'Urbanist', 'DM Sans', sans-serif;
    color: #f8fafc;
    font-size: 2rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.02em;
}

.header-subtitle {
    color: #94a3b8;
    margin: 0.25rem 0 0;
    font-size: 0.95rem;
}

.btn-back {
    background: rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.7rem 1.4rem;
    border-radius: 0.75rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.25s ease;
    font-weight: 500;
    font-size: 0.9rem;
    position: relative;
    z-index: 2;
}

.btn-back:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    color: #60a5fa;
    transform: translateX(-4px);
}

/* ── Container ── */
.resenas-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
}

/* ── Stats Cards ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(145deg, #111827, #0f172a);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.3), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(59, 130, 246, 0.2);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.stat-card:hover::before { opacity: 1; }

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-icon.pendientes {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.stat-icon.aprobadas {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.stat-icon.rechazadas {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.stat-icon.total {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.stat-icon.promedio {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.stat-value {
    font-family: 'Space Grotesk', 'DM Sans', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1;
}

.stat-label {
    color: #64748b;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* ── Section Cards ── */
.section-card {
    background: linear-gradient(145deg, #111827, #0f172a);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 1.5rem;
}

.section-title {
    font-family: 'Urbanist', 'DM Sans', sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.section-title i {
    color: #3b82f6;
}

/* ── Filter Buttons ── */
.filters-row {
    display: flex;
    gap: 0.625rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 0.625rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: #94a3b8;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 0.85rem;
    font-family: 'DM Sans', sans-serif;
}

.filter-btn:hover {
    border-color: rgba(59, 130, 246, 0.3);
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.08);
}

.filter-btn.active {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    border-color: #3b82f6;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.filter-btn .badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.15rem 0.5rem;
    border-radius: 0.375rem;
    margin-left: 0.4rem;
    font-size: 0.7rem;
}

.filter-btn:not(.active) .badge {
    background: rgba(255, 255, 255, 0.06);
    color: #94a3b8;
}

/* ── Table ── */
.resenas-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.resenas-table th {
    background: rgba(255, 255, 255, 0.03);
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.resenas-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
}

.resenas-table tr:hover {
    background: rgba(59, 130, 246, 0.04);
}

/* ── Review Row Elements ── */
.review-producto {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.review-producto-img {
    width: 48px;
    height: 48px;
    border-radius: 0.625rem;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #1e293b;
}

.review-producto-nombre {
    font-weight: 600;
    color: #e2e8f0;
    font-size: 0.875rem;
}

.review-usuario {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.review-avatar {
    width: 36px;
    height: 36px;
    border-radius: 0.625rem;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.review-stars {
    color: #fbbf24;
    font-size: 0.875rem;
}

.review-comentario {
    max-width: 250px;
    font-size: 0.84rem;
    color: #94a3b8;
    line-height: 1.5;
}

.review-fecha {
    color: #475569;
    font-size: 0.8rem;
    font-family: 'Space Grotesk', monospace;
}

/* ── Status Badges ── */
.status-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
}

.status-pendiente {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.status-aprobada {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-rechazada {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ── Action Buttons ── */
.action-btns {
    display: flex;
    gap: 0.4rem;
}

.action-btn {
    width: 34px;
    height: 34px;
    border-radius: 0.5rem;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
}

.action-btn.aprobar {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.15);
}
.action-btn.aprobar:hover {
    background: #10b981;
    color: #fff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.action-btn.rechazar {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.15);
}
.action-btn.rechazar:hover {
    background: #ef4444;
    color: #fff;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.action-btn.responder {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.15);
}
.action-btn.responder:hover {
    background: #3b82f6;
    color: #fff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.action-btn.eliminar {
    background: rgba(255, 255, 255, 0.04);
    color: #475569;
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.action-btn.eliminar:hover {
    background: #ef4444;
    color: #fff;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* ── Charts Grid ── */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.chart-container {
    height: 300px;
}

/* ── Top Products ── */
.top-producto-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.top-producto-item:last-child { border-bottom: none; }

.top-producto-rank {
    width: 30px;
    height: 30px;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Grotesk', monospace;
    font-weight: 700;
    font-size: 0.8rem;
    color: #64748b;
    flex-shrink: 0;
}

.top-producto-rank.gold {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.top-producto-rank.silver {
    background: rgba(148, 163, 184, 0.12);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.top-producto-rank.bronze {
    background: rgba(249, 115, 22, 0.12);
    color: #fb923c;
    border: 1px solid rgba(249, 115, 22, 0.2);
}

.top-producto-img {
    width: 44px;
    height: 44px;
    border-radius: 0.625rem;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #1e293b;
}

.top-producto-info { flex: 1; min-width: 0; }

.top-producto-nombre {
    font-weight: 600;
    font-size: 0.875rem;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-producto-stats {
    font-size: 0.8rem;
    color: #64748b;
}

.top-producto-rating {
    color: #fbbf24;
    font-weight: 700;
}

/* ── Modal (dark) ── */
.modal-content {
    background: #111827;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    color: #e2e8f0;
}

.modal-header {
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1rem 1rem 0 0;
    padding: 1.25rem 1.5rem;
}

.modal-title {
    font-family: 'Urbanist', sans-serif;
    font-weight: 700;
    color: #f1f5f9;
}

.modal-body { padding: 1.5rem; }

.modal-body .form-label { color: #94a3b8; }

.modal-body .form-control {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    border-radius: 0.625rem;
}

.modal-body .form-control:focus {
    background: rgba(59, 130, 246, 0.05);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    color: #f1f5f9;
}

.modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 1rem 1.5rem;
}

.modal-footer .btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
}

.modal-footer .btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: none;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* ── Toast ── */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast-custom {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    padding: 0.875rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    color: #e2e8f0;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast-icon {
    width: 34px;
    height: 34px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-icon.success {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.toast-icon.error {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #475569;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.4;
    color: #334155;
}

.empty-state p {
    color: #64748b;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

/* ── Responsive ── */
@media (max-width: 1024px) {
    .charts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .resenas-header { padding-top: 80px; }

    .header-content {
        flex-direction: column;
        text-align: center;
    }

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

    .resenas-table {
        display: block;
        overflow-x: auto;
    }

    .resenas-container { padding: 1rem 1rem 2rem; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .header-title { font-size: 1.5rem; }
}
