/* Admin Panel Styles - TailwindCSS compiled + custom styles */

/* Base TailwindCSS utilities (subset for core functionality) */
*, ::before, ::after {
  box-sizing: border-box;
  border-width: 0;
  border-style: solid;
  border-color: #e5e7eb;
}

html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  margin: 0;
  line-height: inherit;
}

/* Reset for common elements */
h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: inherit;
}

a {
  color: inherit;
  text-decoration: inherit;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 100%;
  line-height: inherit;
  color: inherit;
  margin: 0;
  padding: 0;
}

button {
  cursor: pointer;
  background-color: transparent;
  background-image: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* HTMX loading indicator */
.htmx-indicator {
  opacity: 0;
  transition: opacity 200ms ease-in;
}

.htmx-request .htmx-indicator {
  opacity: 1;
}

.htmx-request.htmx-indicator {
  opacity: 1;
}

/* Loading bar animation */
#htmx-indicator {
  height: 3px;
  background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 50%, #3b82f6 100%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

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

/* Form field styles */
.input {
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #111827;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-error {
  border-color: #ef4444;
}

.input-error:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Dark mode input */
.dark .input {
  background-color: #374151;
  border-color: #4b5563;
  color: #f9fafb;
}

.dark .input:focus {
  border-color: #60a5fa;
}

/* Select styles */
select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

/* Checkbox styles */
.checkbox {
  width: 1rem;
  height: 1rem;
  border-radius: 0.25rem;
  border: 1px solid #d1d5db;
  background-color: #fff;
  cursor: pointer;
}

.checkbox:checked {
  background-color: #3b82f6;
  border-color: #3b82f6;
  background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
}

/* Button styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  border-radius: 0.5rem;
  transition: all 0.15s ease-in-out;
}

.btn-primary {
  color: #fff;
  background-color: #3b82f6;
  border: 1px solid #3b82f6;
}

.btn-primary:hover {
  background-color: #2563eb;
  border-color: #2563eb;
}

.btn-secondary {
  color: #374151;
  background-color: #f3f4f6;
  border: 1px solid #e5e7eb;
}

.btn-secondary:hover {
  background-color: #e5e7eb;
}

.btn-ghost {
  color: #6b7280;
  background-color: transparent;
  border: 1px solid transparent;
}

.btn-ghost:hover {
  background-color: #f3f4f6;
  color: #374151;
}

.btn-danger {
  color: #fff;
  background-color: #ef4444;
  border: 1px solid #ef4444;
}

.btn-danger:hover {
  background-color: #dc2626;
  border-color: #dc2626;
}

.btn-sm {
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
}

/* Table styles */
table {
  width: 100%;
}

th {
  text-align: left;
  font-weight: 500;
}

/* Badge styles */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.25rem;
  border-radius: 9999px;
}

.badge-sm {
  padding: 0.0625rem 0.5rem;
  font-size: 0.625rem;
}

/* Status badge colors */
.badge-pending { background-color: #fef3c7; color: #92400e; }
.badge-confirmed { background-color: #dbeafe; color: #1e40af; }
.badge-searching { background-color: #f3e8ff; color: #6b21a8; }
.badge-in_progress { background-color: #e0e7ff; color: #3730a3; }
.badge-completed { background-color: #d1fae5; color: #065f46; }
.badge-cancelled { background-color: #fee2e2; color: #991b1b; }

/* Card styles — Enterprise SaaS elevation system */
.card {
  background-color: #fff;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.card-raised {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.dark .card {
  background-color: #1f2937;
  border-color: #374151;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Sidebar nav transitions */
.sidebar-rail a,
.sidebar-rail button {
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

/* Toast styles */
.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  background-color: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
}

.dark .toast {
  background-color: #1f2937;
  border-color: #374151;
}

.toast-success { border-left: 4px solid #10b981; }
.toast-error { border-left: 4px solid #ef4444; }
.toast-warning { border-left: 4px solid #f59e0b; }
.toast-info { border-left: 4px solid #3b82f6; }

/* Form label */
.form-label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
}

.dark .form-label {
  color: #d1d5db;
}

.form-help {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: #6b7280;
}

.form-error {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: #ef4444;
}

/* Alpine.js cloak */
[x-cloak] {
  display: none !important;
}

/* Alpine.js collapse transition */
[x-collapse] {
  overflow: hidden;
}

/* Spinner */
.spinner {
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid #e5e7eb;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.dark ::-webkit-scrollbar-track {
  background: #1f2937;
}

.dark ::-webkit-scrollbar-thumb {
  background: #4b5563;
}

/* Utility classes */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Dark mode audio player contrast fix */
.dark audio {
    filter: invert(1) hue-rotate(180deg);
    border-radius: 9999px;
}

/* Responsive table */
@media (max-width: 768px) {
  .table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Thin scrollbar for sidebar rail */
.sidebar-rail::-webkit-scrollbar {
  width: 4px;
}
.sidebar-rail::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-rail::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 2px;
}
.sidebar-rail:hover::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.12);
}
.dark .sidebar-rail:hover::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
}
