/* Custom CSS for CMS DHRU */

/* HTMX Loading States */
.htmx-request .htmx-indicator {
    opacity: 1;
}

.htmx-indicator {
    opacity: 0;
    transition: opacity 200ms ease-in;
}

/* Smooth page transitions */
.htmx-swapping {
    opacity: 0.5;
    transition: opacity 200ms ease-out;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: oklch(var(--b2));
}

::-webkit-scrollbar-thumb {
    background: oklch(var(--bc) / 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: oklch(var(--bc) / 0.5);
}

* {
    scrollbar-width: thin;
    scrollbar-color: oklch(var(--bc) / 0.3) oklch(var(--b2));
}

/* Table improvements */
.table tr:hover td {
    background-color: oklch(var(--b2));
}

/* Card hover effect */
.card-hover {
    transition: transform 0.2s, box-shadow 0.2s;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
}

/* Accesibilidad: focus visible para teclado */
:focus-visible {
    outline: 2px solid oklch(var(--p));
    outline-offset: 2px;
}

/* Screen reader only (skip link, etc.) - DaisyUI puede incluirlo; definimos por compatibilidad */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip link: visible al recibir foco (teclado o ratón) */
a[href="#main-content"].sr-only:focus,
a[href="#main-content"].sr-only:focus-visible {
    width: auto;
    height: auto;
    padding: 0.5rem 1rem;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* Form focus animations */
.input:focus, .select:focus, .textarea:focus {
    transition: border-color 0.2s ease, box-shadow 0.2s ease, outline 0.2s ease;
}

/* Panel de notificaciones: scroll suave */
.notif-panel-scroll {
    scroll-behavior: smooth;
}

/* Sticky action column in scrollable tables */
.table-sticky-actions th:last-child,
.table-sticky-actions td:last-child {
    position: sticky;
    right: 0;
    z-index: 1;
    background: oklch(var(--b1));
    box-shadow: -2px 0 4px -2px rgba(0,0,0,0.08);
}
[dir="rtl"] .table-sticky-actions th:last-child,
[dir="rtl"] .table-sticky-actions td:last-child {
    right: auto;
    left: 0;
    box-shadow: 2px 0 4px -2px rgba(0,0,0,0.08);
}
.table-sticky-actions tr:hover td:last-child {
    background: oklch(var(--b2));
}

/* Responsive: móvil y tablet */
@media (max-width: 767px) {
    .overflow-y-auto {
        overflow-x: hidden;
    }
    .api-keys-page .api-keys-card-body {
        padding: 0.875rem 0.9rem;
    }
    .api-keys-page .card-body .mockup-code pre {
        overflow-x: auto;
    }
    .api-docs-page .api-docs-card-body {
        padding: 0.875rem 0.9rem;
    }
    .api-docs-page .mockup-code,
    .api-docs-page .overflow-x-auto {
        max-width: 100%;
    }
    .api-docs-page .mockup-code pre,
    .api-docs-page pre code {
        overflow-wrap: break-word;
        word-break: normal;
        white-space: pre-wrap;
    }
}

