/* Fantasy RPG Theme for KinQuest */
@import url('https://fonts.googleapis.com/css2?family=MedievalSharp&family=Raleway:wght@400;500;600;700&display=swap');

:root {
  --primary-color: #7e57c2; /* Purple for magic/fantasy */
  --primary-dark: #5e35b1;
  --primary-light: #b39ddb;
  --accent-color: #ffb300; /* Gold for rewards/achievements */
  --accent-dark: #ff8f00;
  --accent-light: #ffe082;
  --success-color: #43a047; /* Green for completed quests */
  --danger-color: #e53935; /* Red for dangers/deleted items */
  --background-color: #f5f5f5;
  --card-color: #fff;
  --text-color: #333;
  --text-light: #757575;
  --border-radius: 8px;
  --border-radius-lg: 12px;
  --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --box-shadow-lg: 0 8px 20px rgba(0, 0, 0, 0.15);
  --parchment: #f9f3e3;
  --wood-dark: #8d6e63;
  --wood-light: #bcaaa4;
}

/* Background with subtle paper texture */
body {
  font-family: 'Raleway', sans-serif;
  margin: 0 auto;
  padding: 20px;
  color: var(--text-color);
  overflow-x: hidden;
  background-color: var(--background-color);
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%239C92AC' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
}

/* Hide task-manage-only and task-edit-only elements when the user doesn't have appropriate permissions */
body:not(.admin-mode):not(.task-manage-mode) .task-manage-only {
  display: none !important;
}

body:not(.admin-mode):not(.task-edit-mode) .task-edit-only {
  display: none !important;
}

/* Stylized headings with fantasy font */
h1, h2, h3, .list-title {
  font-family: 'MedievalSharp', cursive;
  color: var(--primary-color);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

h1 {
  font-size: 2.5rem;
  margin-right: 15px;
  cursor: pointer;
  background: -webkit-linear-gradient(var(--primary-color), var(--primary-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
}

h1::after {
  content: "⚔️";
  position: absolute;
  top: -5px;
  right: -30px;
  font-size: 1rem;
  -webkit-text-fill-color: initial;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--parchment);
  border-radius: var(--border-radius);
}

::-webkit-scrollbar-thumb {
  background: var(--wood-dark);
  border-radius: var(--border-radius);
  border: 2px solid var(--parchment);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* Header styling */
.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--primary-light);
  position: relative;
}

.header-container::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 0;
  right: 0;
  height: 6px;
  background-image: linear-gradient(45deg, transparent 25%, var(--accent-light) 25%, 
                    var(--accent-light) 50%, transparent 50%, transparent 75%, 
                    var(--accent-light) 75%, var(--accent-light));
  background-size: 6px 6px;
  border-radius: var(--border-radius);
}

.title-area {
  display: flex;
  align-items: center;
}

/* Admin controls with fantasy styling */
.admin-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

.admin-controls a, .admin-controls button {
  font-family: 'MedievalSharp', cursive;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: none;
  padding: 10px 16px;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  z-index: 1;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Primary style for most navigation buttons */
.dashboard-link, .family-link, .board-link {
  background-color: var(--primary-light);
  color: var(--text-color);
}

.dashboard-link:hover, .family-link:hover, .board-link:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--box-shadow);
}

/* Icons for each button */
.dashboard-link::before {
  content: "📊";
  margin-right: 6px;
}

.family-link::before {
  content: "👪";
  margin-right: 6px;
}

.board-link::before {
  content: "📋";
  margin-right: 6px;
}

/* Special accent button */
.reset-all-btn {
  background-color: var(--accent-color);
  color: var(--text-color);
}

.reset-all-btn:hover {
  background-color: var(--accent-dark);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--box-shadow);
}

.reset-all-btn::before {
  content: "🔄";
  margin-right: 6px;
}

