/**
 * Alma Eyes Panel - Estilos Globales
 */

/* ============================================
   VARIABLES CSS (para dark mode)
   ============================================ */
:root {
    --bg-primary: #f3f4f6;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f9fafb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border-color: #e5e7eb;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

.dark {
    --bg-primary: #030712;
    --bg-secondary: #111827;
    --bg-tertiary: #1f2937;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
    --border-color: #374151;
    --shadow-color: rgba(0, 0, 0, 0.5);
}

/* ============================================
   FUENTES
   ============================================ */

/* Cuerpo - Geist */
body {
    font-family: 'Geist', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Títulos - Rethink Sans */
h1, h2, h3, h4, h5, h6,
.font-heading {
    font-family: 'Rethink Sans', sans-serif;
}

/* Logo/Brand title */
.brand-title {
    font-family: 'Rethink Sans', sans-serif;
}

/* ============================================
   ALPINE.JS
   ============================================ */
[x-cloak] {
    display: none !important;
}

/* ============================================
   COMPONENTES
   ============================================ */

/* Drag & Drop Zone */
.drop-zone.dragover {
    border-color: #7c3aed;
    background-color: #f5f3ff;
}

/* ============================================
   UTILIDADES
   ============================================ */

/* Scrollbar personalizado */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c4b5fd;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a78bfa;
}

/* Transiciones suaves */
.transition-smooth {
    transition: all 0.2s ease-in-out;
}

/* Focus states mejorados */
input:focus,
select:focus,
textarea:focus {
    outline: none;
    ring: 2px;
    ring-color: #7c3aed;
}

/* ============================================
   TABLAS
   ============================================ */
.table-hover tbody tr:hover {
    background-color: #f9fafb;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    border: 1px solid #e5e7eb;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.card-body {
    padding: 1.5rem;
}

/* ============================================
   ESTADOS
   ============================================ */

/* Status badges */
.status-active {
    background-color: #dcfce7;
    color: #166534;
}

.status-inactive {
    background-color: #fef9c3;
    color: #854d0e;
}

.status-lost {
    background-color: #fee2e2;
    color: #991b1b;
}

/* ============================================
   ANIMACIONES
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animate-fadeIn {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slideIn {
    animation: slideIn 0.3s ease-in-out;
}

/* ============================================
   DARK MODE SWITCH TOGGLE
   ============================================ */
.theme-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px;
    background-color: #e5e7eb;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dark .theme-switch {
    background-color: #475569;
}

.theme-switch-track {
    position: relative;
    width: 52px;
    height: 28px;
    background-color: #d1d5db;
    border-radius: 9999px;
    transition: all 0.3s ease;
}

.dark .theme-switch-track {
    background-color: #7c3aed;
}

.theme-switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    background-color: white;
    border-radius: 9999px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark .theme-switch-thumb {
    left: 26px;
}

.theme-switch-thumb svg {
    width: 14px;
    height: 14px;
    transition: all 0.3s ease;
}

.theme-switch-thumb .icon-sun {
    color: #f59e0b;
    display: none;
}

.theme-switch-thumb .icon-moon {
    color: #6366f1;
    display: block;
}

.dark .theme-switch-thumb .icon-sun {
    display: block;
}

.dark .theme-switch-thumb .icon-moon {
    display: none;
}

.theme-switch-label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    min-width: 32px;
    text-transform: uppercase;
}

.dark .theme-switch-label {
    color: #94a3b8;
}

/* ============================================
   DARK MODE ESTILOS
   ============================================ */

/* Body */
.dark body,
html.dark body {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary);
}

/* Fondo general */
html.dark,
html.dark .bg-gray-100 {
    background-color: var(--bg-primary) !important;
}

