/* Estilos personalizados para el Comparador de Costos - MemoMedia */
/* Codificación UTF-8 */
@charset "UTF-8";

/* Estilos generales */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    min-height: 100vh;
    line-height: 1.6;
    color: #333;
}

/* Card personalizado */
.card {
    border: none;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    background: #ffffff;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.2);
}

.card-header {
    border-radius: 20px 20px 0 0 !important;
    background: #667eea;
    border: none;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}


.card-body {
    padding: 2.5rem;
    background: #ffffff;
    border-radius: 0 0 20px 20px;
    color: #333;
}

/* Estilos para formularios */
.form-control, .form-select {
    border-radius: 12px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    background: #ffffff;
}

.form-control:focus, .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    background: #ffffff;
}

.form-control-sm, .form-select-sm {
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.btn {
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}



.btn-primary {
    background: #667eea;
    border: none;
    color: white;
}

.btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-sm {
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Estilos para alertas */
.alert {
    border-radius: 10px;
    border: none;
    margin-bottom: 1.5rem;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-success {
    background-color: #d1edff;
    color: #0c5460;
}

/* Navbar personalizada */
.navbar {
    background: #667eea !important;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-link {
    transition: all 0.3s ease;
}

.nav-link:hover {
    transform: translateY(-1px);
}

/* Cards de estadísticas */
.card.bg-primary, .card.bg-success, .card.bg-warning {
    border-radius: 15px;
    border: none;
    transition: transform 0.3s ease;
}

.card.bg-primary:hover, .card.bg-success:hover, .card.bg-warning:hover {
    transform: translateY(-5px);
}

/* Estilos para DataTables */
.dataTables_wrapper {
    padding: 0;
    background: #ffffff;
    border-radius: 15px;
}

.dataTables_filter {
    margin-bottom: 1rem;
}

.dataTables_filter input {
    border-radius: 10px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    padding: 0.5rem 1rem;
    margin-left: 0.5rem;
    background: #ffffff;
}

.dataTables_length select {
    border-radius: 10px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    padding: 0.25rem 0.5rem;
    margin: 0 0.5rem;
    background: #ffffff;
}

/* Estilos para filtros de columnas */
.column-filter-container {
    padding: 0.5rem 0;
}

.column-filter {
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    background: #ffffff;
    transition: all 0.3s ease;
    width: 100%;
    min-width: 120px;
}

.column-filter:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.1rem rgba(102, 126, 234, 0.25);
    background: #ffffff;
}

.column-filter.filter-active {
    border-color: #f59e0b;
    background-color: #fffbeb;
    box-shadow: 0 0 0 0.15rem rgba(245, 158, 11, 0.35);
    color: #92400e;
    font-weight: 600;
}

th.has-active-filter {
    background: #4c5ec7 !important;
}

th.has-active-filter::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #f59e0b;
}

.column-filter::placeholder {
    color: #6c757d;
    font-size: 0.75rem;
}

/* Ajustes para headers con filtros */
.table thead th {
    vertical-align: top;
    position: relative;
    min-width: 150px;
}

/* Tabla personalizada */
.table {
    border-radius: 15px;
    overflow: hidden;
    background: #ffffff;
    width: 100% !important;
}

.table thead th {
    background: #667eea;
    border: none;
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    padding: 1rem 0.75rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    position: relative;
}


.table tbody tr {
    transition: all 0.3s ease;
    background: #ffffff;
}

.table tbody tr:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.table tbody tr:nth-child(even):hover {
    background: rgba(102, 126, 234, 0.1);
}

.table tbody td {
    padding: 1rem 0.75rem;
    border: none;
    vertical-align: middle;
}

/* Estilos para imágenes de productos */
.img-thumbnail {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.img-thumbnail:hover {
    transform: scale(1.1);
    border-color: #007bff;
}

/* Badges personalizados */
.badge {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
}

.badge.bg-success {
    background: #28a745 !important;
}

.badge.bg-danger {
    background: #dc3545 !important;
}

/* Botones de acción */
.btn-outline-primary {
    border-radius: 8px;
    border-width: 2px;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
}

/* Spinner personalizado */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Colores para márgenes */
.text-success {
    color: #28a745 !important;
    font-weight: 700;
}

.text-danger {
    color: #dc3545 !important;
    font-weight: 700;
}

.text-info {
    color: #17a2b8 !important;
    font-weight: 700;
}

/* Estilos adicionales para DataTables */
.dataTables_info {
    color: #667eea;
    font-weight: 500;
}

.dataTables_paginate .paginate_button {
    border-radius: 8px !important;
    margin: 0 2px;
    background: rgba(102, 126, 234, 0.1) !important;
    border: 1px solid rgba(102, 126, 234, 0.3) !important;
    color: #667eea !important;
}

.dataTables_paginate .paginate_button:hover {
    background: rgba(102, 126, 234, 0.2) !important;
    border-color: #667eea !important;
    color: #667eea !important;
}

.dataTables_paginate .paginate_button.current {
    background: #667eea !important;
    border-color: #667eea !important;
    color: white !important;
}

.dataTables_paginate .paginate_button.disabled {
    background: rgba(0,0,0,0.05) !important;
    border-color: rgba(0,0,0,0.1) !important;
    color: #6c757d !important;
}

/* Mejoras para el contenedor principal */
.container-fluid {
    background: #667eea;
    border-radius: 20px;
    margin: 1rem;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Asegurar que la tabla ocupe 100% del ancho */
#productsTable {
    width: 100% !important;
}

.table-responsive {
    width: 100%;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }
    
    .table-responsive {
        font-size: 0.85rem;
    }
    
    .img-thumbnail {
        width: 40px !important;
        height: 40px !important;
    }
    
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .column-filter {
        min-width: 100px;
        font-size: 0.75rem;
    }
    
    .container-fluid {
        margin: 0.5rem;
        padding: 1rem;
        border-radius: 15px;
    }
    
    .table thead th {
        min-width: 120px;
        padding: 0.75rem 0.5rem;
    }
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeInUp 0.6s ease-out;
}

/* Estilos para paginación de DataTables */
.dataTables_paginate .paginate_button {
    border-radius: 8px !important;
    margin: 0 2px;
}

.dataTables_paginate .paginate_button.current {
    background: #007bff !important;
    border-color: #007bff !important;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Tooltip personalizado */
.tooltip {
    font-size: 0.85rem;
}

.tooltip .tooltip-inner {
    background-color: #333;
    border-radius: 8px;
}

/* Footer de la card */
.card-footer {
    background-color: #f8f9fa;
    border-radius: 0 0 15px 15px;
    border-top: 1px solid #e9ecef;
}

/* Mejoras para dropdowns */
.dropdown-menu {
    border-radius: 10px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.dropdown-item {
    border-radius: 8px;
    margin: 2px 8px;
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: #007bff;
}

/* Estilos para campos de búsqueda avanzada */
.search-filters {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

/* Scroll suave */
html {
    scroll-behavior: smooth;
}

/* Print styles */
@media print {
    .navbar, .card-header, .dataTables_filter, .dataTables_info, .dataTables_paginate {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .table {
        font-size: 12px;
    }
}