/* Quest board styling (lists) */
.lists-container {
  display: flex;
  flex-wrap: nowrap;
  gap: 20px;
  overflow-x: auto;
  padding: 20px 5px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  margin: 0 -20px;
  padding-left: 20px;
  width: calc(100% + 20px);
}

.list-column {
  flex: 0 0 auto;
  width: 480px;
  background-color: var(--parchment);
  border-radius: var(--border-radius-lg);
  padding: 20px;
  box-shadow: var(--box-shadow);
  position: relative;
  border: 1px solid var(--wood-light);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
}

.list-column::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background-color: var(--primary-color);
  border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.list-column:hover {
  transform: translateY(-5px);
  box-shadow: var(--box-shadow-lg);
}

/* Cool effect for completed quests */
@keyframes pulse-glow {
  0% { box-shadow: 0 0 15px 3px rgba(255, 179, 0, 0.4); }
  50% { box-shadow: 0 0 25px 8px rgba(255, 179, 0, 0.7); }
  100% { box-shadow: 0 0 15px 3px rgba(255, 179, 0, 0.4); }
}

.list-column.all-completed {
  animation: pulse-glow 2s infinite;
  border: 2px solid var(--accent-color);
}

.list-column.all-completed::after {
  content: "🏆";
  position: absolute;
  top: -15px;
  right: -5px;
  font-size: 2rem;
  transform: rotate(15deg);
  filter: drop-shadow(0 0 5px rgba(255, 179, 0, 0.7));
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px dashed var(--wood-light);
  width: 100%;
}

.list-title-container {
  display: flex;
  flex-direction: column;
}

.list-title {
  margin: 0;
  font-size: 1.5em;
  cursor: pointer;
  color: var(--primary-dark);
}

/* Points and score styling */
.list-score {
  font-size: 0.9em;
  color: var(--success-color);
  font-weight: bold;
  margin-top: 8px;
  display: flex;
  align-items: center;
}

.list-score::before {
  content: "⚡";
  margin-right: 5px;
}

.list-score span {
  display: inline-block;
  background-color: var(--success-color);
  color: white;
  padding: 3px 10px;
  border-radius: 20px;
  margin-left: 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.current-score {
  display: block;
  font-size: 0.8em;
  color: var(--text-light);
  margin-top: 4px;
  font-weight: normal;
}

.current-score::before {
  content: "⚔️ Current: ";
  font-weight: 500;
}

/* Streak badge */
.streak-badge {
  display: inline-flex;
  align-items: center;
  background-color: var(--accent-color);
  color: var(--text-color);
  border-radius: 20px;
  padding: 3px 10px;
  margin-left: 8px;
  font-size: 0.9em;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  animation: flame-pulse 1.5s infinite alternate;
}

@keyframes flame-pulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.1); }
}

/* Add button styling */
.add-list-btn {
  background-color: var(--accent-color);
  color: white;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 24px;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--box-shadow);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.add-list-btn:hover {
  transform: rotate(90deg);
  background-color: var(--accent-dark);
}

/* Form styling */
form {
  display: flex;
  margin-bottom: 20px;
  position: relative;
}

.quest-form {
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
  margin-top: 20px;
  padding: 20px;
  background-color: rgba(255, 255, 255, 0.7);
  border-radius: var(--border-radius);
  border: 1px solid var(--primary-light);
  width: calc(100% - 40px); /* Account for padding on both sides */
  box-sizing: border-box;
}

.quest-form input[type="text"] {
  border: 2px dashed var(--accent-color);
  background-color: var(--parchment);
}

input[type="text"] {
  flex-grow: 1;
  padding: 12px;
  margin-right: 10px;
  border: 2px solid var(--primary-light);
  border-radius: var(--border-radius);
  background-color: white;
  font-family: 'Raleway', sans-serif;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}

button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

button:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
}

/* Todo item styling */
.todo-container {
  margin-bottom: 15px;
}