/* Navbar */
.dark nav,
html.dark nav {
    background-color: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

.dark nav .brand-title,
html.dark nav .brand-title {
    color: var(--text-primary) !important;
}

.dark nav a:not(.bg-red-50):not(.theme-switch),
html.dark nav a:not(.bg-red-50):not(.theme-switch) {
    color: var(--text-secondary) !important;
}

.dark nav a.text-purple-600,
html.dark nav a.text-purple-600 {
    color: #c4b5fd !important;
    border-color: #c4b5fd !important;
}

/* Cards y contenedores */
.dark .bg-white,
html.dark .bg-white {
    background-color: var(--bg-secondary) !important;
}

.dark .bg-gray-50,
html.dark .bg-gray-50 {
    background-color: var(--bg-tertiary) !important;
}

.dark .bg-gray-100,
html.dark .bg-gray-100 {
    background-color: var(--bg-primary) !important;
}

/* Bordes */
.dark .border-gray-200,
html.dark .border-gray-200 {
    border-color: var(--border-color) !important;
}

.dark .border-gray-300,
html.dark .border-gray-300 {
    border-color: var(--border-color) !important;
}

.dark .divide-gray-200 > * + *,
html.dark .divide-gray-200 > * + * {
    border-color: var(--border-color) !important;
}

/* Textos */
.dark .text-gray-900,
html.dark .text-gray-900 {
    color: var(--text-primary) !important;
}

.dark .text-gray-700,
html.dark .text-gray-700 {
    color: var(--text-secondary) !important;
}

.dark .text-gray-600,
html.dark .text-gray-600 {
    color: var(--text-secondary) !important;
}

.dark .text-gray-500,
html.dark .text-gray-500 {
    color: var(--text-muted) !important;
}

/* Colores específicos mejorados en dark mode */
.dark .text-purple-600,
html.dark .text-purple-600 {
    color: #c4b5fd !important;
}

.dark .text-purple-800,
html.dark .text-purple-800 {
    color: #e9d5ff !important;
}

.dark .text-green-600,
html.dark .text-green-600 {
    color: #86efac !important;
}

.dark .text-green-800,
html.dark .text-green-800 {
    color: #bbf7d0 !important;
}

.dark .text-blue-600,
html.dark .text-blue-600 {
    color: #93c5fd !important;
}

.dark .text-blue-700,
html.dark .text-blue-700 {
    color: #93c5fd !important;
}

.dark .text-blue-800,
html.dark .text-blue-800 {
    color: #bfdbfe !important;
}

.dark .text-yellow-800,
html.dark .text-yellow-800 {
    color: #fef08a !important;
}

.dark .text-red-600,
html.dark .text-red-600 {
    color: #fca5a5 !important;
}

.dark .text-red-800,
html.dark .text-red-800 {
    color: #fecaca !important;
}

/* Inputs */
.dark input,
.dark select,
.dark textarea,
html.dark input,
html.dark select,
html.dark textarea {
    background-color: var(--bg-tertiary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

.dark input::placeholder,
.dark textarea::placeholder,
html.dark input::placeholder,
html.dark textarea::placeholder {
    color: var(--text-muted) !important;
}

/* Tablas */
.dark thead,
html.dark thead {
    background-color: var(--bg-tertiary) !important;
}

.dark tbody tr:hover,
html.dark tbody tr:hover {
    background-color: var(--bg-tertiary) !important;
}

/* Scrollbar dark mode */
.dark ::-webkit-scrollbar-track,
html.dark ::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

.dark ::-webkit-scrollbar-thumb,
html.dark ::-webkit-scrollbar-thumb {
    background: #64748b;
}

/* Modales */
.dark .bg-black.opacity-30,
html.dark .bg-black.opacity-30,
.dark .bg-black.opacity-50,
html.dark .bg-black.opacity-50 {
    opacity: 0.7 !important;
}

/* Modal rounded corners en dark mode */
.dark .rounded-b-xl.bg-gray-50,
html.dark .rounded-b-xl.bg-gray-50 {
    background-color: var(--bg-tertiary) !important;
}

/* Disabled buttons en dark mode */
.dark button:disabled,
html.dark button:disabled {
    opacity: 0.4 !important;
}

/* Badges de estado en dark mode - Colores mejorados */
.dark .bg-purple-100,
html.dark .bg-purple-100 {
    background-color: rgba(167, 139, 250, 0.25) !important;
}

.dark .bg-green-100,
html.dark .bg-green-100 {
    background-color: rgba(74, 222, 128, 0.25) !important;
}

.dark .bg-red-100,
html.dark .bg-red-100 {
    background-color: rgba(248, 113, 113, 0.25) !important;
}

.dark .bg-yellow-100,
html.dark .bg-yellow-100 {
    background-color: rgba(113, 83, 18, 0.8) !important;
}

.dark .bg-yellow-50,
html.dark .bg-yellow-50 {
    background-color: rgba(113, 83, 18, 0.6) !important;
}

.dark .border-yellow-200,
html.dark .border-yellow-200 {
    border-color: rgba(202, 138, 4, 0.5) !important;
}

/* Info boxes - Azules (fondos oscuros) */
.dark .bg-blue-50,
html.dark .bg-blue-50 {
    background-color: rgba(30, 58, 95, 0.8) !important;
}

.dark .bg-blue-100,
html.dark .bg-blue-100 {
    background-color: rgba(30, 64, 110, 0.9) !important;
}

.dark .border-blue-200,
html.dark .border-blue-200 {
    border-color: rgba(59, 130, 246, 0.5) !important;
}

/* Code blocks en dark mode */
.dark code,
html.dark code {
    background-color: rgba(51, 65, 85, 0.8) !important;
    color: #e2e8f0 !important;
}

.dark .bg-blue-50 code,
.dark .bg-blue-100 code,
html.dark .bg-blue-50 code,
html.dark .bg-blue-100 code {
    background-color: rgba(30, 41, 59, 0.9) !important;
    color: #93c5fd !important;
}

/* Hover states en dark mode */
.dark .hover\:bg-gray-50:hover,
html.dark .hover\:bg-gray-50:hover {
    background-color: var(--bg-tertiary) !important;
}

.dark .hover\:bg-purple-50:hover,
html.dark .hover\:bg-purple-50:hover {
    background-color: rgba(167, 139, 250, 0.15) !important;
}

.dark .hover\:bg-blue-50:hover,
html.dark .hover\:bg-blue-50:hover {
    background-color: rgba(96, 165, 250, 0.15) !important;
}

.dark .hover\:bg-red-50:hover,
html.dark .hover\:bg-red-50:hover {
    background-color: rgba(248, 113, 113, 0.15) !important;
}

.dark .hover\:bg-yellow-50:hover,
html.dark .hover\:bg-yellow-50:hover {
    background-color: rgba(250, 204, 21, 0.15) !important;
}

/* Botones hover en dark mode */
.dark .hover\:text-purple-600:hover,
html.dark .hover\:text-purple-600:hover {
    color: #c4b5fd !important;
}

.dark .hover\:text-blue-600:hover,
html.dark .hover\:text-blue-600:hover {
    color: #93c5fd !important;
}

.dark .hover\:text-red-600:hover,
html.dark .hover\:text-red-600:hover {
    color: #fca5a5 !important;
}

.dark .hover\:text-yellow-600:hover,
html.dark .hover\:text-yellow-600:hover {
    color: #fde047 !important;
}

/* Drop zone dark mode */
.dark .drop-zone,
html.dark .drop-zone {
    border-color: var(--border-color);
    background-color: var(--bg-tertiary);
}

.dark .drop-zone.dragover,
html.dark .drop-zone.dragover {
    border-color: #a78bfa;
    background-color: rgba(167, 139, 250, 0.15);
}

/* Footer dark mode */
.dark footer,
html.dark footer {
    background-color: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

/* Checkbox en dark mode */
.dark input[type="checkbox"],
html.dark input[type="checkbox"] {
    background-color: var(--bg-tertiary) !important;
    border-color: var(--border-color) !important;
}

.dark input[type="checkbox"]:checked,
html.dark input[type="checkbox"]:checked {
    background-color: #7c3aed !important;
    border-color: #7c3aed !important;
}

/* Botón logout en dark mode */
.dark .bg-red-50,
html.dark .bg-red-50 {
    background-color: rgba(248, 113, 113, 0.15) !important;
}

.dark .hover\:bg-red-100:hover,
html.dark .hover\:bg-red-100:hover {
    background-color: rgba(248, 113, 113, 0.25) !important;
}

/* Gray badges en dark mode */
.dark .bg-gray-100:not(body),
html.dark .bg-gray-100:not(body) {
    background-color: rgba(55, 65, 81, 0.5) !important;
}

.dark .text-gray-800,
html.dark .text-gray-800 {
    color: #e2e8f0 !important;
}

/* Botones grises en dark mode */
.dark .bg-gray-200,
html.dark .bg-gray-200 {
    background-color: #374151 !important;
    color: #d1d5db !important;
}

.dark .text-gray-700,
html.dark .text-gray-700 {
    color: #d1d5db !important;
}

.dark .hover\:bg-gray-300:hover,
html.dark .hover\:bg-gray-300:hover {
    background-color: #4b5563 !important;
}
