/* Theme toggle overrides - force light mode when .light class is on html */
html.light {
  color-scheme: light;
}

html.light body {
  background-color: #f5f5f5 !important;
}

html.light .dark\:bg-neutral-950,
html.light .dark\:bg-neutral-900,
html.light .dark\:bg-neutral-800,
html.light .dark\:bg-neutral-700 {
  background-color: inherit !important;
}

html.light .dark\:text-white,
html.light .dark\:text-neutral-100,
html.light .dark\:text-neutral-200,
html.light .dark\:text-neutral-300,
html.light .dark\:text-neutral-400 {
  color: inherit !important;
}

html.light .dark\:border-neutral-700,
html.light .dark\:border-neutral-800 {
  border-color: inherit !important;
}

/* Theme toggle overrides - force dark mode when .dark class is on html */
html.dark {
  color-scheme: dark;
}

html.dark body {
  background-color: #0a0a0a !important;
}

html.dark aside {
  background-color: #171717 !important;
}

html.dark .bg-white {
  background-color: #262626 !important;
}

html.dark .bg-neutral-100 {
  background-color: #171717 !important;
}

html.dark .bg-neutral-50 {
  background-color: #171717 !important;
}

html.dark .text-neutral-900 {
  color: #fafafa !important;
}

html.dark .text-neutral-800 {
  color: #e5e5e5 !important;
}

html.dark .text-neutral-700 {
  color: #d4d4d4 !important;
}

html.dark .text-neutral-600 {
  color: #a3a3a3 !important;
}

html.dark .text-neutral-500 {
  color: #a3a3a3 !important;
}

html.dark .border-neutral-200 {
  border-color: #404040 !important;
}

html.dark .border-neutral-100 {
  border-color: #404040 !important;
}

html.dark .divide-neutral-200 > :not(:last-child) {
  border-color: #404040 !important;
}

html.dark .form-control {
  background-color: #404040 !important;
  color: #fafafa !important;
}

html.dark .form-control::placeholder {
  color: #a3a3a3 !important;
}

html.dark select:not([multiple]) {
  background-color: #404040 !important;
  color: #fafafa !important;
}

html.dark label, html.dark .label {
  color: #f5f5f5 !important;
}

html.dark [type=checkbox] {
  background-color: #262626 !important;
  border-color: rgba(255,255,255,0.2) !important;
}

html.dark .ts-wrapper.single .ts-control,
html.dark .ts-wrapper.multi .ts-control {
  background-color: #374151 !important;
  color: #f3f4f6 !important;
  box-shadow: inset 0 0 0 1px #4b5563 !important;
}

html.dark .ts-dropdown {
  background-color: #1f2937 !important;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.1) !important;
}

html.dark .ts-dropdown .option {
  color: #e5e7eb !important;
  background-color: #1f2937 !important;
}

html.dark .ts-dropdown .option:hover,
html.dark .ts-dropdown .option.active {
  background-color: #374151 !important;
  color: #f9fafb !important;
}

/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Multi-select dropdown styles */
.multiselect-wrapper {
  position: relative;
  width: 100%;
}

.multiselect-display {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: 0.5rem;
  background-color: white;
  color: #1f2937;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 38px;
  font-size: 0.875rem;
  box-shadow: inset 0 0 0 1px #d1d5db;
  transition: box-shadow 0.15s ease-in-out;
}

.multiselect-display:hover {
  box-shadow: inset 0 0 0 1px #9ca3af;
}

.multiselect-display::after {
  content: '';
  width: 1.25em;
  height: 1.25em;
  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-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}

.multiselect-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background-color: white;
  border: none;
  border-radius: 0.5rem;
  max-height: 240px;
  overflow-y: auto;
  z-index: 50;
  display: none;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.multiselect-dropdown.show {
  display: block;
}

.multiselect-option {
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 0.875rem;
  color: #374151;
  gap: 0.5rem;
}

.multiselect-option:hover {
  background-color: #f3f4f6;
}

.multiselect-option.select-all {
  border-bottom: 1px solid #e5e7eb;
  font-weight: 600;
  color: #111827;
}

.multiselect-option input[type="checkbox"] {
  cursor: pointer;
  flex-shrink: 0;
}

.multiselect-option label {
  margin: 0;
  cursor: pointer;
  flex: 1;
  user-select: none;
}

