/* =============================================
   RASTRAR EXPLORER - CSS Principal
   Versión: 2.0
   ============================================= */

/* =============================================
   VARIABLES Y TEMAS
   ============================================= */
:root {
    /* Tema Oscuro (default) */
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: rgba(26, 26, 46, 0.95);
    --bg-card-hover: rgba(36, 36, 56, 0.95);
    
    --text-primary: #ffffff;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
    
    --accent-primary: #65C3C8;
    --accent-secondary: #4CAF50;
    --accent-warning: #f59e0b;
    --accent-danger: #ff6b6b;
    --accent-info: #3b82f6;
    
    --border-color: rgba(101, 195, 200, 0.2);
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    --gradient-primary: linear-gradient(135deg, #65C3C8 0%, #4CAF50 100%);
    --gradient-bg: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #16213e 100%);
}

/* Tema Claro */
[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-card-hover: rgba(248, 250, 252, 0.95);
    
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --border-color: rgba(0, 0, 0, 0.1);
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
    
    --gradient-bg: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #cbd5e1 100%);
}

/* =============================================
   RESET Y BASE
   ============================================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gradient-bg);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    transition: background var(--transition-normal), color var(--transition-normal);
}

/* =============================================
   FONDO ANIMADO
   ============================================= */
.bg-animated {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: var(--gradient-bg);
}

.bg-animated::before,
.bg-animated::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    opacity: 0.1;
    animation: float 20s infinite ease-in-out;
}

.bg-animated::before {
    background: var(--accent-primary);
    top: -100px;
    left: -100px;
}

.bg-animated::after {
    background: var(--accent-secondary);
    bottom: -100px;
    right: -100px;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(50px, 50px) scale(1.1); }
    50% { transform: translate(0, 100px) scale(1); }
    75% { transform: translate(-50px, 50px) scale(0.9); }
}

/* =============================================
   HEADER
   ============================================= */
.header-bar {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-small img {
    height: 32px;
    transition: transform var(--transition-fast);
}

.logo-small:hover img {
    transform: scale(1.05);
}

/* =============================================
   BOTONES
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: rgba(101, 195, 200, 0.15);
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
}

.btn-secondary:hover {
    background: rgba(101, 195, 200, 0.25);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
}

/* =============================================
   CONTENEDOR PRINCIPAL
   ============================================= */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* =============================================
   CARDS
   ============================================= */
.content-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    transition: all var(--transition-normal);
}

.content-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
}

/* =============================================
   BANNER DE VERIFICACIÓN
   ============================================= */
.verification-banner {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.2) 0%, rgba(101, 195, 200, 0.2) 100%);
    border: 1px solid rgba(76, 175, 80, 0.4);
    border-radius: var(--border-radius-lg);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.banner-icon {
    width: 48px;
    height: 48px;
    background: var(--accent-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    flex-shrink: 0;
}

.banner-title {
    font-weight: 600;
    font-size: 16px;
    color: var(--accent-secondary);
}

.banner-text {
    font-size: 14px;
    color: var(--text-secondary);
}

/* =============================================
   HERO DE PRODUCTO/ENTIDAD
   ============================================= */
.product-hero {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 32px;
    align-items: start;
}

@media (max-width: 768px) {
    .product-hero {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

.product-image-container {
    width: 200px;
    height: 200px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.product-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-main-info h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 16px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* =============================================
   TAGS
   ============================================= */
.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.tag {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    background: rgba(101, 195, 200, 0.15);
    color: var(--accent-primary);
    border: 1px solid rgba(101, 195, 200, 0.3);
}

.tag-secondary {
    background: rgba(76, 175, 80, 0.15);
    color: var(--accent-secondary);
    border-color: rgba(76, 175, 80, 0.3);
}

.tag-info {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-info);
    border-color: rgba(59, 130, 246, 0.3);
}

/* =============================================
   GRID DE INFORMACIÓN
   ============================================= */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.info-item {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}

.info-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.info-value {
    font-size: 14px;
    color: var(--text-primary);
    word-break: break-word;
}

.info-value a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.info-value a:hover {
    color: var(--accent-secondary);
}

/* =============================================
   SECCIÓN TÍTULOS
   ============================================= */
.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.section-title i {
    color: var(--accent-primary);
}

/* =============================================
   BARCODE
   ============================================= */
.batch-barcode-gtin {
    background: white;
    padding: 12px;
    border-radius: var(--border-radius-sm);
    margin-top: 16px;
    cursor: pointer;
    transition: transform var(--transition-fast);
    display: inline-block;
}

.batch-barcode-gtin:hover {
    transform: scale(1.02);
}

/* =============================================
   SWITCH TEMA
   ============================================= */
.theme-switch {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-switch-input {
    display: none;
}

.theme-switch-label {
    width: 50px;
    height: 26px;
    background: var(--bg-secondary);
    border-radius: 13px;
    position: relative;
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
}

.theme-switch-label::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--accent-primary);
    border-radius: 50%;
    top: 2px;
    left: 3px;
    transition: all var(--transition-normal);
}

.theme-switch-input:checked + .theme-switch-label::after {
    transform: translateX(23px);
}

.theme-icon {
    font-size: 16px;
    color: var(--text-muted);
}

/* =============================================
   BARRA LATERAL DE VERIFICACIÓN
   ============================================= */
.verification-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--border-color);
    z-index: 1000;
    transition: right var(--transition-slow) cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.verification-sidebar.open {
    right: 0;
}

/* Tab lateral para abrir */
.verification-tab {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    background: var(--gradient-primary);
    color: white;
    padding: 20px 12px;
    border-radius: 12px 0 0 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 1px;
    z-index: 999;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-md);
}

