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

/* Rails-prefixed CSS classes based on shadcn/ui components */

/* Button styles */
.rails-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  transition: all 0.15s ease-in-out;
  outline: none;
  height: 2.25rem;
  padding: 0.5rem 1rem;
  background-color: hsl(222.2 84% 4.9%);
  color: hsl(210 40% 98%);
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  border: 1px solid transparent;
  cursor: pointer;
}

.rails-button:hover {
  background-color: hsl(222.2 84% 4.9% / 0.9);
}

.rails-button:focus-visible {
  border-color: hsl(222.2 84% 4.9%);
  box-shadow: 0 0 0 3px hsl(222.2 84% 4.9% / 0.5);
}

.rails-button:disabled {
  pointer-events: none;
  opacity: 0.5;
  cursor: not-allowed;
}

/* Input styles */
.rails-input {
  display: flex;
  height: 2.25rem;
  width: 100%;
  min-width: 0;
  border-radius: 0.375rem;
  border: 1px solid hsl(214.3 31.8% 91.4%);
  background-color: transparent;
  padding: 0.25rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5rem;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  transition: color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  outline: none;
}

.rails-input::placeholder {
  color: hsl(215.4 16.3% 46.9%);
}

.rails-input:focus-visible {
  border-color: hsl(222.2 84% 4.9%);
  box-shadow: 0 0 0 3px hsl(222.2 84% 4.9% / 0.5);
}

.rails-input:disabled {
  pointer-events: none;
  cursor: not-allowed;
  opacity: 0.5;
}

@media (min-width: 768px) {
  .rails-input {
    font-size: 0.875rem;
    line-height: 1.25rem;
  }
}

/* Label styles */
.rails-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  line-height: 1;
  font-weight: 500;
  user-select: none;
}

.rails-label:has(+ .rails-input:disabled) {
  cursor: not-allowed;
  opacity: 0.5;
}

/* Checkbox styles */
.rails-checkbox {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  border-radius: 0.25rem;
  border: 1px solid hsl(214.3 31.8% 91.4%);
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  transition: box-shadow 0.15s ease-in-out;
  outline: none;
  cursor: pointer;
  appearance: none;
  position: relative;
}

.rails-checkbox:checked {
  background-color: hsl(222.2 84% 4.9%);
  color: hsl(210 40% 98%);
  border-color: hsl(222.2 84% 4.9%);
}

.rails-checkbox:checked::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.75rem;
  line-height: 1;
  color: currentColor;
}

.rails-checkbox:focus-visible {
  border-color: hsl(222.2 84% 4.9%);
  box-shadow: 0 0 0 3px hsl(222.2 84% 4.9% / 0.5);
}

.rails-checkbox:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* Form field container */
.rails-field {
  margin-bottom: 1rem;
}

.rails-field:last-child {
  margin-bottom: 0;
}

/* Actions container */
.rails-actions {
  margin-top: 1.5rem;
}

/* Card components */
.rails-card {
  background-color: hsl(0 0% 100%);
  color: hsl(222.2 84% 4.9%);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  border-radius: 0.75rem;
  border: 1px solid hsl(214.3 31.8% 91.4%);
  padding: 1.5rem 0;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.rails-card-header {
  display: grid;
  grid-auto-rows: min-content;
  grid-template-rows: auto auto;
  align-items: start;
  gap: 0.375rem;
  padding: 0 1.5rem;
}

.rails-card-title {
  line-height: 1;
  font-weight: 600;
  font-size: 1.125rem;
}

.rails-card-description {
  color: hsl(215.4 16.3% 46.9%);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.rails-card-content {
  padding: 0 1.5rem;
}

.rails-card-footer {
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
}

/* Form layout classes */
.rails-form-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.rails-form-fields {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.rails-form-field-group {
  display: grid;
  gap: 0.75rem;
}

.rails-form-row {
  display: flex;
  align-items: center;
}

.rails-form-row .rails-label {
  margin-right: auto;
}

.rails-button-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.rails-button-full {
  width: 100%;
}

.rails-button-outline {
  background-color: transparent;
  border: 1px solid hsl(214.3 31.8% 91.4%);
  color: hsl(222.2 84% 4.9%);
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.rails-button-outline:hover {
  background-color: hsl(210 40% 96%);
  color: hsl(222.2 47.4% 11.2%);
}

.rails-button-outline:focus-visible {
  border-color: hsl(222.2 84% 4.9%);
  box-shadow: 0 0 0 3px hsl(222.2 84% 4.9% / 0.5);
}

/* Typography and links */
.rails-text-sm {
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.rails-text-center {
  text-align: center;
}

.rails-link {
  color: hsl(222.2 84% 4.9%);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.rails-link:hover {
  text-decoration: underline;
}

.rails-link-auto {
  margin-left: auto;
  display: inline-block;
  font-size: 0.875rem;
  line-height: 1.25rem;
  text-underline-offset: 4px;
}

.rails-link-auto:hover {
  text-decoration: underline;
}

.rails-form-footer {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

/* Layout utilities */
.rails-flex-center {
  display: flex;
  min-height: 100svh;
  width: 100%;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.rails-container-sm {
  width: 100%;
  max-width: 24rem;
}

@media (min-width: 768px) {
  .rails-flex-center {
    padding: 2.5rem;
  }
}
