/* style.css - Versión Mejorada */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --light-color: #f8fafc;
    --dark-color: #1e293b;
    --gray-color: #94a3b8;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background-color: #f1f5f9;
    color: var(--dark-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    line-height: 1.6;
}

/* Loading Screen Mejorado */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

.loading-content {
    text-align: center;
    color: white;
    animation: fadeInUp 0.8s ease;
}

.loading-logo {
    width: 120px;
    margin-bottom: 20px;
    filter: brightness(0) invert(1);
    animation: pulse 2s infinite;
}

.loading-screen p {
    font-size: 1.2rem;
    letter-spacing: 1px;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hidden {
    display: none !important;
}

/* Contenedor Principal */
.container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.8s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Login Container */
.login-container {
    background-color: white;
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    width: 100%;
    max-width: 480px;
    text-align: center;
    transition: var(--transition);
}

.login-container:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.logo-container {
    margin-bottom: 30px;
}

.logo {
    width: 140px;
    transition: var(--transition);
}

.logo:hover {
    transform: scale(1.05);
}

h1 {
    color: var(--primary-color);
    margin-bottom: 25px;
    font-weight: 600;
    font-size: 1.8rem;
}

h2 {
    color: var(--dark-color);
    margin-bottom: 20px;
    font-weight: 500;
}

/* Botones */
.button-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.btn:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background-color: white;
    color: var(--secondary-color);
    border: 1px solid var(--gray-color);
}

.btn-secondary:hover {
    background-color: #f8fafc;
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

/* Formularios */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark-color);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-color);
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.admin-login {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #e2e8f0;
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Footer */
.footer {
    background-color: var(--dark-color);
    color: white;
    padding: 30px 20px;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}

.contact-info, .branches {
    margin: 15px;
    flex: 1;
    min-width: 250px;
}

.footer h3 {
    margin-bottom: 15px;
    color: var(--light-color);
    font-weight: 600;
}

.footer p {
    margin-bottom: 8px;
    color: #cbd5e1;
}

/* Inventory Container */
.inventory-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
    animation: fadeIn 0.8s ease;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.header h1 {
    margin-bottom: 0;
    color: var(--dark-color);
}

.tabs {
    display: flex;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--primary-color);
}

.tab {
    padding: 12px 24px;
    background-color: transparent;
    border: none;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    margin-right: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    color: var(--secondary-color);
}

.tab.active {
    background-color: var(--primary-color);
    color: white;
}

.tab:hover:not(.active) {
    background-color: #f1f5f9;
    color: var(--primary-color);
}

/* Filtros */
.filters {
    background-color: white;
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 25px;
    transition: var(--transition);
}

.filters:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-toggle {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.filter-toggle input {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.filter-toggle label {
    font-weight: 500;
    color: var(--dark-color);
}

/* Tablas */
.table-container {
    background-color: white;
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow-x: auto;
    transition: var(--transition);
}

.table-container:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}

th, td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
}

tr {
    transition: var(--transition);
}

tr:hover {
    background-color: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    padding: 8px 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.action-btn:hover {
    transform: translateY(-1px);
}

/* Modales */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 520px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h2 {
    margin-bottom: 0;
}

.close {
    font-size: 24px;
    cursor: pointer;
    color: var(--secondary-color);
    transition: var(--transition);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close:hover {
    background-color: #f1f5f9;
    color: var(--danger-color);
}

/* Notificaciones */
.notification {
    position: fixed;
    top: 25px;
    right: 25px;
    padding: 16px 24px;
    border-radius: var(--border-radius);
    color: white;
    z-index: 1100;
    opacity: 0;
    transform: translateX(100%);
    transition: var(--transition);
    box-shadow: var(--box-shadow);
    max-width: 350px;
    display: flex;
    align-items: center;
}

.notification::before {
    content: '';
    width: 20px;
    height: 20px;
    margin-right: 10px;
    background-size: contain;
    background-repeat: no-repeat;
}

.notification.success {
    background-color: var(--success-color);
}

.notification.success::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
}

.notification.error {
    background-color: var(--danger-color);
}

.notification.error::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/%3E%3C/svg%3E");
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

/* Responsive */
@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
    }
    
    .footer-content {
        flex-direction: column;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .modal-content {
        margin: 20px;
        padding: 20px;
    }
    
    .login-container {
        padding: 25px;
    }
    
    .inventory-container {
        padding: 15px;
    }
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

.top-right-logo {
    position: center;
    top: 20px;
    right: 20px;
    z-index: 1000; /* Para que siempre esté visible */
}

.top-right-logo img {
    width: 100px; /* Ajusta tamaño según quieras */
    height: 100px;
}

.whatsapp-button {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 60px;
    height: 60px;
    z-index: 1000;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    transition: transform 0.2s;
}

.whatsapp-button img {
    width: 100%;
    height: 100%;
    display: block;
}

.whatsapp-button:hover {
    transform: scale(1.1); /* pequeño efecto al pasar el mouse */
}

.filters input,
.filters select {
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    transition: all 0.25s ease;
}

.filters input:hover,
.filters select:hover {
    border-color: var(--primary-light);
}

.filters input:focus,
.filters select:focus {
    background-color: white;
    transform: translateY(-1px);
}

/* Buscador general más atractivo */
#general {
    font-weight: 500;
    letter-spacing: 0.3px;
    background-image: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
    border-left: 4px solid var(--primary-color);
}

#general::placeholder {
    color: var(--gray-color);
    font-style: italic;
}

/* Grupo de filtros con efecto flotante */
.filters {
    position: relative;
}

.filters::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--border-radius);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.05);
    pointer-events: none;
}

/* Botones con efecto más profesional */
.btn {
    letter-spacing: 0.4px;
}

.btn-primary {
    background-image: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

.btn-primary:active {
    transform: scale(0.97);
}

.btn-secondary {
    background-image: linear-gradient(135deg, #ffffff, #f1f5f9);
}

.btn-secondary:active {
    transform: scale(0.97);
}

/* Hover más elegante */
.btn:hover {
    filter: brightness(1.05);
}

/* Checkbox más elegante */
.filter-toggle input {
    border-radius: 4px;
    cursor: pointer;
    transform: scale(1.05);
    transition: var(--transition);
}

.filter-toggle input:hover {
    transform: scale(1.15);
}

/* Filtro de marca animado */
#brandFilter {
    animation: appear 0.3s ease;
}

@keyframes appear {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Botón aplicar filtros con glow sutil */
.filters .btn-primary {
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.25);
}

.filters .btn-primary:hover {
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.35);
}

/* Botón limpiar con efecto soft */
.filters .btn-secondary:hover {
    box-shadow: 0 6px 12px rgba(100, 116, 139, 0.25);
}

/* Inputs con sombra interna */
.filters input,
.filters select {
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Filtros con mejor separación visual */
.filter-row {
    padding-bottom: 10px;
    border-bottom: 1px dashed #e2e8f0;
}

.filter-row:last-child {
    border-bottom: none;
}

/* Títulos de filtros más visibles */
.filters label {
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Botón regresar también mejorado */
.header .btn-primary {
    background-image: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.3);
}