.verification-tab:hover {
    padding-right: 18px;
}

.verification-tab i {
    writing-mode: horizontal-tb;
}

.verification-tab.hidden {
    right: -100px;
}

/* Header de la barra */
.sidebar-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.sidebar-header h3 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-header h3 i {
    color: var(--accent-primary);
}

.sidebar-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 107, 107, 0.15);
    color: var(--accent-danger);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.sidebar-close:hover {
    background: var(--accent-danger);
    color: white;
}

/* Contenido de la barra */
.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

/* Items de verificación */
.verification-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 16px;
    margin-bottom: 12px;
    transition: all var(--transition-normal);
}

.verification-item.success {
    border-color: rgba(76, 175, 80, 0.5);
    background: rgba(76, 175, 80, 0.1);
}

.verification-item.error {
    border-color: rgba(255, 107, 107, 0.5);
    background: rgba(255, 107, 107, 0.1);
}

.verification-item.pending {
    border-color: rgba(245, 158, 11, 0.5);
    background: rgba(245, 158, 11, 0.1);
}

.verification-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.verification-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.verification-item.success .verification-icon {
    background: var(--accent-secondary);
    color: white;
}

.verification-item.error .verification-icon {
    background: var(--accent-danger);
    color: white;
}

.verification-item.pending .verification-icon {
    background: var(--accent-warning);
    color: white;
}

.verification-title {
    font-weight: 600;
    font-size: 14px;
}

.verification-status {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: auto;
}

.verification-details {
    font-size: 12px;
    color: var(--text-secondary);
    padding-left: 44px;
}

.verification-details a {
    color: var(--accent-primary);
    text-decoration: none;
}

.verification-details code {
    background: var(--bg-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    word-break: break-all;
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Resumen de verificación */
.verification-summary {
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    margin-bottom: 20px;
    text-align: center;
}

.summary-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.summary-icon.success {
    background: var(--accent-secondary);
    color: white;
}

.summary-icon.partial {
    background: var(--accent-warning);
    color: white;
}

.summary-icon.error {
    background: var(--accent-danger);
    color: white;
}

.summary-icon.loading {
    background: var(--accent-info);
    color: white;
}

.summary-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
}

.summary-text {
    font-size: 13px;
    color: var(--text-muted);
}

/* Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.sidebar-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* =============================================
   UTILIDADES
   ============================================= */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--accent-secondary); }
.text-danger { color: var(--accent-danger); }
.text-warning { color: var(--accent-warning); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.hidden { display: none !important; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    .content-card {
        padding: 16px;
    }
    
    .verification-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .verification-tab {
        padding: 16px 10px;
        font-size: 12px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .product-image-container {
        width: 150px;
        height: 150px;
        margin: 0 auto;
    }
}

/* Estado skipped para verificaciones */
.verification-item.skipped {
    border-color: rgba(156, 163, 175, 0.5);
    background: rgba(156, 163, 175, 0.1);
}

.verification-item.skipped .verification-icon {
    background: #6b7280;
    color: white;
}

.summary-icon.partial {
    background: var(--accent-warning);
    color: white;
}

/* =============================================
   ACORDEÓN - Agregar al final de explorer.css
   ============================================= */

/* Acordeón */
.accordion {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg, 16px);
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.accordion-header:hover {
    background: var(--bg-secondary);
}

.accordion-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.accordion-title i {
    color: var(--accent-primary);
    width: 20px;
    text-align: center;
}

.accordion-icon {
    color: var(--text-muted);
    transition: transform 0.3s ease;
    font-size: 14px;
}

.accordion.open .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.accordion-body {
    padding: 0 24px 24px 24px;
}

/* Estado skipped para verificaciones */
.verification-item.skipped {
    border-color: rgba(156, 163, 175, 0.5);
    background: rgba(156, 163, 175, 0.1);
}

.verification-item.skipped .verification-icon {
    background: #6b7280;
    color: white;
}

.summary-icon.partial {
    background: var(--accent-warning);
    color: white;
}

.summary-icon.loading {
    background: var(--accent-info, #2563eb);
    color: white;
}

.summary-icon.success {
    background: var(--accent-secondary);
    color: white;
}

.summary-icon.error {
    background: var(--accent-danger);
    color: white;
}