

/* ==================================================
  VARIABLES
  ================================================== */
  :root {
  --primary: #00bcd4;
  --background: #212d47;
  --surface: #0a0e17;
  --text: #2d3748;
  --danger: #ff3860;
  --radius: 4px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ==================================================
    GLOBAL STYLES & TYPOGRAPHY
    ================================================== */
* {
  box-sizing: border-box;
  font-family: "Outfit", serif;
  font-weight: 600;
}

body {
  background: var(--background);
  color: var(--text);
  margin: 0;
  padding: 2rem;
  line-height: 1.6;
}

h2 {
  margin: 0;
  color: #0cbcd4;
}

/* Prevent text selection on challenge items */
.challenge-item {
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}

/* ==================================================
    LAYOUT CONTAINERS
    ================================================== */
#challenges-screen,
#challenge-tracker-screen {
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* ==================================================
    CHALLENGE LIST
    ================================================== */
#challenge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0;
  justify-content: center;
  touch-action: pan-y;
}

#challenge-list li {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: transform 0.2s ease;
  position: relative;
  color: #fff;
  border: 2px solid var(--primary);
  width: 48%;
  cursor: pointer;
}

#challenge-list li:hover {
  transform: translateY(-2px);
}

/* ==================================================
    DELETE BUTTONS
    ================================================== */
.delete-challenge,
.delete-goal,
.delete-message {
  opacity: 0;
  transition: opacity 0.2s ease;
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: 0.5rem;
  position: absolute;
  right: 12%;
  top: 50%;
  transform: translateY(-50%);
  font-size: 24px;
}

#challenge-list li:hover .delete-challenge,
.message:hover .delete-message {
  opacity: 1;
}

/* ==================================================
    FORMS & INPUTS
    ================================================== */
form {
  display: flex;
  gap: 0.3rem;
  margin-bottom: 0;
}

.create-form {
  flex: 1;
  display: flex;
}

input {
  flex: 1;
  padding: 1rem;
  border: 1px solid #2d425f8f;
  border-radius: var(--radius);
  font-size: 1rem;
  background: #172035;
  color: #fff;
}

input:focus {
  outline: none;
}

button:not(.delete-challenge):not(.delete-goal):not(.delete-message) {
  background: var(--primary);
  color: #0a0e17;
  padding: 1rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s ease;
  font-size: 15px;
}

button:hover:not(.delete-challenge):not(.delete-goal):not(.delete-message) {
  background: #357abd;
}

/* ==================================================
    PROGRESS SECTION (TRACKER)
    ================================================== */
.progress-container {
  display: flex;
  gap: 2rem;
  background: var(--surface);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  justify-content: center;
}

.user-progress {
  text-align: center;
}

.tile-progress-container {
  display: flex;
  gap: 0.5rem;
  position: absolute;
  right: 15px;
  margin: 0;
}

.tile-progress {
  position: relative;
  width: 40px;
  height: 40px;
}

.tile-progress .progressbar-text {
  font-size: 10px !important;
}

.tile-progress svg {
  width: 100% !important;
  height: 100% !important;
}

/* ==================================================
    CHALLENGE & TRACKER HEADER
    ================================================== */
.challenge-content {
  display: flex;
  align-items: center;
}

#back-to-challenges {
  margin-bottom: 2rem;
  border-radius: 100px;
  padding: 12px 14px;
  position: absolute;
  background: none;
  font-size: 1.5rem;
  color: #fff;
}

/* ==================================================
    TRACKER MODULES (GOALS & DISCUSSION)
    ================================================== */
.tracker-modules {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.tracker-modules section {
  flex: 1;
  min-width: 300px;
  background: var(--surface);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ==================================================
    GOALS SECTION
    ================================================== */
#challenge-goals {
  /* Removed extra padding here because the module already provides padding */
}

.goal-list {
  padding: 1rem 0;
}

.goal-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  margin: 5px 0;
  background: #2d425f;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s ease;
  position: relative;
  color: #fff;
}

.goal-item:hover {
  background: #354962;
}

.goal-right {
  display: flex;
  align-items: center;
}

.delete-goal {
  background: transparent;
  border: none;
  color: #ff4081;
  font-size: 1.2em;
  cursor: pointer;
  padding: 0 5px;
  margin-left: 10px;
}

.delete-goal:hover {
  color: #ff79b0;
}

