/* Caridito custom styles - minimal additions to Tailwind */

/* Smooth transitions for HTMX swaps */
.htmx-settling {
    opacity: 0.8;
}
.htmx-swapping {
    opacity: 0.5;
    transition: opacity 200ms ease-out;
}

/* Loading indicator */
.htmx-indicator {
    display: none;
}
.htmx-request .htmx-indicator {
    display: inline-block;
}
.htmx-request.htmx-indicator {
    display: inline-block;
}

/* Form input focus styles */
input:focus, select:focus, textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Form validation error styling */
input:invalid:not(:placeholder-shown):not(:focus),
select:invalid:not(:focus),
textarea:invalid:not(:placeholder-shown):not(:focus) {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Loading skeleton animation */
.skeleton {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: 0.375rem;
}
@keyframes skeleton-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    .dark-mode body { background-color: #111827; color: #f3f4f6; }
    .dark-mode .bg-white { background-color: #1f2937; }
    .dark-mode .bg-gray-50 { background-color: #111827; }
    .dark-mode .bg-gray-100 { background-color: #1f2937; }
    .dark-mode .text-gray-900 { color: #f9fafb; }
    .dark-mode .text-gray-700 { color: #d1d5db; }
    .dark-mode .text-gray-600 { color: #9ca3af; }
    .dark-mode .text-gray-500 { color: #9ca3af; }
    .dark-mode .text-gray-400 { color: #6b7280; }
    .dark-mode .border-gray-200 { border-color: #374151; }
    .dark-mode .border-gray-300 { border-color: #4b5563; }
    .dark-mode .shadow-sm { box-shadow: 0 1px 2px rgba(0,0,0,0.3); }
    .dark-mode .shadow-lg { box-shadow: 0 10px 15px rgba(0,0,0,0.4); }
    .dark-mode .shadow-2xl { box-shadow: 0 25px 50px rgba(0,0,0,0.5); }
    .dark-mode input, .dark-mode select, .dark-mode textarea {
        background-color: #374151; color: #f3f4f6; border-color: #4b5563;
    }
    .dark-mode table thead { background-color: #1f2937; }
    .dark-mode table tbody tr { border-color: #374151; }
    .dark-mode table tbody tr:hover { background-color: #374151; }
    .dark-mode .hover\:bg-gray-50:hover { background-color: #374151; }
    .dark-mode a.text-blue-600 { color: #60a5fa; }
    .dark-mode .bg-blue-50 { background-color: #1e3a5f; }
    .dark-mode .text-blue-700 { color: #93c5fd; }
    .dark-mode .bg-gradient-to-br { background-image: none; background-color: #0f172a; }
    .dark-mode .bg-white.rounded-xl { background-color: #1e293b; }
    .dark-mode .divide-gray-200 > :not([hidden]) ~ :not([hidden]) { border-color: #374151; }
}

/* Table row hover */
table tbody tr {
    transition: background-color 150ms ease;
}

/* Mobile admin sidebar animation */
@media (max-width: 1023px) {
    #admin-sidebar:not(.hidden) {
        animation: slideIn 200ms ease-out;
    }
}
@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}