.todo-item {
  display: flex;
  align-items: center;
  padding: 15px;
  margin-bottom: 8px;
  border-radius: var(--border-radius);
  background-color: white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border-left: 4px solid var(--primary-light);
}

/* Task type styling */
.recurring-task {
  background-color: #eaf5ff;
  border-left: 4px solid #0066cc;
}

.quest-task {
  background-color: white;
  border-left: 4px solid var(--success-color);
}

.task-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.recurring-badge {
  background-color: #e6f7ff;
  color: #0066cc;
}

.due-date-badge {
  background-color: #fff5e6;
  color: #fd7e14;
}

/* Task creation form styling */
.task-input-container {
  display: flex;
  flex-direction: column;
  margin-bottom: 15px;
  width: 100%;
}

.task-input-container input[type="text"] {
  margin-bottom: 12px;
  padding: 12px;
  font-size: 16px;
  border: 2px solid var(--primary-light);
}

.task-type-selector {
  width: 100%;
  padding: 10px;
  border: 2px solid var(--primary-light);
  border-radius: var(--border-radius);
  margin-bottom: 15px;
  font-size: 16px;
  background-color: white;
}

.task-options {
  margin-bottom: 20px;
  padding: 15px;
  background-color: var(--parchment);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  border: 1px dashed var(--primary-light);
  width: calc(100% - 32px); /* Account for padding on both sides */
  overflow: visible;
  position: relative;
}

.task-options-section {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
}

/* Emoji picker */
.emoji-picker-option {
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.emoji-display {
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 24px;
  background-color: white;
  border: 2px solid var(--primary-light);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.emoji-display:hover {
  transform: scale(1.1);
  border-color: var(--primary-color);
}

.emoji-picker {
  position: absolute;
  top: 45px;
  left: 0;
  background-color: white;
  border: 2px solid var(--primary-light);
  border-radius: 8px;
  padding: 10px;
  width: 100%;
  max-width: 300px;
  height: auto;
  max-height: 400px;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: var(--box-shadow-lg);
  z-index: 1000;
  transform: translateZ(0);
}

.emoji-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--primary-light);
  padding-bottom: 5px;
}

.emoji-category-btn {
  padding: 5px 10px;
  border: none;
  border-radius: 5px;
  background-color: #f1f3f5;
  cursor: pointer;
  font-size: 0.9em;
  transition: all 0.2s ease;
}

.emoji-category-btn:hover,
.emoji-category-btn.active {
  background-color: var(--primary-light);
  color: white;
}

.emoji-grid {
  display: flex;
  flex-direction: column;
  height: auto;
  overflow-y: visible;
  padding: 5px 0;
}

.emoji-category-container {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  width: 100%;
}

.emoji-btn {
  width: 30px;
  height: 30px;
  font-size: 16px;
  padding: 0;
  margin: 2px;
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.emoji-btn:hover {
  background-color: #e9ecef;
  transform: scale(1.1);
}

.due-date-option, .recurrence-option {
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
}

.option-label {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 16px;
  color: var(--primary-dark);
}

.due-date-input {
  padding: 10px;
  border: 2px solid var(--primary-light);
  border-radius: var(--border-radius);
  width: 100%;
  max-width: 250px;
  font-size: 16px;
}

.recurrence-type-selector {
  padding: 10px;
  border: 2px solid var(--primary-light);
  border-radius: var(--border-radius);
  width: 100%;
  max-width: 250px;
  font-size: 16px;
  background-color: white;
}

.weekday-selector {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 15px;
  padding: 15px;
  background: white;
  border-radius: var(--border-radius);
  width: calc(100% - 32px); /* Account for padding on both sides */
  border: 1px solid var(--primary-light);
  box-sizing: border-box;
}

.weekday-selector-title {
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 10px;
  font-size: 16px;
}

.weekday-selector-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

.weekday-selector label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px 12px;
  background-color: #f1f3f5;
  border-radius: 6px;
  font-size: 15px;
  transition: all 0.2s ease;
}

