/* Aplicar los estilos mejorados al botón */
/* toasts */
.toast {
    transition: all 400ms cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(100px);
}

.toast.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(100px);
}

.toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.btn-submit {
    position: relative;
    overflow: hidden;
    transition: all 400ms cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #06b6d4 100%) !important;
    background-size: 200% 200%;
    color: white !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    animation: gradientShift 3s ease infinite, pulse 2s ease-in-out infinite;
}

.btn-submit:hover {
    transform: translateY(-3px) scale(1.02);
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 50%, #0891b2 100%) !important;
    background-size: 300% 300%;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.6);
    animation: gradientShiftHover 1.5s ease infinite, pulseHover 1s ease-in-out infinite;
}

.btn-submit:active {
    transform: translateY(-1px) scale(1.01);
}

/* Animaciones del gradiente */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes gradientShiftHover {
    0% {
        background-position: 0% 50%;
    }

    25% {
        background-position: 100% 0%;
    }

    50% {
        background-position: 100% 100%;
    }

    75% {
        background-position: 0% 100%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Efecto shimmer */
.btn-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 600ms ease;
}

.btn-submit:hover::before {
    left: 100%;
}

/* Animaciones de pulsación */
@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    }

    50% {
        box-shadow: 0 4px 20px rgba(59, 130, 246, 0.6);
    }
}

@keyframes pulseHover {

    0%,
    100% {
        box-shadow: 0 8px 25px rgba(59, 130, 246, 0.6);
        transform: translateY(-3px) scale(1.02);
    }

    50% {
        box-shadow: 0 12px 35px rgba(59, 130, 246, 0.8);
        transform: translateY(-4px) scale(1.03);
    }
}

/* Animaciones del ícono */
.btn-icon {
    transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-submit:hover .btn-icon {
    transform: scale(1.15) rotate(90deg);
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
}

.btn-submit:active .btn-icon {
    transform: scale(1.1) rotate(180deg);
}

/* Animación del texto */
.btn-submit span {
    transition: all 300ms ease;
}

.btn-submit:hover span {
    letter-spacing: 0.5px;
}

/* Efecto ripple para el clic */
.btn-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripple 600ms linear;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* dieños nuevos que no son de la plantilla */

/* scroll bar de las tablas */

/* Mostrar scrollbar siempre */
.scrollbar-visible::-webkit-scrollbar {
    height: 8px;
    /* Para scroll horizontal */
}

.scrollbar-visible::-webkit-scrollbar-thumb {
    background-color: rgba(100, 100, 100, 0.5);
    border-radius: 4px;
}

.scrollbar-visible {
    scrollbar-width: auto;
    /* Firefox */
    scrollbar-color: rgba(100, 100, 100, 0.5) transparent;
}

/* renglones de tabla */
.custom-table-row {
    border-bottom-width: 1px;
    border-color: #e5e7eb;
    transition: background-color 0.2s ease-in-out, transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    position: relative;
}

.dark .custom-table-row {
    border-color: #334155;
}

.custom-table-row:hover {
    background-color: #f3f4f6;
    transform: scale(1.01);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.dark .custom-table-row:hover {
    background-color: #374151;
}

/* circulo para id en tabla */
.id-circle-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    background-color: #cffafe;
    color: #0891b2;
    animation: pulse-scale-id-circle 1.8s ease-in-out infinite;
}

.dark .id-circle-wrapper {
    background-color: #164e63;
    color: #67e8f9;
}

@keyframes pulse-scale-id-circle {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.9;
    }

    50% {
        transform: scale(1.15);
        opacity: 1;
    }
}

/* card de modulo */
.modern-header-container {
    /* animation: fadeInUp 0.8s ease-out; */
    perspective: 1000px;
}

.glass-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 50%, rgba(255, 255, 255, 0.9) 100%);
    /* backdrop-filter: blur(20px); */
    /* -webkit-backdrop-filter: blur(20px); */
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 28px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.5), inset 0 -1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 1rem;
}

