/* PCT Custom Styles — supplements DaisyUI/Tailwind CDN */

/* Screen-reader-only utility (fallback if Tailwind CDN doesn't load) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus visible styles for keyboard navigation */
*:focus-visible {
    outline: 2px solid oklch(var(--p));
    outline-offset: 2px;
}

/* Ensure sidebar drawer takes full height */
.drawer-side .menu li a.active {
    background-color: oklch(var(--p) / 0.15);
    color: oklch(var(--p));
    font-weight: 600;
}

/* Template card hover */
.template-card:hover {
    transform: translateY(-2px);
    transition: transform 0.15s ease;
}

/* Colour picker sync input */
input[type="color"] {
    -webkit-appearance: none;
    border: none;
    padding: 0;
    cursor: pointer;
}
input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}
input[type="color"]::-webkit-color-swatch {
    border: 1px solid oklch(var(--bc) / 0.2);
    border-radius: var(--rounded-btn, 0.5rem);
}

/* Skeleton pulse for dashboard loading */
.skeleton-card {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Editor — Fabric.js canvas container */
.editor-canvas-area .canvas-container {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border-radius: 2px;
}

/* Editor — placeholder label overlay (rendered via Fabric.js) */
.placeholder-label {
    font-size: 12px;
    color: #888;
    pointer-events: none;
}

/* Editor — autosave pulse animation */
#autosave-icon.animate-pulse {
    animation: pulse 1s ease-in-out infinite;
}

/* Editor — toolbar divider fix for DaisyUI */
.editor-toolbar .divider-horizontal {
    width: 1px;
    height: 24px;
    margin: 0 4px;
}

/* Editor — mobile toolbar horizontal scroll */
@media (max-width: 640px) {
    .editor-toolbar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        gap: 0.25rem !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    .editor-toolbar .btn {
        flex-shrink: 0;
    }
    .editor-toolbar .divider-horizontal {
        height: 20px;
    }
}

/* Categories — responsive table on mobile */
@media (max-width: 640px) {
    #categories-table th:nth-child(3),
    #categories-table td:nth-child(3) {
        display: none;
    }
}

/* Mobile touch: prevent double-tap zoom on buttons */
button, .btn, a {
    touch-action: manipulation;
}