.weekday-selector label:hover {
  background-color: #e9ecef;
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.todo-item:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Checkbox styling */
.todo-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border: 2px solid var(--primary-light);
  border-radius: 4px;
  margin-right: 12px;
  display: grid;
  place-content: center;
  cursor: pointer;
}

.todo-item input[type="checkbox"]::before {
  content: "";
  width: 14px;
  height: 14px;
  transform: scale(0);
  transition: 120ms transform ease-in-out;
  box-shadow: inset 1em 1em var(--primary-color);
  background-color: var(--primary-color);
  transform-origin: center;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.todo-item input[type="checkbox"]:checked::before {
  transform: scale(1);
}

.todo-item span.quest-text {
  flex-grow: 1;
  font-weight: 500;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.quest-icon {
  display: inline-block;
  margin-right: 10px;
  font-size: 1.2em;
}

.quest-progress {
  color: var(--primary-color);
  font-weight: 600;
  margin-left: 8px;
  background-color: rgba(126, 87, 194, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.todo-actions {
  display: flex;
  gap: 8px;
}

.todo-item.completed {
  border-left-color: var(--success-color);
  background-color: rgba(67, 160, 71, 0.05);
}

.todo-item.completed span {
  text-decoration: line-through;
  color: var(--text-light);
}

.todo-item.completed::after {
  content: "✓";
  font-size: 1.2rem;
  color: var(--success-color);
  margin-right: 10px;
}

/* Points badge styling */
.points-badge {
  background-color: var(--accent-color);
  color: var(--text-color);
  border-radius: 20px;
  padding: 3px 8px;
  font-size: 0.8em;
  margin-left: 8px;
  display: inline-block;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.points-badge::before {
  content: "⭐ ";
}

/* Points edit form styling */
.points-edit-form {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px;
  flex-grow: 1;
  background-color: rgba(255, 179, 0, 0.1);
  border-radius: var(--border-radius);
  border: 1px dashed var(--accent-color);
}

.points-edit-form label {
  font-weight: 600;
  font-family: 'MedievalSharp', cursive;
  color: var(--primary-dark);
}

.points-edit-form input[type="number"] {
  width: 70px;
  padding: 8px;
  border-radius: var(--border-radius);
  border: 2px solid var(--accent-color);
  background-color: white;
  font-weight: 600;
  text-align: center;
  font-size: 1.1em;
}

.save-points-btn {
  background-color: var(--accent-color);
  color: var(--text-color);
  font-weight: 600;
  padding: 8px 12px;
}

.save-points-btn:hover {
  background-color: var(--accent-dark);
  color: white;
}

/* Title forms styling */
#title-form {
  display: flex;
  margin-bottom: 20px;
  align-items: center;
  gap: 10px;
}

#title-form input {
  font-size: 2em;
  font-weight: bold;
  color: var(--primary-color);
  padding: 10px;
  font-family: 'MedievalSharp', cursive;
  border: 2px dashed var(--primary-light);
  background-color: white;
  border-radius: var(--border-radius);
}

.list-title-form {
  display: flex;
  margin-bottom: 10px;
  align-items: center;
  gap: 10px;
}

.list-title-form input.quest-title-input {
  font-size: 1.3em;
  font-family: 'MedievalSharp', cursive;
  color: var(--primary-dark);
  border: 2px dashed var(--primary-light);
  background-color: white;
  padding: 8px 12px;
  border-radius: var(--border-radius);
}

.save-quest-btn {
  background-color: var(--accent-color);
  color: var(--text-color);
  font-weight: 600;
  font-family: 'MedievalSharp', cursive;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Action buttons */
.delete-btn, .add-subtask-btn, .cancel-btn, .points-btn {
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 16px;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.delete-btn {
  background-color: var(--danger-color);
  color: white;
}

.delete-btn:hover {
  background-color: #c62828;
  transform: rotate(90deg);
}

.add-subtask-btn {
  background-color: var(--success-color);
  color: white;
}

.add-subtask-btn:hover {
  background-color: #2e7d32;
  transform: rotate(90deg);
}

.add-task-btn {
  background-color: var(--success-color);
  color: white;
  font-weight: 600;
  font-family: 'MedievalSharp', cursive;
  border: none;
  border-radius: var(--border-radius);
  padding: 12px 16px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.5px;
  width: 100%;
  text-transform: uppercase;
}

.add-task-btn:hover {
  background-color: #2e7d32;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.cancel-btn {
  background-color: var(--text-light);
  color: white;
}

.cancel-btn:hover {
  background-color: #424242;
  transform: rotate(90deg);
}

.points-btn {
  background-color: var(--accent-color);
  color: var(--text-color);
}

.points-btn:hover {
  background-color: var(--accent-dark);
  transform: rotate(90deg);
}

/* Subtask styling */
.subtasks {
  padding-left: 25px;
  margin-top: 10px;
}

.subtasks.collapsed {
  display: none;
}

.subtask {
  position: relative;
  margin-left: 15px;
  padding-left: 20px;
}

.subtask::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: var(--primary-light);
  border-radius: 2px;
}

.subtask-text {
  display: flex;
  align-items: center;
  flex-grow: 1;
  font-size: 0.95em;
  color: var(--text-color);
}

.subtask-icon {
  display: inline-flex;
  margin-right: 8px;
  font-size: 0.9em;
  opacity: 0.7;
}

.toggle-subtasks {
  background-color: var(--primary-light);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toggle-subtasks:hover {
  background-color: var(--primary-color);
  transform: rotate(90deg);
}

.subtask-form {
  margin: 12px 0;
  padding-left: 25px;
  display: flex;
  gap: 8px;
}

/* Modal styling */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
}

.modal-content {
  background-color: var(--parchment);
  margin: 10% auto;
  padding: 0;
  width: 350px;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--box-shadow-lg);
  position: relative;
  border: 2px solid var(--wood-dark);
  overflow: hidden;
}

.modal-header {
  padding: 20px;
  background-color: var(--primary-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5em;
  color: white;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.close {
  color: white;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.close:hover {
  transform: rotate(90deg);
}

.modal-body {
  padding: 25px;
}

/* PIN Input styling */
.pin-input-container {
  margin-bottom: 20px;
}

#pin-input {
  width: 95%;
  padding: 15px;
  font-size: 1.5em;
  text-align: center;
  letter-spacing: 8px;
  border: 2px solid var(--primary-color);
  border-radius: var(--border-radius);
  background-color: white;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
  max-width: 280px;
  margin: 0 auto;
  display: block;
}

/* Numpad styling */
.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.numpad-btn {
  background-color: white;
  color: var(--text-color);
  border: 1px solid var(--primary-light);
  padding: 15px;
  font-size: 1.2em;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.2s ease;
}

.numpad-btn:hover {
  background-color: var(--primary-light);
  color: white;
  transform: translateY(-2px);
}

.enter-btn {
  background-color: var(--success-color);
  color: white;
  font-weight: 600;
}

.enter-btn:hover {
  background-color: #2e7d32;
}

/* Form elements */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--primary-dark);
}

/* Task title editing */
.task-title {
  cursor: pointer;
}

.task-title:hover {
  text-decoration: underline;
  color: var(--primary-color);
}

.task-title-edit {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.title-edit-form {
  display: flex;
  align-items: center;
  gap: 5px;
}

.task-title-input {
  padding: 5px;
  border: 1px solid var(--primary-light);
  border-radius: var(--border-radius);
  font-size: 16px;
  min-width: 200px;
  background: white;
}

.save-title-btn, .title-edit-form .cancel-btn {
  padding: 3px 6px;
  border: none;
  border-radius: var(--border-radius);
  background: var(--primary-light);
  color: white;
  cursor: pointer;
  font-size: 14px;
}

.save-title-btn:hover {
  background: var(--primary-color);
}

.title-edit-form .cancel-btn {
  background: var(--danger-color);
}

.title-edit-form .cancel-btn:hover {
  background: #c62828;
}

.form-group input {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--primary-light);
  border-radius: var(--border-radius);
  font-family: 'Raleway', sans-serif;
  background-color: white;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 25px;
}

.confirm-btn {
  background-color: var(--success-color);
  font-weight: 600;
}

.confirm-btn:hover {
  background-color: #2e7d32;
}

/* Notification styling */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 20px;
  border-radius: var(--border-radius);
  color: white;
  font-weight: bold;
  z-index: 1010;
  display: none;
  box-shadow: var(--box-shadow-lg);
  transform: translateY(-100px);
  animation: slide-in 0.3s forwards;
}

@keyframes slide-in {
  100% { transform: translateY(0); }
}

.notification.success {
  background-color: var(--success-color);
}

.notification.success::before {
  content: "✅ ";
}

.notification.error {
  background-color: var(--danger-color);
}

.notification.error::before {
  content: "❌ ";
}

/* Focus link styling */
.focus-link {
  display: inline-block;
  font-family: 'MedievalSharp', cursive;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background-color: var(--primary-light);
  color: var(--text-color);
  padding: 6px 12px;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  margin-bottom: 10px;
  position: relative;
}

.focus-link:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--box-shadow);
}