.glass-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.dark .glass-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.8) 50%, rgba(30, 41, 59, 0.9) 100%);
    border: 2px solid rgba(148, 163, 184, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.dark .glass-card:hover {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.gradient-title {
    background: linear-gradient(135deg, #1e293b, #475569);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.dark .gradient-title {
    background: linear-gradient(135deg, #f8fafc, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.icon-container {
    position: relative;
    background: linear-gradient(145deg, #667eea, #764ba2);
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    animation: pulse-glow 3s infinite;
}

.icon-container:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.icon-container svg {
    color: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.animated-line {
    height: 4px;
    width: 80px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.animated-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

.description-text {
    color: #64748b;
    font-size: 18px;
    line-height: 1.6;
    font-weight: 400;
}

.dark .description-text {
    color: #94a3b8;
}

.modern-btn {
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 18px;
    padding: 16px 32px;
    color: white;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.modern-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.modern-btn:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    color: white;
    text-decoration: none;
}

.modern-btn:hover::before {
    left: 100%;
}

.modern-btn:active {
    transform: translateY(0) scale(0.98);
}

.btn-icon {
    transition: transform 0.3s ease;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.modern-btn:hover .btn-icon {
    transform: rotate(90deg) scale(1.1);
}


/* cosas del form */
.floating-label {
    position: absolute;
    left: 2.5rem;
    top: .7rem;
    /* Posición inicial más baja para centrado visual */
    transform: translateY(0);
    padding: 0 0.25rem;
    transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    font-size: 0.875rem;
    color: #64748b;
    background: transparent !important;
}

.dark .floating-label {
    color: #94a3b8 !important;
}

/* Estilo cuando flota: foco o valor presente */
.form-input-icon {
    padding-left: 2.75rem !important;
}

.form-input:focus+.floating-label,
.form-input:not(:placeholder-shown)+.floating-label,
.label-floated {
    top: -0.65rem;
    left: 0.65rem;
    transform: scale(0.85);
    font-size: 0.7rem;
    color: #2563eb !important;
    font-weight: 500;
    padding: 0 0.25rem;
    background: #fff !important;
    /* Fondo blanco solo cuando flota */
    z-index: 10;
    border-radius: .5rem;
    border-width: 1px;
    border-color: #2563eb !important;
}

.dark .form-input:focus+.floating-label,
.dark .form-input:not(:placeholder-shown)+.floating-label,
.dark .label-floated {
    color: #60a5fa !important;
    color: #94a3b8 !important;
    background: #0f172b !important;
}

.input-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    transition: all 300ms ease;
    z-index: 10;
}

.input-icon svg {
    color: #6b7280;
}

.dark .input-icon svg {
    color: #94a3b8;
}

.form-group:focus-within .input-icon svg {
    color: #3b82f6 !important;
    transform: scale(1.1);
}

.dark .form-group:focus-within .input-icon svg {
    color: #60a5fa !important;
}

/* Reglas para el sidebar nuevo */
@media (max-width: 1023px) {
    .sidebar {
        display: block !important;
        transform: translateX(-100%);
        opacity: 0;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    .vertical.toggle-sidebar .sidebar {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast {
    transition: opacity 300ms ease-out;
}

.toast.hidden {
    opacity: 0;
    pointer-events: none;
}

.toast.visible {
    opacity: 1;
}

.form-group {
    position: relative;
    transition: all 300ms ease;
}

.form-input {
    transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
    padding-left: 2.75rem !important;
    color: #374151 !important;
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
}

.dark .form-input {
    color: #f1f5f9 !important;
    background-color: #1e293b !important;
    border-color: #475569 !important;
}

.dark select.form-input {
    color: #f1f5f9 !important;
    background-color: #1e293b !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3e%3cpath d='M7 7l3-3 3 3m0 6l-3 3-3-3' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

.dark select.form-input:focus {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3e%3cpath d='M7 7l3-3 3 3m0 6l-3 3-3-3' stroke='%2360a5fa' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e") !important;
}

.dark .form-input:focus {
    border-color: #60a5fa !important;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1) !important;
}

.form-input::placeholder {
    color: #94a3b8 !important;
}

.dark .form-input::placeholder {
    color: #64748b !important;
}

.input-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    transition: all 300ms ease;
    z-index: 10;
}

.input-icon svg {
    color: #6b7280;
}

.dark .input-icon svg {
    color: #94a3b8;
}

.form-group:focus-within .input-icon svg {
    color: #3b82f6 !important;
    transform: scale(1.1);
}

.dark .form-group:focus-within .input-icon svg {
    color: #60a5fa !important;
}

.form-group.error .input-icon svg {
    color: #ef4444;
}

.form-group.success .input-icon svg {
    color: #10b981;
}

.floating-label {
    position: absolute;
    left: 2.75rem;
    top: 50%;
    transform: translateY(-50%);
    padding: 0 0.35rem;
    transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    color: #64748b;
    background: transparent !important;
}

.dark .floating-label {
    background: transparent !important;
    color: #94a3b8 !important;
}

.form-input:focus+.floating-label,
.form-input:not(:placeholder-shown)+.floating-label,
.form-input.has-value+.floating-label {
    top: 0;
    transform: translateY(-50%) scale(0.85);
    font-size: 0.7rem;
    color: #2563eb !important;
    font-weight: 500;
    background: #fff !important;
}

.dark .form-input:focus+.floating-label,
.dark .form-input:not(:placeholder-shown)+.floating-label,
.dark .form-input.has-value+.floating-label {
    color: #60a5fa !important;
    background: #1e293b !important;
}

/* Blue Neon Styling for "Historial de precios" tab and content */
.dark .tab-prices.active {
    color: #00e0ff !important;
    /* Brighter blue for neon effect */
    border-color: #00e0ff !important;
    /* Matching border color */
    text-shadow: 0 0 8px rgba(0, 224, 255, 0.6), 0 0 15px rgba(0, 224, 255, 0.4);
    /* Neon glow effect */
}

.dark .tab-prices.active svg {
    color: #00e0ff !important;
    /* Ensure SVG icon matches neon color */
    filter: drop-shadow(0 0 5px rgba(0, 224, 255, 0.6));
    /* Add glow to icon */
}

.dark .price-card-gradient {
    background: linear-gradient(to bottom right, #0a182b, #112a4a, #0a182b) !important;
    /* Dark blue gradient */
    border-color: #1a568d !important;
    /* Darker blue border */
    box-shadow: 0 4px 15px rgba(0, 119, 255, 0.3), 0 0 10px rgba(0, 119, 255, 0.1);
    /* Subtle blue glow shadow */
}

.dark .price-card-inner-bg {
    background-color: #0d223a !important;
    /* Even darker blue for inner sections */
    border-color: #1a568d !important;
}

.dark .price-card-text-light {
    color: #e0f2fe !important;
    /* Light blue-white for main text */
}

.dark .price-card-text-medium {
    color: #93c5fd !important;
    /* Medium blue for secondary text */
}

/* Ensure specific elements in price cards have correct dark mode colors */
.dark .text-gray-800 {
    color: #e0f2fe !important;
    /* Force light text color */
}

.dark .text-gray-500 {
    color: #93c5fd !important;
    /* Force medium text color */
}

.dark .text-gray-200 {
    /* For the bold price numbers */
    color: #e0f2fe !important;
}

/* Specific adjustment for the price-highlighted section */
.dark .bg-gradient-to-r.from-emerald-500.to-teal-500 {
    background: linear-gradient(to right, #00e0ff, #00bfff) !important;
    /* Brighter blue gradient for selling price */
    box-shadow: 0 0 10px rgba(0, 224, 255, 0.7), 0 0 20px rgba(0, 224, 255, 0.5);
    /* Stronger neon glow */
}

.dark .text-emerald-100 {
    /* Selling price label */
    color: #ffffff !important;
    /* White text for contrast on bright blue */
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.7);
}

/* Ensure the existing specific indigo sections also adapt to the blue theme */
.dark .bg-indigo-50 {
    background-color: #1a3a5d !important;
    /* Darker blue for indigo sections */
}

.dark .bg-indigo-900\/30 {
    background-color: #1a3a5d !important;
}

.dark .border-indigo-200 {
    border-color: #3b82f6 !important;
    /* Matching blue border */
}

.dark .border-indigo-800 {
    border-color: #3b82f6 !important;
}

.dark .text-indigo-600 {
    color: #60a5fa !important;
    /* Lighter blue for indigo text */
}

.dark .text-indigo-300 {
    color: #93c5fd !important;
    /* Even lighter blue for indigo text */
}

.dark .text-indigo-700 {
    color: #00bfff !important;
    /* Vivid blue for bold indigo text */
}

.dark .text-indigo-200 {
    color: #93c5fd !important;
}