/**
 * Estilos personalizados del sistema
 * Sistema de Stock de Vinos - Reina del Plata
 */

:root {
    --color-primary: #1e40af;
    --color-primary-dark: #1e3a8a;
    --color-primary-light: #3b82f6;
    --color-accent: #3b82f6;
    --color-text: #1f2937;
    --color-text-light: #6b7280;
    --color-bg: #ffffff;
    --color-bg-secondary: #f9fafb;
    --color-border: #e5e7eb;
}

[data-theme="dark"] {
    --color-primary: #2563eb;
    --color-primary-dark: #1e40af;
    --color-primary-light: #60a5fa;
    --color-accent: #3b82f6;
    --color-text: #f9fafb;
    --color-text-light: #d1d5db;
    --color-bg: #111827;
    --color-bg-secondary: #1f2937;
    --color-border: #374151;
}

/* Transiciones suaves para cambios de tema */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary-dark);
}

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

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Toast notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease-out;
}

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

/* Animaciones para modal de confirmación */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes slideInModal {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideOutModal {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
}

.toast-success {
    background-color: #10b981;
    color: white;
}

.toast-error {
    background-color: #ef4444;
    color: white;
}

.toast-info {
    background-color: #3b82f6;
    color: white;
}

/* Mobile menu */
.mobile-menu {
    transform: translateX(-100%);
    transition: transform 0.3s ease-out;
}

.mobile-menu.open,
.mobile-menu:not(.hidden) {
    transform: translateX(0);
}

/* Mejoras para móvil */
@media (max-width: 768px) {
    /* Tablas responsivas - scroll horizontal suave */
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    
    .table-responsive table {
        white-space: nowrap;
    }
    
    /* Reducir padding de celdas de tabla en móvil */
    .table-responsive th,
    .table-responsive td {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.875rem;
    }
    
    /* Mejor manejo de texto en tablas móviles */
    .table-responsive td {
        word-break: break-word;
        max-width: 200px;
    }
    
    .table-responsive td.whitespace-nowrap {
        max-width: none;
    }
    
    /* Mejor espaciado en móvil */
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    /* Cards más compactas en móvil */
    .card-mobile {
        padding: 1rem;
    }
    
    /* Reducir padding de contenedores principales */
    .bg-white.rounded-lg.shadow,
    .bg-gray-800.rounded-lg.shadow,
    .dark\\:bg-gray-800.rounded-lg.shadow {
        padding: 1rem !important;
    }
    
    /* Texto más pequeño en móvil para títulos grandes */
    h1 {
        font-size: 1.75rem;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    /* Botones más grandes para touch */
    button, a[role="button"], .btn {
        min-height: 44px;
        min-width: 44px;
        padding: 0.75rem 1rem;
    }
    
    /* Mejor espaciado entre botones en móvil */
    .flex.space-x-2 > * + *,
    .flex.space-x-4 > * + * {
        margin-left: 0.5rem;
    }
    
    /* Inputs más grandes para touch - previene zoom en iOS */
    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="password"],
    select,
    textarea {
        font-size: 16px !important;
    }
    
    /* Mejor espaciado en formularios móviles */
    form .space-y-6 > * + * {
        margin-top: 1rem;
    }
    
    /* Padding reducido en cards en móvil */
    .rounded-lg, .rounded-2xl {
        padding: 1rem;
    }
    
    /* Grid más compacto */
    .grid {
        gap: 0.75rem;
    }
    
    /* Espaciado vertical reducido */
    .space-y-6 > * + * {
        margin-top: 1rem;
    }
    
    /* Footer más compacto */
    footer {
        padding: 1rem 0;
        font-size: 0.875rem;
    }
    
    /* Ajustar ancho mínimo de tablas para mejor responsive */
    .table-responsive table[class*="min-w-"] {
        min-width: 100% !important;
    }
    
    /* Mejorar visibilidad de acciones en tablas */
    .table-responsive .flex.space-x-2 {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    /* Ajustar badges y etiquetas en móvil */
    .table-responsive .px-2.py-1 {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* Loading spinner */
.spinner {
    border: 3px solid var(--color-border);
    border-top: 3px solid var(--color-primary);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Animación de brillo para logo */
@keyframes shimmer {
    0% {
        transform: translateX(-100%) skewX(-12deg);
    }
    100% {
        transform: translateX(200%) skewX(-12deg);
    }
}

.animate-shimmer {
    animation: shimmer 2s infinite;
}

/* Google Fonts - Roboto Thin aplicada */
body {
    font-family: 'Roboto', system-ui, -apple-system, sans-serif;
    font-weight: 100;
    font-feature-settings: 'kern' 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Roboto', system-ui, sans-serif;
    font-weight: 100;
    letter-spacing: -0.025em;
}

/* Ajustes para elementos que necesitan más peso */
button, .btn-enhanced, .font-bold, .font-semibold {
    font-weight: 300 !important;
}

.font-medium {
    font-weight: 100 !important;
}

/* Mejoras de iconos Font Awesome */
.fa-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Cards con sombras mejoradas */
.card-enhanced {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-enhanced:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

/* Botones mejorados */
.btn-enhanced {
    font-weight: 500;
    letter-spacing: 0.025em;
    transition: all 0.2s ease-in-out;
}

.btn-enhanced:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Badges mejorados */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
}

/* Inputs mejorados */
input:focus, select:focus, textarea:focus {
    outline: none;
    ring-width: 2px;
    ring-color: var(--color-primary);
    border-color: var(--color-primary);
}

/* Animaciones suaves */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slide-down {
    animation: slideDown 0.3s ease-out;
}

/* Gradientes mejorados */
.gradient-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
}

.gradient-accent {
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-primary-light) 100%);
}

/* Contenedor con máximo para pantallas grandes */
.container {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

/* Asegurar que el contenedor se centre en pantallas muy grandes */
@media (min-width: 1536px) {
    .container {
        max-width: 1400px;
    }
}

