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

/* Base styles */
:root {
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 0.75rem;
  --space-lg: 1rem;
  --space-xl: 1.5rem;
  --space-2xl: 2rem;

  /* Radii */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 1rem;

  /* Colors */
  --color-white: #ffffff;
  --color-surface: #f0f0f0;
  --color-surface-muted: #fafafa;
  --color-border: #e0e0e0;

  --color-success-surface: #d1e7dd;
  --color-success-surface-alpha: #d1e7dd48;
  --color-success-surface-hover: #d1e7dd9f;
  --color-success-border: #a3cfbb;
  --color-success-text: #0a3622;
  --color-success-accent: #3a956c;
  --color-success-main: #198754;
  --color-success-dark: #0b683e;

  /* Typography */
  --font-size-h1: 2.5rem;
  --font-size-h2: 1.75rem;
  --font-size-h3: 1.5rem;
}

/* Headings */
h1,
h2 {
  font-weight: 600;
}

h1 {
  font-size: var(--font-size-h1);
}

h2 {
  font-size: var(--font-size-h2);
}

h3 {
  font-size: var(--font-size-h3);
}

/* Code blocks */
pre,
code,
.trix-content pre {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
}

pre,
.trix-content pre {
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.5;
}

code {
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
}

/* Layout styles */
.container {
  max-width: 800px;
}

.container-sm {
  margin-inline: auto;
  max-width: 30rem;
}

/* Component styles */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-block: var(--space-md);
  background-color: var(--color-surface);
  font-weight: 600;
  font-size: 1.125rem;
}

.card-body {
  padding: var(--space-xl);
}

.card--completed {
  border: 1px solid var(--color-success-border);
  background-color: var(--color-success-surface-alpha);

  .card-header {
    background-color: var(--color-success-surface);
    color: var(--color-success-text);
  }

  .form-check-input:checked {
    background-color: var(--color-success-accent);
    border-color: var(--color-success-accent);
  }

  .btn-outline-primary {
    background-color: var(--color-white);
    border-color: var(--color-success-main);
    color: var(--color-success-main);

    &:hover {
      background-color: var(--color-success-main);
      border-color: var(--color-success-main);
      color: var(--color-white);
    }
  }

  pre {
    background-color: var(--color-success-surface);
    border-color: var(--color-success-border);
  }
}

.day-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  text-align: center;
  text-decoration: none;
  text-shadow: 0 0 20px var(--color-white);
  line-height: 1;
  padding: var(--space-2xl);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  transition: all 0.2s ease-in-out;

  &:hover {
    background-color: var(--color-surface-muted);
    transform: scale(1.03);
    box-shadow: 0 0.25rem 0.5rem rgb(0 0 0 / 5%);
  }

  &.disabled {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
    background-color: var(--color-surface);
    border-color: var(--color-border);
    padding: var(--space-lg);
  }
}

.day-card--completed {
  border: 1px solid var(--color-success-border);
  background-color: var(--color-success-surface-alpha);
  color: var(--color-success-dark);

  &:hover {
    background-color: var(--color-success-surface-hover);
  }
}

.list-group-item {
  padding: var(--space-lg);
  transition: all 0.2s ease-in-out;

  &:hover {
    background-color: var(--color-surface-muted);
  }
}

trix-editor.min-height-md {
  min-height: 7rem;
}

trix-editor.min-height-lg {
  min-height: 14rem;
}