/* Dark mode support for multiselect */
@media (prefers-color-scheme: dark) {
  .multiselect-display {
    background-color: #374151;
    color: #f3f4f6;
    box-shadow: inset 0 0 0 1px #4b5563;
  }

  .multiselect-display:hover {
    box-shadow: inset 0 0 0 1px #6b7280;
  }

  .multiselect-display::after {
    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='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  }

  .multiselect-dropdown {
    background-color: #1f2937;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.1);
  }

  .multiselect-option {
    color: #e5e7eb;
  }

  .multiselect-option:hover {
    background-color: #374151;
  }

  .multiselect-option.select-all {
    border-bottom-color: #374151;
    color: #f9fafb;
  }
}

/* Calendar styles */
.calendar-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.calendar-navigation h1 {
  margin: 0;
}

.calendar-nav-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.calendar-nav-link {
  padding: 0.5rem 1rem;
  background-color: #007bff;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.calendar-nav-link:hover {
  background-color: #0056b3;
}

.calendar-container {
  background-color: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.calendar-table {
  width: 100%;
  border-collapse: collapse;
}

.calendar-table th {
  background-color: #f8f9fa;
  padding: 1rem;
  text-align: center;
  font-weight: bold;
  border: 1px solid #dee2e6;
}

.calendar-table td {
  border: 1px solid #dee2e6;
  height: 100px;
  vertical-align: top;
  padding: 0;
  position: relative;
  overflow: hidden;
}

.calendar-day {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0.5rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
  box-sizing: border-box;
}

.calendar-day:hover {
  background-color: #f8f9fa;
  text-decoration: none;
  color: inherit;
}

.calendar-day.has-calls {
  background-color: #e3f2fd;
}

.calendar-day.has-calls:hover {
  background-color: #bbdefb;
}

.calendar-day-number {
  font-weight: bold;
  margin-bottom: 0.25rem;
}

.calendar-call-count {
  color: #1976d2;
  font-size: 0.875rem;
  font-weight: bold;
}

.calendar-day.other-month {
  background-color: #f5f5f5;
  color: #999;
}

.calendar-day.other-month.has-calls {
  background-color: #e8e8e8;
}

.calendar-day.today {
  box-shadow: inset 0 0 0 2px #ff6b6b;
}

.calendar-summary {
  margin-top: 1.5rem;
  text-align: center;
  color: #666;
}

.calendar-filters {
  background-color: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 2rem;
}

/* TomSelect Custom Styles */
.ts-wrapper {
  width: 100%;
}

.ts-wrapper.single .ts-control,
.ts-wrapper.multi .ts-control {
  background-color: white;
  border: none;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  min-height: 38px;
  font-size: 0.875rem;
  box-shadow: inset 0 0 0 1px #d1d5db;
  cursor: pointer;
}

.ts-wrapper.single .ts-control:hover,
.ts-wrapper.multi .ts-control:hover {
  box-shadow: inset 0 0 0 1px #9ca3af;
}

.ts-wrapper.focus .ts-control {
  box-shadow: inset 0 0 0 2px #3b82f6;
}

.ts-control > input {
  font-size: 0.875rem;
}

.ts-control > input::placeholder {
  color: #9ca3af;
}

.ts-dropdown {
  border: none;
  border-radius: 0.5rem;
  margin-top: 4px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.05);
  background-color: white;
}

.ts-dropdown .option {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: #374151;
}

.ts-dropdown .option:hover,
.ts-dropdown .option.active {
  background-color: #f3f4f6;
  color: #111827;
}

.ts-dropdown .option.selected {
  background-color: #eff6ff;
  color: #1d4ed8;
}

.ts-dropdown .no-results {
  padding: 0.75rem;
  text-align: center;
  color: #9ca3af;
  font-size: 0.875rem;
}

/* Multi-select items */
.ts-wrapper.multi .ts-control > .item {
  background-color: #e0e7ff;
  color: #3730a3;
  border: none;
  border-radius: 0.375rem;
  padding: 0.125rem 0.5rem;
  margin: 0.125rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.ts-wrapper.multi .ts-control > .item .remove {
  border: none;
  color: #6366f1;
  font-size: 1rem;
  line-height: 1;
}

.ts-wrapper.multi .ts-control > .item .remove:hover {
  color: #4338ca;
  background: transparent;
}

/* Checkbox options plugin */
.ts-dropdown .option input[type="checkbox"] {
  margin-right: 0.5rem;
}

/* Clear button */
.ts-wrapper .clear-button {
  color: #9ca3af;
}

.ts-wrapper .clear-button:hover {
  color: #6b7280;
}

/* Count display */
.ts-count {
  color: #6b7280;
  font-size: 0.875rem;
}

/* Light mode TomSelect styles - explicit to override OS dark mode preference */
html.light .ts-wrapper.single .ts-control,
html.light .ts-wrapper.multi .ts-control {
  background-color: white !important;
  color: #374151 !important;
  box-shadow: inset 0 0 0 1px #d1d5db !important;
}

html.light .ts-wrapper.single .ts-control:hover,
html.light .ts-wrapper.multi .ts-control:hover {
  box-shadow: inset 0 0 0 1px #9ca3af !important;
}

html.light .ts-wrapper.focus .ts-control {
  box-shadow: inset 0 0 0 2px #3b82f6 !important;
}

html.light .ts-control > input {
  color: #374151 !important;
}

html.light .ts-control > input::placeholder {
  color: #9ca3af !important;
}

html.light .ts-dropdown,
html.light .ts-dropdown.single,
html.light .ts-dropdown.multi {
  background-color: white !important;
  border-color: #e5e7eb !important;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.05) !important;
}

html.light .ts-dropdown .ts-dropdown-content {
  background-color: white !important;
}

html.light .ts-dropdown .option,
html.light .ts-dropdown [data-selectable] {
  color: #374151 !important;
  background-color: white !important;
}

html.light .ts-dropdown .option:hover,
html.light .ts-dropdown .option.active,
html.light .ts-dropdown [data-selectable]:hover {
  background-color: #f3f4f6 !important;
  color: #111827 !important;
}

html.light .ts-dropdown .option.selected,
html.light .ts-dropdown .active.selected {
  background-color: #eff6ff !important;
  color: #1d4ed8 !important;
}

html.light .ts-dropdown .no-results {
  color: #9ca3af !important;
}

html.light .ts-wrapper.multi .ts-control > .item {
  background-color: #e0e7ff !important;
  color: #3730a3 !important;
}

html.light .ts-wrapper.multi .ts-control > .item .remove {
  color: #6366f1 !important;
}

html.light .ts-wrapper.multi .ts-control > .item .remove:hover {
  color: #4338ca !important;
  background: transparent !important;
}

html.light .ts-wrapper .clear-button {
  color: #9ca3af !important;
}

html.light .ts-wrapper .clear-button:hover {
  color: #6b7280 !important;
}

html.light .ts-count {
  color: #6b7280 !important;
}

/* Checkbox styling in light mode */
html.light .ts-dropdown .option input[type="checkbox"] {
  accent-color: #3b82f6;
}