.focus-link::before {
  content: "👁️";
  margin-right: 6px;
}

/* Centered list view styling */
.centered-list-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.centered-single-list {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 20px;
}

.back-link {
  font-family: 'MedievalSharp', cursive;
  color: var(--primary-color);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  margin-bottom: 15px;
  transition: all 0.3s ease;
}

.back-link:hover {
  color: var(--primary-dark);
  transform: translateX(-5px);
}

/* Auth Styles */
.auth-container {
  max-width: 500px;
  margin: 50px auto;
  background-color: var(--parchment);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--box-shadow-lg);
  padding: 30px;
  position: relative;
  border: 2px solid var(--wood-light);
}

.auth-form-container {
  width: 100%;
}

.auth-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background-color: var(--primary-color);
  border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.auth-container h2 {
  color: var(--primary-dark);
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 15px;
  font-size: 2rem;
  border-bottom: 2px dashed var(--wood-light);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.auth-form .form-group {
  margin-bottom: 25px;
  position: relative;
  height: auto;
  width: 100%;
}

.auth-form label {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
  color: var(--primary-dark);
  font-size: 16px;
}

.auth-form input {
  width: 100%;
  padding: 14px;
  border: 2px solid var(--primary-light);
  border-radius: var(--border-radius);
  font-family: 'Raleway', sans-serif;
  transition: border-color 0.3s;
  box-sizing: border-box;
  font-size: 16px;
  height: 50px;
}

.auth-form input:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-light);
}

