/*
 * 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.
 */

/* Global sizing for buttons and inputs to ensure consistent UI */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1;
  color: #ffffff;
  border-radius: 0.5rem;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease-in-out;
}

.btn-primary {
  background-color: #334155;
  /* slate-700 */
}

.btn-primary:hover {
  background-color: #1e293b;
  /* slate-800 */
}

.btn-gray {
  background-color: #ffffff;
  color: #374151;
  /* gray-700 */
  border: 1px solid #d1d5db;
  /* border-gray-300 */
}

.btn-gray:hover {
  background-color: #f9fafb;
  /* gray-50 */
}

.btn-secondary {
  background-color: #6b7280;
  /* gray-500 */
}

.btn-secondary:hover {
  background-color: #4b5563;
  /* gray-600 */
}

.btn-danger {
  background-color: #dc2626;
  /* red-600 */
}

.btn-danger:hover {
  background-color: #b91c1c;
  /* red-700 */
}

.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 0.75rem;
}

.input {
  min-height: 40px;
  padding: 0 12px;
  font-size: 0.875rem;
  color: #111827;
  /* gray-900 */
  border: 1px solid #d1d5db;
  /* border-gray-300 */
  border-radius: 0.5rem;
  width: 100%;
  background-color: #ffffff;
  line-height: 1.4;
  transition: all 0.2s ease-in-out;
}

.input:focus {
  border-color: #64748b;
  /* slate-500 */
  outline: 2px solid #64748b;
  outline-offset: 0;
  box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.15);
}

/* Custom select styling to avoid default browser look and match project UI */
select.input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'><path stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px 16px;
  padding-right: 36px;
  cursor: pointer;
}

select.input:hover {
  border-color: #9ca3af;
  /* gray-400 */
}

select.input:disabled {
  background-color: #f3f4f6;
  /* gray-100 */
  color: #9ca3af;
  /* gray-400 */
  cursor: not-allowed;
}

textarea.input {
  min-height: 120px;
  padding: 10px 12px;
  line-height: 1.5;
  resize: vertical;
}

/* Modal animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(20px);
  }
}

.animate-fade-in {
  animation: fadeIn 0.2s ease-out;
}

.animate-fade-out {
  animation: fadeOut 0.2s ease-out;
}

.animate-slide-in {
  animation: slideIn 0.2s ease-out;
}

.animate-slide-out {
  animation: slideOut 0.2s ease-out;
}

/* Collapsible sidebar widths */
[data-sidebar-target="sidebar"][data-collapsed="true"] {
  width: 5rem !important;
}

/* Sidebar tooltips (larger text) */
[data-sidebar-target="sidebar"][data-collapsed="true"] .sidebar-tooltip {
  position: relative;
}

[data-sidebar-target="sidebar"][data-collapsed="true"] .sidebar-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 0.5rem;
  padding: 0.375rem 0.5rem;
  background: rgba(17, 24, 39, 0.95);
  /* gray-900 */
  color: #f9fafb;
  /* gray-50 */
  border-radius: 0.375rem;
  font-size: 0.85rem;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
  transform-origin: left center;
}

[data-sidebar-target="sidebar"][data-collapsed="true"] .sidebar-tooltip:hover::after,
[data-sidebar-target="sidebar"][data-collapsed="true"] .sidebar-tooltip:focus-visible::after {
  opacity: 1;
  transform: translate(0.1rem, -50%);
}