* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
  overflow-x: hidden;
  max-width: 100vw;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  overflow-x: hidden;
  width: 100%;
}

.header {
  background: white;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  margin-bottom: 30px;
  transition: all 0.3s ease;
}

/* Authentication Section Styles */
.auth-section {
  background: #f7fafc;
  padding: 15px 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  border: 2px solid #e2e8f0;
}

#loginPrompt {
  text-align: center;
}

#userInfo {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#userInfo > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

#userName {
  font-size: 14px;
}

#userPhoto {
  border: 2px solid #667eea;
}

.header-sticky {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  margin: 0;
  border-radius: 0;
  padding: 15px 30px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.header-sticky h1 {
  display: none;
}

.header-sticky .controls {
  justify-content: center;
}

.header-sticky .controls > button:first-child,
.header-sticky .controls > button:nth-child(2) {
  display: none;
}

/* Add spacer when header becomes sticky */
body.has-sticky-header .groups {
  margin-top: 120px;
}

h1 {
  color: #667eea;
  margin-bottom: 20px;
}

.controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.input {
  padding: 10px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}
.input:focus {
  border-color: #667eea;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  min-height: 40px;
  touch-action: manipulation;
}

.btn-primary {
  background: #667eea;
  color: white;
}

.btn-primary:hover {
  background: #5568d3;
  transform: translateY(-2px);
}

.btn-secondary {
  background: #48bb78;
  color: white;
}

.btn-secondary:hover {
  background: #38a169;
  transform: translateY(-2px);
}

.btn-danger {
  background: #f56565;
  color: white;
}

.btn-danger:hover {
  background: #e53e3e;
}

.btn-small {
  padding: 5px 10px;
  font-size: 12px;
  min-height: 32px;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 15px;
  width: 90%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.modal-content h2 {
  color: #667eea;
  margin-bottom: 20px;
}

.splash-close-btn {
  margin-left: auto;
  margin-bottom: -35px;
  z-index: 10;
  cursor: pointer;
  appearance: none;
  box-shadow: none;
  border: none;
  font-size: 20px;
}
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.3s;
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #667eea;
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.form-group textarea.tall {
  min-height: 200px;
}

.extra-items {
  margin-top: 15px;
}

.extra-item {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.extra-item input {
  flex: 1;
}

.groups {
  display: grid;
  gap: 20px;
}

.group {
  background: white;
  padding: 25px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  overflow: hidden;
  max-width: 100%;
  word-wrap: break-word;
}

.group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #e2e8f0;
}

.group-title {
  font-size: 24px;
  font-weight: 700;
  color: #667eea;
}

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

.todos {
  display: grid;
  gap: 15px;
}

.todo-item {
  background: #f7fafc;
  padding: 20px;
  border-radius: 10px;
  border-left: 4px solid #667eea;
  overflow: hidden;
  max-width: 100%;
  word-wrap: break-word;
}

/* Category-specific styling */
.todo-item.longterm {
  border-left-color: #667eea;
  background: #f7fafc;
}

.category-longterm {
  color: #5568d3;
}

.todo-item.daily {
  border-left-color: #a0aec0;
  background: #edf2f7;
}
.category-daily {
  color: mediumseagreen;
}

.todo-item.daily.done {
  border-left-color: #38a169;
  background: #e6ffed;
}

.todo-item.weekly {
  border-left-color: #ed8936;
  background: #fffaf0;
}

.category-weekly {
  color: #ed8936;
}

.todo-item.listing {
  border-left-color: #805ad5;
  background: #faf5ff;
}

.category-weekly {
  color: #805ad5;
}

.todo-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 10px;
}

.todo-title {
  font-size: 18px;
  font-weight: 600;
  color: #2d3748;
}

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

.todo-description {
  color: #4a5568;
  margin-bottom: 10px;
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

.accordion {
  margin-top: 10px;
  max-width: 100%;
  overflow: hidden;
}

.accordion-button {
  background: #667eea;
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  width: 100%;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.3s;
  min-height: 40px;
  touch-action: manipulation;
}

.accordion-button:hover {
  background: #5568d3;
}

.accordion-icon {
  transition: transform 0.3s;
}

.accordion-icon.open {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  background: white;
  border-radius: 0 0 8px 8px;
}

.accordion-content.active {
  max-height: none;
  overflow: visible;
}

.accordion-inner {
  padding: 15px;
  color: #4a5568;
  line-height: 1.8;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
  overflow-x: auto;
}

.extras-list {
  background: white;
  padding: 15px;
  border-radius: 8px;
  margin-top: 10px;
}

.extra-list-item {
  padding: 8px 0;
  border-bottom: 1px solid #e2e8f0;
  color: #4a5568;
}

.extra-list-item:last-child {
  border-bottom: none;
}

.extra-list-item:before {
  content: "▸ ";
  color: #667eea;
  font-weight: bold;
}

.empty-state {
  text-align: center;
  padding: 40px;
  color: #718096;
}

.form-helper {
  font-size: 12px;
  color: #718096;
  margin-top: 5px;
}

.suggestions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.suggestion-chip {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.suggestion-chip:hover {
  border-color: #667eea;
  transform: translateY(-1px);
}

/* === MODAL CONTENT REFINEMENTS === */
.modal-content {
  background: #ffffff;
  border-radius: 20px;
  padding: 35px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  animation: modalPop 0.3s ease;
}

@keyframes modalPop {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}



/* === LISTING ITEMS STYLING === */
.listing-items-container {
  background: #f7fafc;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  padding: 15px;
  margin-top: 10px;
  box-shadow: 0 2px 10px rgba(102, 126, 234, 0.15);
}

.listing-header {
  font-weight: 700;
  font-size: 16px;
  color: #4c51bf;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.listing-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.listing-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 5px solid #667eea;
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}

.listing-item:hover {
  background: #edf2ff;
  transform: translateX(2px);
}

.listing-item-text {
  font-size: 14px;
  font-weight: 500;
  color: #2d3748;
  flex: 1;
}

/* === WEEKLY BLOCK STYLING === */
.weekly-block {
  border-radius: 10px;
  border: 2px dashed #ed8936;
  background: #fffaf0;
  padding: 12px 15px;
  margin-top: 15px;
  font-size: 14px;
  color: #744210;
  box-shadow: inset 0 0 10px rgba(237, 137, 54, 0.1);
}

.weekly-block strong {
  color: #c05621;
}

.weekly-block .btn {
  margin-top: 8px;
}

/* === ACCORDION INSIDE MODAL === */
.accordion-button {
  border-radius: 8px;
  background: linear-gradient(90deg, #667eea, #764ba2);
}

.accordion-inner {
  background: #f9fafc;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.7;
}

.splash-tag  {
  margin: 10px 0;
  padding: 10px 5px;
  border-radius: 8px;
  background: #e2e8f0;
  cursor: pointer;
  display: flex;
  gap: 10px;
}

.splash-tag:hover,
.splash-tag:focus {
  background: #667eea;
  color:white;
}


.splash-tag-title {
  font-weight: bold;
}

/* ============================================================
   VERTICAL LAYER SWITCH — RIGHT SIDE, ROUNDED LEFT ONLY
   ============================================================ */

.layer-switch {
  position: fixed;
  bottom: 20px;
  right: 0;
  z-index: 1000;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;

  padding: 14px 0 14px 2px;

  background: #ffffff; /* solid */
  box-shadow: -2px 0 18px rgba(0,0,0,0.15);

  border-radius: 20px 0 0 20px;   /* rounded left only */
}

/* hide label */
.layer-switch-label {
  display: none !important;
}

/* ============================================================
   BUTTON BASE
   ============================================================ */

.layer-btn {
  width: 44px;
  height: 44px;

  border: none;
  background: transparent;

  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
  position: relative;

  transition: 0.2s ease;
}

.layer-btn:hover {
  transform: translateY(-2px);
}

.layer-btn.active {
  filter: drop-shadow(0 2px 4px rgba(102, 126, 234, 0.35));
}

.layer-btn span {
  display: none !important;
}

/* ============================================================
   LAYER ICON (LIKE YOUR IMAGE) — 2 DIAMOND SQUARES
   ============================================================ */

.layer-btn::before,
.layer-btn::after {
  content: "";
  position: absolute;

  width: 22px;
  height: 22px;
  transform: rotate(45deg);

  border-radius: 4px;
  box-sizing: border-box;

  background: #ffffff; /* Always white background */
  border: 3px solid #A0AEC0;

  transition: 0.2s ease;
}

/* POSITIONS: top square sits above bottom square */
.layer-btn::before {
  top: 4px;      /* top diamond */
}

.layer-btn::after {
  bottom: 4px;   /* bottom diamond */
}

/* ============================================================
   ACTIVE / INACTIVE LOGIC (TRUE VISUAL MATCH)
   ============================================================ */

/* ------------------------
   TOP BUTTON ACTIVE
   ------------------------ */

/* TOP BUTTON ACTIVE → bottom tile acts as SHADED tile */
#layerTopBtn.active::after {
  background: #667EEA;
  border-color: #4C51BF;
}

/* TOP outline remains outline */
#layerTopBtn.active::before {
  background: #ffffff;
  border-color: #4C51BF;
}

/* TOP BUTTON INACTIVE → both outline, white */
#layerTopBtn:not(.active)::before,
#layerTopBtn:not(.active)::after {
  background: #ffffff;
  border-color: #CBD5E0;
}


/* ------------------------
   BOTTOM BUTTON ACTIVE
   ------------------------ */

/* BOTTOM BUTTON ACTIVE → TOP tile filled, bottom outline */
#layerBottomBtn.active::before {
  background: #667EEA;         /* oberer Diamant gefüllt */
  border-color: #4C51BF;
}