.auth-form .primary-btn {
  font-family: 'MedievalSharp', cursive;
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 16px 20px;
  font-size: 1.1rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 30px;
  width: 100%;
  box-shadow: 0 4px 0 var(--primary-dark);
  height: auto;
}

.auth-form .primary-btn:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--primary-dark);
}

.auth-form .primary-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--primary-dark);
}

.auth-footer {
  margin-top: 30px;
  text-align: center;
  border-top: 1px solid var(--wood-light);
  padding-top: 20px;
}

.auth-footer p {
  margin: 10px 0;
}

.auth-footer a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s;
  display: inline-block;
  padding: 5px;
}

.auth-footer a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.error-message {
  background-color: #ffebee;
  border-left: 4px solid var(--danger-color);
  color: var(--danger-color);
  padding: 15px;
  border-radius: var(--border-radius);
  margin: 15px 0;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.success-message {
  background-color: #e8f5e9;
  border-left: 4px solid var(--success-color);
  color: var(--success-color);
  padding: 15px;
  border-radius: var(--border-radius);
  margin: 15px 0;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Family Settings Styles */
.settings-container {
  max-width: 1000px;
  margin: 30px auto;
}

.settings-section {
  background-color: var(--parchment);
  border-radius: var(--border-radius-lg);
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: var(--box-shadow);
  border: 1px solid var(--wood-light);
}

.settings-section h3 {
  color: var(--primary-dark);
  margin-top: 0;
  padding-bottom: 10px;
  border-bottom: 2px dashed var(--wood-light);
}

.family-profile {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.profile-info h4 {
  font-size: 1.4rem;
  margin: 0 0 10px 0;
  color: var(--primary-color);
}

.profile-actions button {
  background-color: var(--primary-light);
  color: var(--text-color);
  border: none;
  padding: 8px 15px;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
}

.profile-actions button:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-2px);
}

.member-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 30px;
}

