/* REFINED: General Styling & New Font */
:root {
  --theme-color: #ff6f91; /* Default theme color */
}
body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  color: white;
  background-size: cover;
  background-position: center center;
  transition: background 0.5s ease, color 0.5s ease;
  min-height: 100vh;
  /* UPDATED: Flex layout pushes footer to bottom */
  display: flex;
  flex-direction: column;
}

/* === 1. NEW SITE-WIDE HEADER STYLES === */
header.site-header {
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding: 1rem 50px;
  width: 100%;
  box-sizing: border-box;
}
.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1600px;
  margin: 0 auto;
}
.site-header h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  text-shadow: 2px 2px 5px #000;
}
.site-header h1 a {
  color: white;
  text-decoration: none;
  transition: color 0.3s ease;
}
.site-header h1 a:hover {
  color: var(--theme-color);
}

.template-select-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.template-select-wrap select {
  font-size: 1rem;
  font-family: 'Poppins', sans-serif;
  border-radius: 10px;
  border: 2px solid transparent;
  padding: 0.4em 0.8em;
  background-color: rgba(255, 255, 255, 0.9);
  color: #222;
  cursor: pointer;
}

/* === 2. ORIGINAL CONTENT STYLES === */

/* This tag wraps all your page content */
.page-content {
  flex-grow: 1; /* Makes this section fill the space */
  width: 100%;
}

/* Your original header styles, now for the form area */
header.page-header {
  backdrop-filter: blur(2px);
  padding: 1rem;
  text-align: center;
  /* Removed border-bottom as it's now on the site-header */
}
/* Your original h1 style for "Anime Tasker" */
header.page-header h1 {
  margin: 0 0 0.5em;
  font-weight: 700;
  text-shadow: 2px 2px 5px #000;
}

/* REFINED: Form inputs and controls */
form#add-task-form {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
  padding: 1rem;
  background-color: rgba(0,0,0,0.3);
  border-radius: 15px;
  max-width: 1000px;
  margin: 0 auto 1rem auto;
}
/* (Input and button styles are unchanged) */
input[type="text"], input[type="datetime-local"], select {
  font-size: 1rem;
  font-family: 'Poppins', sans-serif;
  border-radius: 10px;
  border: 2px solid transparent;
  padding: 0.6em 1em;
  background-color: rgba(255, 255, 255, 0.9);
  color: #222;
  font-weight: 400;
  transition: all 0.3s ease;
}
input[type="text"]:focus, input[type="datetime-local"]:focus, select:focus {
  outline: none;
  border-color: var(--theme-color);
  box-shadow: 0 0 10px var(--theme-color);
}
#add-task-form button[type="submit"] {
  cursor: pointer;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  color: white;
  background: var(--theme-color);
  border: none;
  border-radius: 10px;
  transition: all 0.3s ease;
  padding: 0 1.5rem;
}
#add-task-form button[type="submit"]:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px var(--theme-color);
}
.template-selector {
  color: white;
}
.repeat-label{
  color: white !important;
}
.task-list{
  color: white;
}

/* REFINED: Category containers */
#category-container {
  flex: 1;
  display: flex;
  padding: 1.5rem;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}
