/* Mind4me - Unified Stylesheet */

:root {
  --app-bg: #f7f9ff;
  --surface: #ffffff;
  --surface-soft: #eaf2ff;
  --line: #c7d5f0;
  --line-strong: #a8dbf9;
  --text: #080a3c;
  --muted: #40476a;
  --primary: #0e14a4;
  --primary-dark: #080a6c;
  --secondary: #571cf2;
  --accent: #0ed9fd;
  --deadline: #b85c00;
  --danger: #c62848;
  --success: #087f6d;
  --disabled: #9aa4be;
  --info: #0652f1;
  --low: #1a20dc;
  --medium: #0e14a4;
  --high: #b85c00;
  --very-high: #c62848;
}

/* ============================================
   GLOBAL STYLES
   ============================================ */
* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  color: var(--text);
  margin: 0;
  padding: 0;
  background: var(--app-bg);
}

/* ============================================
   HEADER STYLES
   ============================================ */
.header {
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  padding: 0.75rem 2rem;
  box-shadow: 0 1px 0 var(--line);
}

.header-content {
  max-width: 1500px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.8rem;
  font-weight: bold;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.logo img {
  height: 64px;
  width: auto;
  vertical-align: middle;
}

/* Header navigation */
.header nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
}

.header nav a {
  color: var(--muted);
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.header nav a:hover {
  color: var(--primary);
  opacity: 1;
}

.language-selector {
  position: relative;
  flex: 0 0 auto;
  margin-left: 1rem;
}

.language-selector-toggle {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.language-selector-toggle:hover,
.language-selector.open .language-selector-toggle {
  background: #a8dbf9;
}

.language-selector-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  display: none;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
  z-index: 20;
}

.language-selector.open .language-selector-menu {
  display: block;
}

.language-selector-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.65rem;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.language-selector-option:hover,
.language-selector-option.active {
  background: var(--surface-soft);
}

.language-flag-icon {
  width: 28px;
  height: 20px;
  display: block;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.header-buttons {
  display: flex;
  gap: 1rem;
}

/* Impersonation styles */
.header.impersonating {
  background: #b85c00;
  color: #fff;
}

.impersonate-info {
  color: #fff;
  font-size: 0.4em;
  margin-left: 1rem;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn, button {
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  cursor: pointer;
  border: 2px solid transparent;
  display: inline-block;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: white;
  border-color: var(--primary-dark);
}

.btn-secondary, button.secondary {
  background: transparent;
  color: white;
  border-color: white;
}

.btn-secondary:hover, button.secondary:hover {
  background: white;
  color: var(--primary);
}

button {
  background: var(--primary);
  color: #fff;
  border: 1px solid var(--primary);
}

button.stop-impersonate {
  background: var(--danger);
  border-color: var(--danger);
  font-size: 0.9em;
  padding: 0.4rem 0.8rem;
}

/* ============================================
   HERO SECTION (Homepage)
   ============================================ */
.hero {
  background: linear-gradient(135deg, #0652f1 0%, #571cf2 58%, #0ed9fd 100%);
  color: white;
  padding: 2rem 1rem;
  text-align: center;
  margin-top: 1.5rem;
}

.hero-content {
  max-width: 1200px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.hero p {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  opacity: 0.95;
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.container {
  max-width: 1500px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

body.homepage .container{
  padding: 1.5rem 2rem;
}


/* For authenticated pages (base.html) */
body.authenticated {
}

body.authenticated.manager {
}

.section-title {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--text);
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 8px 24px rgba(8, 10, 108, 0.08);
}

.card-narrow {
  max-width: 1000px;
}

.message-success {
  color: var(--success);
  margin: 0.5rem 0;
}

.field-narrow {
  max-width: 480px;
}

.mt-0 {
  margin-top: 0;
}

.mt-15 {
  margin-top: 15px;
}

.mt-20 {
  margin-top: 20px;
}

.mb-15 {
  margin-bottom: 15px;
}

.ml-1rem {
  margin-left: 1rem;
}

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

.text-danger {
  color: var(--danger);
}

.text-danger-strong {
  color: var(--danger);
  font-weight: bold;
}

.text-muted {
  color: var(--muted);
}

input,
select,
textarea {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  padding: 0.55rem 0.65rem;
}

.textarea-full {
  width: 100%;
}

.text-small {
  font-size: 75%;
}

.filter-actions {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding-bottom: 10px;
}

.filter-submit {
  padding: 11px 16px;
  font-family: system-ui, sans-serif;
  font-size: 100%;
  background: var(--primary);
  border-color: var(--primary);
}

.button-reset {
  padding: 9px 16px;
  background-color: var(--surface-soft);
  border: 1px solid var(--line-strong);
  color: var(--text);
  color: white;
  text-decoration: none;
  border-radius: 8px;
}

.button-reset {
  color: var(--text);
}

.list-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.55rem;
}

.data-table thead tr {
  color: var(--muted);
}

.data-table tbody tr {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(8, 10, 108, 0.06);
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 10px;
}

.data-table tbody td:first-child {
  border-left: 1px solid var(--line);
  border-radius: 8px 0 0 8px;
}

.data-table tbody td:last-child {
  border-right: 1px solid var(--line);
  border-radius: 0 8px 8px 0;
}

.data-table tbody td {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.manager-user-select {
  min-width: 120px;
  max-width: 160px;
  margin: 0;
}

.manager-user-actions {
  width: 220px;
}

.manager-user-actions form {
  margin: 0;
  margin-right: 15px;
  float: left;
}

.manager-user-save {
  padding: 0.45rem 0.9rem;
}

.manager-user-saved {
  color: var(--success);
  display: inline-block;
}

.manager-user-activate-form {
  display: inline-block;
  margin-left: 0.5rem;
}

.manager-user-activate {
  background: var(--success);
  border-color: var(--success);
  padding: 0.45rem 0.9rem;
}

.manager-user-save[hidden],
.manager-user-saved[hidden] {
  display: none;
}

.confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  padding: 1rem;
}

.confirm-backdrop[hidden] {
  display: none;
}

.confirm-dialog {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.confirm-dialog h2 {
  font-size: 1.25rem;
  margin: 0 0 0.75rem;
}

.confirm-dialog p {
  margin-top: 0;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.confirm-button-secondary {
  background: var(--surface-soft);
  border-color: var(--line-strong);
  color: var(--text);
}

.confirm-button-secondary:hover {
  background: #a8dbf9;
  color: var(--text);
}

.confirm-button-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.todo-row {
  cursor: pointer;
}

.todo-row:hover,
.todo-row:focus {
  background: var(--surface-soft);
}

.todo-title-cell {
  position: relative;
}

.importance-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.45rem;
}

.importance-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-size: 0.85rem;
  color: #fff;
}

.importance-info { background: var(--info); }
.importance-low { background: var(--low); }
.importance-medium { background: var(--medium); }
.importance-high { background: var(--high); }
.importance-very-high { background: var(--very-high); }

.todo-detail-dialog {
  width: min(680px, 100%);
  max-height: 90vh;
  overflow-y: auto;
}

.todo-detail-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.todo-detail-header h2 {
  flex: 1;
  margin: 0;
}

.todo-detail-header-actions {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}

.todo-detail-close-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.icon-button,
.icon-link {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  text-decoration: none;
}

.icon-button:hover,
.icon-link:hover {
  background: var(--surface-soft);
}

.icon-button-danger {
  color: var(--danger);
}

.todo-detail-list {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0.35rem 0.75rem;
}

.todo-detail-list dt {
  font-weight: 600;
}

.todo-detail-list dd {
  margin: 0;
}

.todo-detail-description p {
  white-space: pre-wrap;
}

.card div h3,
.card h2, h1 {
  margin-top: 0;
}

h1 {
  font-size: 1.5em;
}

h2 {
  margin-top: 0;
  font-size: 1.3em;
}

/* ============================================
   THEME & EVENT CARDS (Homepage)
   ============================================ */
.theme-card {
  margin-bottom: 3rem;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.theme-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.theme-header {
  background: linear-gradient(135deg, #0652f1 0%, #571cf2 58%, #0ed9fd 100%);
  color: white;
  padding: 2rem;
}

.theme-name {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.theme-description {
  font-size: 1.1rem;
  opacity: 0.95;
  margin-bottom: 0.5rem;
}

.theme-place {
  font-size: 1rem;
  opacity: 0.9;
  font-style: italic;
}

.theme-content {
  display: flex;
  gap: 2rem;
  padding: 2rem;
}

.theme-image-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem; /* space between image and link */
  width: 260px;
}

.theme-image {
  width: 100%;
  height: auto;
  border-radius: 8px;
  max-height: 400px;
}

.theme-placeholder {
  width: 100%;
  height: 300px;
  background: linear-gradient(135deg, #eaf2ff 0%, #a8dbf9 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--secondary);
  font-size: 1.2rem;
  font-weight: 600;
}

.events-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.event-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  background: var(--surface-soft);
}

.event-card:hover {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 4px 8px rgba(6, 82, 241, 0.18);
}

.event-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
}

.event-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.event-info-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.event-info-label {
  font-weight: 600;
  color: var(--text);
}

.event-price {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
}

.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--disabled);
  font-size: 1.1rem;
}

/* ============================================
   FORMS
   ============================================ */
input,
select,
textarea {
  padding: 0.5rem;
  margin: 0.25rem 0 0.75rem;
  width: 100%;
  max-width: 480px;
}

input.form-check-input {
  width: auto;
  max-width: auto;
}

form .row,
form .row_by2 {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

form .row > div {
  flex: 1 1 220px;
  margin-right: 20px;
}

form .row_by2 > div {
  flex: 1 1 330px;
  margin-right: 20px;
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  margin: 0.25rem 0 0.75rem;
}

.radio-group label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  white-space: nowrap;
}

.radio-group input[type="radio"] {
  width: auto;
  max-width: none;
  margin: 0;
}

form div.allergies ul {
  margin-top: 0;
  padding-inline-start: 25px;
}

div.longtext {
  width: 100%;
}

div.longtext label {
  display: block;
  margin-bottom: 4px;
}

div.longtext textarea {
  width: 95%;
}

.error {
  color: var(--danger);
  margin: 0.5rem 0;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: linear-gradient(145deg, #080a6c 0%, #1a20dc 55%, #571cf2 100%);
  color: white;
  padding: 0.75rem 2rem;
  margin-top: 1rem;
}

.footer-content {
  max-width: 1500px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer h3 {
  font-size: 1rem;
  margin: 0;
}

.footer-contact {
  display: flex;
  gap: 1.5rem;
  font-size: 1rem;
  margin: 0;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.footer-contact a {
  color: #a8dbf9;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-contact a:hover {
  color: #5fe2fc;
}

.footer-copyright {
  margin-top: 0;
  padding-top: 1rem;
  border-top: 1px solid #3844c8;
  opacity: 0.8;
  font-size: 0.9rem;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.progress_figures {
  display: inline-block;
  width: 40px;
  text-align: right;
  font-size: 0.9em;
}

.kid_information_validation span p {
  margin: 0;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1.1rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .theme-name {
    font-size: 1.5rem;
  }

  .theme-content {
    flex-direction: column;
  }

  .theme-image-container {
    flex: 0 0 auto;
    width: 100%;
  }

  .header-content {
    flex-direction: column;
    gap: 1rem;
  }

  body.authenticated {
    margin: 1rem;
  }
}