.member-item {
  background-color: white;
  border-radius: var(--border-radius);
  padding: 15px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.member-info h4 {
  margin: 0 0 5px 0;
  color: var(--primary-dark);
}

.member-info p {
  margin: 0;
  color: var(--text-light);
}

.member-actions {
  display: flex;
  gap: 10px;
}

.edit-btn {
  background-color: var(--primary-light);
  color: var(--text-color);
}

.delete-btn {
  background-color: var(--danger-color);
  color: white;
}

.add-btn {
  background-color: var(--success-color);
  color: white;
}

.add-member-section {
  background-color: white;
  border-radius: var(--border-radius);
  padding: 20px;
  margin-top: 20px;
}

.add-member-section h4 {
  margin-top: 0;
  color: var(--primary-dark);
}

.form-buttons {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.save-btn {
  background-color: var(--success-color);
  color: white;
}

.cancel-btn {
  background-color: var(--text-light);
  color: white;
}

/* Calendar Widget Styles */
.calendar-widget {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0;
  padding: 15px;
  background-color: var(--parchment);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  border: 1px solid var(--wood-light);
  position: relative;
}

.calendar-widget::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background-color: var(--primary-color);
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.current-date {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.current-date h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--primary-dark);
  font-family: 'MedievalSharp', cursive;
}

.today-btn {
  margin-top: 5px;
  padding: 5px 10px;
  background-color: var(--accent-color);
  color: var(--text-color);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: bold;
  font-family: 'MedievalSharp', cursive;
  transition: all 0.2s ease;
}

.today-btn:hover {
  background-color: var(--accent-dark);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.prev-day-btn,
.next-day-btn {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  background-color: var(--primary-light);
  color: var(--text-color);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'MedievalSharp', cursive;
  font-weight: 600;
}

.prev-day-btn:hover,
.next-day-btn:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-arrow {
  font-size: 1.2rem;
  font-weight: bold;
}

.prev-day-btn .nav-arrow {
  margin-right: 8px;
}

.next-day-btn .nav-arrow {
  margin-left: 8px;
}

.nav-label {
  font-size: 0.9rem;
}

/* Member Selection Styles */
.member-selection-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 20px;
  margin-top: 20px;
  margin-bottom: 30px;
}

.member-selection-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  background-color: var(--parchment);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid var(--wood-light);
}

.member-selection-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-color);
}