#layerBottomBtn.active::after {
  background: #ffffff;         /* unterer Diamant nur Outline */
  border-color: #4C51BF;
}

/* BOTTOM BUTTON INACTIVE → all outline white */
#layerBottomBtn:not(.active)::before,
#layerBottomBtn:not(.active)::after {
  background: #ffffff;
  border-color: #CBD5E0;
}






/* Mobile and Tablet Responsive Styles */

/* Prevent horizontal scroll */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

.container {
  max-width: 100%;
  overflow-x: hidden;
}

/* Medium screens and below (tablets) */
@media (max-width: 1024px) {
  body {
    padding: 10px;
  }

  .container {
    padding: 0;
  }

  .header {
    padding: 20px 15px;
  }

  .controls {
    flex-direction: column;
    width: 100%;
  }

  .controls .input,
  .controls .btn {
    width: 100%;
    max-width: 100%;
  }

  .controls .btn {
    min-height: 44px;
  }

  .todo-header,
  .group-header {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .todo-actions,
  .group-actions {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  .todo-title,
  .group-title {
    width: 100%;
    font-size: 20px;
  }

  .splash-tag {
    flex-direction: column;
  }

  /* Make layer switch smaller on tablets */
  .layer-switch {
    right: 0;
    padding: 10px 0 10px 2px;
  }

  .layer-btn {
    width: 44px;
    height: 44px;
  }
}

/* Small screens (mobile phones) */
@media (max-width: 768px) {
  body {
    padding: 5px;
  }

  h1 {
    font-size: 24px;
    margin-bottom: 15px;
  }

  .header {
    padding: 15px 10px;
    margin-bottom: 20px;
  }

  .header-sticky {
    padding: 10px 15px;
  }

  /* Controls layout for mobile */
  .controls {
    gap: 8px;
  }

  .controls .btn {
    padding: 10px 15px;
    font-size: 14px;
    min-height: 44px;
  }

  .input {
    padding: 8px;
    font-size: 13px;
  }

  /* Groups and todos */
  .groups {
    gap: 15px;
  }

  .group {
    padding: 15px;
  }

  .group-title {
    font-size: 18px;
  }

  .todo-item {
    padding: 15px;
  }

  .todo-title {
    font-size: 16px;
  }

  .todo-actions .btn,
  .group-actions .btn {
    padding: 8px 12px;
    font-size: 13px;
    min-height: 44px;
  }

  .btn-small {
    padding: 8px 12px;
    font-size: 13px;
    min-height: 44px;
  }

  /* Modal adjustments */
  .modal-content {
    width: 95%;
    padding: 20px;
    max-height: 95vh;
  }

  .modal-content h2 {
    font-size: 20px;
  }

  .form-group label {
    font-size: 14px;
  }

  .form-group input,
  .form-group textarea,
  .form-group select {
    padding: 8px;
    font-size: 14px;
  }

  /* Extra items mobile layout */
  .extra-item {
    flex-direction: column;
    gap: 5px;
  }

  .extra-item input {
    width: 100%;
  }

  .extra-item .btn {
    width: 100%;
  }

  /* Accordion content */
  .accordion-button {
    padding: 10px 12px;
    font-size: 13px;
    min-height: 44px;
  }

  .accordion-inner {
    padding: 12px;
    font-size: 13px;
  }

  /* Listing items */
  .listing-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
  }

  .listing-item-text {
    font-size: 13px;
    width: 100%;
  }

  .listing-item .btn {
    width: 100%;
  }

  /* Weekly block */
  .weekly-block {
    padding: 10px;
    font-size: 13px;
  }

  /* Layer switch - smaller on mobile */
  .layer-switch {
    bottom: 10px;
    gap: 8px;
    padding: 10px 0 10px 2px;
  }

  .layer-btn {
    width: 44px;
    height: 44px;
  }

  .layer-btn::before,
  .layer-btn::after {
    width: 18px;
    height: 18px;
  }

  .layer-btn::before {
    top: 3px;
  }

  .layer-btn::after {
    bottom: 3px;
  }

  /* Bottom buttons - stack vertically on mobile */
  .container > div:last-of-type {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
  }

  .container > .btn,
  .container > a.btn {
    width: 100%;
    text-align: center;
    margin: 0 !important;
  }

  /* Suggestions list */
  .suggestions-list {
    gap: 8px;
  }

  .suggestion-chip {
    font-size: 13px;
    padding: 8px 12px;
    min-height: 44px;
  }

  /* Splash modal */
  .splash-content {
    padding: 20px;
  }

  .splash-tag {
    padding: 8px;
  }
}

/* Extra small screens (very small phones) */
@media (max-width: 480px) {
  h1 {
    font-size: 20px;
  }

  .group-title {
    font-size: 16px;
  }

  .todo-title {
    font-size: 14px;
  }

  .btn {
    font-size: 13px;
    padding: 10px 12px;
    min-height: 44px;
  }

  .btn-small {
    font-size: 13px;
    padding: 8px 10px;
    min-height: 44px;
  }

  .modal-content {
    padding: 15px;
  }

  /* Hide layer switch on very small screens or make it even smaller */
  .layer-switch {
    gap: 6px;
    padding: 8px 0 8px 2px;
  }

  .layer-btn {
    width: 44px;
    height: 44px;
  }

  .layer-btn::before,
  .layer-btn::after {
    width: 16px;
    height: 16px;
    border-width: 2px;
  }
}

/* Landscape mode on mobile */
@media (max-width: 896px) and (orientation: landscape) {
  .modal-content {
    max-height: 90vh;
    overflow-y: auto;
  }

  .header {
    padding: 10px 15px;
  }

  body.has-sticky-header .groups {
    margin-top: 80px;
  }
}
/* Copy all existing styles from style.css first, then add: */

/* Login Screen Styles */
.login-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  z-index: 9999;
}

.login-box {
  background: white;
  padding: 40px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  max-width: 400px;
  width: 90%;
  text-align: center;
}

.login-box h1 {
  margin-bottom: 10px;
  color: #667eea;
}

.login-box h2 {
  font-size: 20px;
  margin-bottom: 10px;
  color: #2d3748;
}

.login-box p {
  color: #718096;
  margin-bottom: 25px;
  font-size: 14px;
}

@media (max-width: 480px) {
  .login-box {
    padding: 30px 20px;
  }

  .login-box h1 {
    font-size: 24px;
  }

  .login-box h2 {
    font-size: 18px;
  }
}