.goal-item:hover .delete-goal {
  opacity: 1;
}

.goal-text.completed {
  text-decoration: line-through;
  opacity: 0.7;
}

.goal-edit-input {
  background: transparent;
  border: 1px solid #00bcd4;
  color: #fff;
  padding: 2px 5px;
  width: 70%;
  font-family: inherit;
}

/* ==================================================
    DISCUSSION SECTION
    ================================================== */
#discussion {
  /* The discussion module is styled as part of the tracker-modules above */
}

#messages {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow-y: auto;
  padding: 1rem 0;
}

.message {
  background: #2d425f;
  padding: 10px 20px;
  border-radius: var(--radius);
  position: relative;
}

.message p {
  margin: 0;
}

/* ==================================================
    USER TOGGLE & APP HEADER
    ================================================== */
#user-toggle {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin: 1rem 0;
}

#user-toggle button {
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 20px;
}

#user-toggle button.active {
  background: var(--primary);
  color: #fff;
}

.user-progress h3 {
  cursor: pointer;
}

header.app-header {
  text-align: center;
}

header.app-header h1,
header.app-header p,
header.app-header * {
  color: #fff;
}

/* ==================================================
    MODAL
    ================================================== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: var(--primary);
  padding: 2rem;
  border-radius: var(--radius);
  width: 90%;
  max-width: 400px;
  text-align: center;
}

.modal-content h3 {
  margin-top: 0;
  color: #fff;
}

button.style-option {
  display: block;
  width: 100%;
  margin: 0.5rem 0;
  background: var(--background) !important;
  color: #fff;
}

button.style-option:hover {
  background: var(--surface) !important;
}

.modal-close {
  margin-top: 1rem;
  background: var(--danger);
}

.modal-save {
  margin-top: 1rem;
  background: var(--background) !important;
}

/* ==================================================
    CATEGORIES & ADD CHALLENGE
    ================================================== */
.categories-header {
    margin: 0;
}

.category-item-container button {
  padding: 0.5rem !important;
}

button.category-tab {
  padding: 0.5rem !important;
}

.category-filter {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}


.category-tab {
  background: #2d425f;
  border: none;
  color: #fff;
  padding: 8px 15px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s ease;
}

.category-tab.active {
  background: #00bcd4;
}

.add-category {
  background: transparent;
  border: 1px dashed #00bcd4;
  color: #00bcd4;
  font-size: 1.2em;
  cursor: pointer;
}

#category-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

.category-item-container {
  position: relative;
  margin: 5px;
}

.category-item-container span.delete-category {
  position: absolute;
  top: 0;
  right: 8px;
  color: #0a0e17;
  display: none;
}

.category-item-container:hover span.delete-category {
  display: block;
}

.categories-header button {
  background: var(--primary);
  color: #fff;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s ease;
}

form#add-challenge-form {
  width: 97%;
  margin: 0 auto;
}

button#add-category-btn,
.create-form button,
form#add-goal-form button {
  font-size: 15px !important;
  line-height: 1em;
}

/* ==================================================
    MESSAGES
    ================================================== */
#messages .message p {
  color: #fff;
}

  
.tracker-modules > section {
  background: #172547!important;
  padding: 10px 20px!important;
}

.input-container {
  display: flex;
}

h2#active-challenge-title {
  text-align: center;
}

.goal-list, #messages {
  padding: 1rem 0 0;
  height: 400px;
  overflow-y: auto;
  margin-bottom: 20px;
}

button#add-category-btn {
  padding: 0.5rem !important;
}

/* ==================================================
    RESPONSIVE DESIGN
    ================================================== */
@media (max-width: 600px) {
  body {
    padding: 1rem;
  }

  form#add-challenge-form {
    width: 100%;
    margin: 0 auto;
  }

  #challenge-tracker-screen,
  #challenges-screen {
    gap: 1.5rem;
  }

  li.challenge-item {
    width: 100% !important;
  }

  .create-form {
    width: 100%;
    display: flex;
  }

  form#add-challenge-form {
    flex-wrap: wrap;
  }

  .challenge-content span {
    font-size: 17px;
}
  
  /* In mobile view, stack the tracker modules vertically */
  .tracker-modules {
    flex-direction: column;
  }

  .delete-challenge, .delete-goal, .delete-message {
    right: 26%;
  }
}
