/* PetNib - Custom CSS */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Body min height */
body {
    min-height: 100dvh;
}

/* Material Symbols filled style helper */
.material-symbols-filled {
    font-variation-settings: 'FILL' 1;
}

/* Star rating filled */
.star-filled {
    font-variation-settings: 'FILL' 1;
    color: #ff6933;
}

.star-empty {
    font-variation-settings: 'FILL' 0;
    color: #d1d5db;
}

/* Scanner line animation */
@keyframes scanLine {
    0% { top: 0%; }
    50% { top: 100%; }
    100% { top: 0%; }
}

.animate-scan-line {
    animation: scanLine 2s linear infinite;
}

/* Float animation */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, #e7deda 25%, #f0ebe8 50%, #e7deda 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.5rem;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Hide scrollbar but keep scroll functionality */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* Bottom nav safe area for iOS */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    #bottom-nav {
        padding-bottom: calc(env(safe-area-inset-bottom) + 12px);
    }
}

/* App sidebar nav link */
.sidebar-nav-link {
    color: #8d6a5e;
    transition: all 0.2s;
    justify-content: center;
}

@media (min-width: 1024px) {
    .sidebar-nav-link {
        justify-content: flex-start;
    }
}

.sidebar-nav-link:hover {
    background-color: rgba(255, 105, 51, 0.05);
    color: #ff6933;
}

.sidebar-nav-link.active {
    background-color: rgba(255, 105, 51, 0.1);
    color: #ff6933;
    font-weight: 700;
}

.sidebar-nav-link.active .material-symbols-outlined {
    font-variation-settings: 'FILL' 1;
}

/* Dark mode sidebar nav */
.dark .sidebar-nav-link {
    color: #bcaaa4;
}

.dark .sidebar-nav-link:hover {
    background-color: rgba(255, 105, 51, 0.1);
    color: #ff6933;
}

.dark .sidebar-nav-link.active {
    background-color: rgba(255, 105, 51, 0.15);
    color: #ff6933;
}

/* Admin sidebar active link */
.admin-nav-link {
    color: #8d6a5e;
    transition: all 0.2s;
}

.admin-nav-link:hover {
    background-color: rgba(255, 105, 51, 0.05);
    color: #ff6933;
}

.admin-nav-link.active {
    background-color: rgba(255, 105, 51, 0.1);
    color: #ff6933;
    font-weight: 700;
}

/* Dark mode admin nav */
.dark .admin-nav-link {
    color: #bcaaa4;
}

.dark .admin-nav-link:hover {
    background-color: rgba(255, 105, 51, 0.1);
    color: #ff6933;
}

/* Toast enter animation */
.toast-enter {
    animation: toastIn 0.3s ease-out;
}

@keyframes toastIn {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Input focus ring override */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #ff6933 !important;
    box-shadow: 0 0 0 1px #ff6933;
}

/* Fix: Tailwind Forms plugin adds background-image arrow on selects.
   We use custom Material Symbols icons instead. */
select.appearance-none,
select[class*="appearance-none"] {
    background-image: none !important;
}

/* Checkbox custom */
input[type="checkbox"]:checked {
    background-color: #ff6933;
    border-color: #ff6933;
}

/* Toggle switch */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background-color: #d1d5db;
    border-radius: 9999px;
    transition: background-color 0.3s;
    cursor: pointer;
}

.toggle-switch.active {
    background-color: #ff6933;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 9999px;
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.toggle-switch.active::after {
    transform: translateX(20px);
}

/* Searchable Select dropdown scrollbar */
.pnb-select ul { scrollbar-width: thin; scrollbar-color: #e7deda transparent; }
.dark .pnb-select ul { scrollbar-color: #4a2b22 transparent; }
.pnb-select ul::-webkit-scrollbar { width: 4px; }
.pnb-select ul::-webkit-scrollbar-track { background: transparent; }
.pnb-select ul::-webkit-scrollbar-thumb { background-color: #e7deda; border-radius: 4px; }
.dark .pnb-select ul::-webkit-scrollbar-thumb { background-color: #4a2b22; }

/* Smooth scrolling on iOS */
.pnb-select ul { -webkit-overflow-scrolling: touch; }

/* Hide sidebar on auth pages (overrides responsive classes) */
.sidebar-auth-hidden {
    display: none !important;
}