/* (All other .category-box, .task, .modal, etc. styles are unchanged) */
.category-box {
  backdrop-filter: blur(2px);
  flex-basis: 450px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  max-height: 70vh;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: all 0.4s ease;
}
.category-box:hover {
  border-color: var(--theme-color);
  box-shadow: 0 0 25px var(--theme-color);
}
.category-box h2 {
  margin-top: 0;
  text-align: center;
  text-shadow: 2px 2px 5px #000;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  padding-bottom: 0.8rem;
  margin-bottom: 1rem;
}
.task-list {
  flex-grow: 1;
  overflow-y: auto;
  padding-right: 8px;
}
.task {
  background-color: rgba(255,255,255,0.2);
  margin-bottom: 0.7rem;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  transition: all 0.3s ease;
  backdrop-filter: blur(100px); 
}
.task:hover {
  background-color: rgba(255,255,255,0.4);
  transform: scale(1.02);
}
.task-details {
  flex-grow: 1;
  margin-right: 10px;
  word-break: break-word; 
}
.task.completed .task-desc {
  text-decoration: line-through;
  opacity: 0.6;
}
.task-time {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-top: 4px;
  display: block; 
}
.task-time:empty {
  display: none; 
}
.task-actions {
  flex-shrink: 0; 
}
.task-actions button {
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  margin-left: 0.5rem;
  transition: all 0.2s ease;
}
.task-actions button:hover {
  color: var(--theme-color);
  transform: scale(1.2);
}
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(5px);
  display: none; 
  justify-content: center;
  align-items: center;
  z-index: 9999;
}
.modal-content {
  background: rgba(30, 30, 30, 0.8);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  text-align: left; 
  box-shadow: 0 0 30px var(--theme-color);
}
.modal-content h3 {
  margin-top: 0;
  font-size: 1.7rem;
  text-align: center; 
}
#edit-task-form label {
  display: block;
  font-size: 0.9rem;
  opacity: 0.8;
  margin-bottom: 0.3rem;
  margin-top: 0.8rem;
}
#edit-task-form input, #edit-task-form select {
  width: 100%;
  box-sizing: border-box; 
  font-size: 1rem;
  font-family: 'Poppins', sans-serif;
  border-radius: 10px;
  border: 2px solid transparent;
  padding: 0.6em 1em;
  background-color: rgba(255, 255, 255, 0.9);
  color: #222;
}
#edit-task-form input:focus, #edit-task-form select:focus {
  outline: none;
  border-color: var(--theme-color);
  box-shadow: 0 0 10px var(--theme-color);
}
#notification-overlay .modal-content {
  text-align: center;
}
#notification-sticker {
  width: 150px;
  margin: 1rem auto;
  border-radius: 15px;
}
#edit-modal-buttons, #notification-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}
#edit-modal-buttons button, #notification-buttons button {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  padding: 0.7rem 1.5rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}
#edit-modal-save, #notification-snooze {
  background-color: var(--theme-color);
  color: white;
}
#edit-modal-cancel, #notification-dismiss {
  background-color: #555;
  color: white;
}

/* --- THEME DEFINITIONS --- */
/* (These now apply the color to the new site-header) */
body.template-default { --theme-color: #e11584; background-image: url('../assets/backgrounds/homescreen-bg.jpeg'); }
body.template-sakura-pink { --theme-color: #ff87c0; background-image: url('../assets/backgrounds/sakura.jpg'); }
body.template-one-piece { --theme-color: #39a2db; background-image: url('../assets/backgrounds/one-piece.avif'); }
body.template-jujutsu-kaisen { --theme-color: #e53935; background-image: url('../assets/backgrounds/jujutsu-kaisen.jpeg'); }
body.template-demon-slayer { --theme-color: #4db6ac; background-image: url('../assets/backgrounds/demon-slayer.jpeg'); }
body.template-mount-fuji { --theme-color: #a7c7e7; background-image: url('../assets/backgrounds/mount-fuji.jpg'); }

/* UPDATED: Theme background colors now apply to .site-header */
body.template-sakura-pink header.page-header, body.template-sakura-pink .category-box { background-color: rgba(255, 135, 192, 0.2); color: #ff87c0; }
body.template-default header.page-header, body.template-default .category-box { background-color: rgba(186, 1, 103, 0.2); color: #e11584; }
body.template-one-piece header.page-header, body.template-one-piece .category-box { background-color: rgba(57, 162, 219, 0.2); color:#39a2db; }
body.template-jujutsu-kaisen header.page-header, body.template-jujutsu-kaisen .category-box { background-color: rgba(229, 57, 53, 0.2); color:#e53935; }
body.template-demon-slayer header.page-header, body.template-demon-slayer .category-box { background-color: rgba(77, 182, 172, 0.2); color:#4db6ac }
body.template-mount-fuji header.page-header, body.template-mount-fuji .category-box { background-color: rgba(167, 199, 231, 0.2); color:#a7c7e7; }

/* === 3. NEW FOOTER STYLES === */
footer {
    width: 100%;
    text-align: center;
    padding: 20px 50px;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    box-sizing: border-box;
    margin-top: auto; /* Pushes footer to the bottom */
}
footer p {
    margin: 0;
    opacity: 0.7;
}