/* ===========================
   GLOBAL
=========================== */

body {
    font-family: system-ui, sans-serif;
    margin: 30px;
    max-width: 700px;
    background: #ffffff;
    color: #222;
    transition: background 0.2s, color 0.2s;
}

h1 {
    margin-bottom: 10px;
    font-size: 24px;
}

.section {
    margin-bottom: 12px;
    padding: 8px;
    background: #f0f0f0;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.row {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    align-items: center;
}

input, select, button {
    padding: 4px 8px;
    font-size: 14px;
}

button {
    background: #0078d4;
    color: white;
    border: none;
    cursor: pointer;
}

button:hover {
    background: #005fa3;
}

#todo-list {
    margin-top: 10px;
}

/* ===========================
   TASK LIST
=========================== */

.task {
    display: grid;
    grid-template-columns: 60px 110px 1fr 120px 120px 30px 30px;
    gap: 6px;
    padding: 6px 4px;
    border-bottom: 1px solid #444;
    align-items: center;
    font-size: 14px;
}

.task:hover {
    background: rgba(0, 0, 0, 0.05);
    cursor: pointer;
}

body.dark .task:hover {
    background: rgba(255, 255, 255, 0.08);
}

.task header {
    font-weight: bold;
    font-size: 12px;
    padding: 2px 4px;
    border-bottom: 1px solid #ccc;
    background: #f0f0f0;
    height: 20px;
}

.task span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task .delete-btn {
    color: #c00;
    cursor: pointer;
    font-weight: bold;
    text-align: center;
}

.task .delete-btn:hover {
    color: #900;
}

/* ===========================
   DARK MODE
=========================== */

body.dark {
    background: #1e1e1e;
    color: #e0e0e0;
}

body.dark .section {
    background: #2a2a2a;
    border-color: #444;
}

body.dark input,
body.dark select,
body.dark button {
    background: #333;
    color: #eee;
    border-color: #555;
}

body.dark button:hover {
    background: #006edc;
}

body.dark .task {
    border-bottom: 1px solid #444;
}

body.dark .delete-btn {
    color: #ff6666;
}

body.dark .delete-btn:hover {
    color: #ff3333;
}

/* ===========================
   DATE INPUT + ICON
=========================== */

.date-wrapper {
    position: relative;
    display: block;
    width: 100%;
}

.date-wrapper input[type="date"] {
    width: 100%;
    padding-right: 32px;
    box-sizing: border-box;
}

.date-icon {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    pointer-events: none;
    background-size: contain;
    background-repeat: no-repeat;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' viewBox='0 0 24 24'%3E%3Cpath d='M19 4h-1V2h-2v2H8V2H6v2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11z'/%3E%3C/svg%3E");
}

body.dark .date-icon {
    filter: invert(1);
}

/* Chromium: native Icon unsichtbar, aber klickbar */
.date-wrapper input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0;
    cursor: pointer;
}

/* ===========================
   DUE COLORS
=========================== */

.task.due-overdue {
    background-color: #f8d7da;
    color: #7a1a1a;
}

.task.due-today {
    background-color: #fff4d6;
    color: #7a4e00;
}

.task.due-soon {
    background-color: #fffbe0;
    color: #6a6a00;
}

body.dark .task.due-overdue {
    background-color: #3a0f0f;
    color: #ffb3b3;
}

body.dark .task.due-today {
    background-color: #3a2a0f;
    color: #ffd28a;
}

body.dark .task.due-soon {
    background-color: #33330f;
    color: #ffffb3;
}

@-moz-document url-prefix() {
    /* In Firefox: eigenes Icon ausblenden */
    .date-icon {
        display: none !important;
    }

    /* Firefox: wieder natives Date-Input verwenden */
    .date-wrapper input[type="date"] {
        padding-right: 0 !important;
        appearance: auto !important;
        -moz-appearance: textfield !important;
        background-image: none !important;
    }
}


.header-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}


.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65); /* deutlich dunkler */
  backdrop-filter: blur(2px);      /* moderner Effekt */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
}

.modal-content {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  width: 90%;
  max-width: 650px;   /* größer */
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-content textarea {
  width: 100%;
  height: 80px;
  font-size: 15px;
  line-height: 1.4;
  padding: 10px;
  resize: vertical;
  box-sizing: border-box;
}


.modal.hidden {
  display: none;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
}

.entry-badge {
    margin-left: auto;   /* schiebt die Badge ganz nach rechts */
    display: inline-block;
    padding: 2px 10px;
    font-size: 1.0rem;
    line-height: 1.2;
    white-space: nowrap;
    background-color: #ffffff;
    color: #333;
}

/* Dark Mode */
body.dark .entry-badge {
    background-color: #444;   /* dezentes Dunkelgrau */
    color: #ddd;              /* leichtes, nicht grelles Hellgrau */
}

