/* Liding Admin - Custom Styles */

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

/* PWA safe areas */
body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    -webkit-tap-highlight-color: transparent;
}

/* Prevent pull-to-refresh on mobile */
html {
    overscroll-behavior: none;
}

/* Mobile table improvements */
@media (max-width: 640px) {
    .admin-table th,
    .admin-table td {
        padding: 0.5rem 0.625rem;
        font-size: 0.75rem;
    }

    .admin-table th {
        font-size: 0.625rem;
    }
}

/* Loading bar animation */
@keyframes loading-bar {
    0% { width: 0; margin-left: 0; }
    50% { width: 70%; margin-left: 15%; }
    100% { width: 0; margin-left: 100%; }
}

.animate-loading-bar {
    animation: loading-bar 1.2s ease-in-out infinite;
}

/* Logo loading animation - gradient paint left to right */
@keyframes logo-paint {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.logo-loading {
    background: linear-gradient(
        90deg,
        #ffffff 0%,
        #ffffff 30%,
        #60a5fa 45%,
        #3b82f6 50%,
        #60a5fa 55%,
        #ffffff 70%,
        #ffffff 100%
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: logo-paint 1.5s ease-in-out infinite;
}

/* HTMX loading indicator */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline-block;
}

.htmx-request.htmx-indicator {
    display: inline-block;
}

/* Smooth transitions for HTMX swaps */
.htmx-swapping {
    opacity: 0;
    transition: opacity 0.15s ease-out;
}

.htmx-settling {
    opacity: 1;
    transition: opacity 0.15s ease-in;
}

/* Table styles */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.admin-table td {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: #111827;
    border-bottom: 1px solid #f3f4f6;
}

.admin-table tbody tr:hover {
    background-color: #f9fafb;
}

/* Dark mode table styles */
.dark .admin-table th {
    color: #9ca3af;
    background-color: #1f2937;
    border-bottom-color: #374151;
}

.dark .admin-table td {
    color: #e5e7eb;
    border-bottom-color: #1f2937;
}

.dark .admin-table tbody tr:hover {
    background-color: #1f2937;
}

/* Snake draft tile direction */
.direction-rtl {
    direction: rtl;
}

/* Dark mode form controls */
.dark select,
.dark input[type="text"],
.dark input[type="search"] {
    background-color: #1f2937;
    border-color: #374151;
    color: #e5e7eb;
}

/* Dark mode cards & borders */
.dark .border-gray-200 {
    border-color: #374151;
}

.dark .bg-white {
    background-color: #111827;
}

.dark .text-gray-900 {
    color: #f3f4f6;
}

.dark .text-gray-700 {
    color: #d1d5db;
}

.dark .text-gray-500 {
    color: #9ca3af;
}

.dark .text-gray-400 {
    color: #6b7280;
}

.dark .bg-gray-50 {
    background-color: #0f172a;
}

.dark .border-gray-100 {
    border-color: #1f2937;
}

.dark .border-gray-300 {
    border-color: #4b5563;
}

.dark .hover\:bg-gray-50:hover {
    background-color: #1f2937;
}

.dark .border-dashed {
    border-color: #4b5563;
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 100;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    animation: toast-in 0.3s ease-out;
}

.toast-success {
    background-color: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.toast-error {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

@keyframes toast-in {
    from {
        transform: translateY(1rem);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