.member-avatar {
  width: 70px;
  height: 70px;
  background-color: var(--primary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 15px;
  font-family: 'MedievalSharp', cursive;
}

.member-name {
  font-weight: 600;
  font-size: 1.2rem;
  margin-bottom: 5px;
  text-align: center;
  color: var(--primary-dark);
}

.member-role {
  color: var(--text-light);
  font-size: 0.9rem;
  text-transform: capitalize;
}

.passcode-form-container {
  background-color: var(--parchment);
  border-radius: var(--border-radius);
  padding: 20px;
  margin-top: 20px;
  box-shadow: var(--box-shadow);
  text-align: center;
  border: 2px solid var(--wood-light);
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.passcode-form-container h3 {
  color: var(--primary-dark);
  margin-top: 0;
  font-family: 'MedievalSharp', cursive;
}

.passcode-form-container input[type="password"] {
  font-size: 1.5rem;
  padding: 10px;
  letter-spacing: 4px;
  text-align: center;
  width: 200px;
  margin: 10px auto;
  display: block;
  border: 2px solid var(--primary-light);
  border-radius: var(--border-radius);
}

.passcode-message {
  color: var(--success-color);
  font-weight: 600;
  margin-top: 5px;
  animation: fade-in 0.5s ease-in;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.passcode {
  font-family: monospace;
  font-size: 1.1em;
  background-color: rgba(0, 0, 0, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
}

.passcode-btn {
  background-color: var(--accent-color);
  color: var(--text-color);
  font-weight: 600;
  border: none;
  padding: 8px 12px;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.2s ease;
}

.passcode-btn:hover {
  background-color: var(--accent-dark);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Member Permissions Styles */
.member-permissions {
  margin-top: 15px;
  padding: 15px;
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: var(--border-radius);
  border: 1px dashed var(--primary-light);
}

.member-permissions h5 {
  margin-top: 0;
  margin-bottom: 10px;
  color: var(--primary-dark);
  font-family: 'MedievalSharp', cursive;
  font-size: 1rem;
}

.permission-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.permission-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  background-color: rgba(126, 87, 194, 0.1);
  color: var(--text-light);
  border: 1px solid var(--primary-light);
}

.permission-badge.active {
  background-color: var(--primary-light);
  color: white;
  border-color: var(--primary-color);
}

.update-message {
  color: var(--success-color);
  font-weight: 600;
  margin-top: 10px;
  font-size: 0.9rem;
  animation: fade-in 0.5s ease-in;
}

.permissions-btn {
  background-color: var(--primary-light);
  color: var(--text-color);
  font-weight: 600;
  border: none;
  padding: 8px 12px;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.2s ease;
}

.permissions-btn:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.permissions-form {
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.permission-option {
  background-color: white;
  padding: 12px;
  border-radius: var(--border-radius);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.permission-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--primary-dark);
  cursor: pointer;
}

.permission-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border: 2px solid var(--primary-light);
  border-radius: 3px;
  cursor: pointer;
}

.permission-description {
  margin: 8px 0 0 28px;
  font-size: 0.9rem;
  color: var(--text-light);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  body {
    padding: 15px;
  }
  
  .header-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  
  .admin-controls {
    width: 100%;
    justify-content: space-between;
  }
  
  .list-column {
    width: 300px;
  }
  
  .family-profile {
    flex-direction: column;
    gap: 15px;
  }
  
  .member-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  
  .member-actions {
    width: 100%;
    justify-content: flex-end;
  }
  
  .calendar-widget {
    flex-direction: column;
    gap: 15px;
  }
  
  .nav-label {
    display: none;
  }
  
  .prev-day-btn,
  .next-day-btn {
    padding: 10px;
  }
  
  .prev-day-btn .nav-arrow,
  .next-day-btn .nav-arrow {
    margin: 0;
  }
  
  .member-selection-container {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}

/* User navigation buttons */
.switch-user-btn {
  background-color: var(--wood-light);
  color: var(--text-color);
}

.switch-user-btn:hover {
  background-color: var(--wood-dark);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--box-shadow);
}

.switch-user-btn::before {
  content: "👤";
  margin-right: 6px;
}

.logout-btn {
  background-color: var(--danger-color);
  color: white;
}

.logout-btn:hover {
  background-color: #d32f2f;
  transform: translateY(-2px);
  box-shadow: var(--box-shadow);
}

.logout-btn::before {
  content: "🚪";
  margin-right: 6px;
}