/* Custom overrides for Bootstrap */
body {
  background-image: url("../images/bg-image.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  min-height: 100vh;
}

body.page-chat {
  height: 100vh;
  overflow: hidden;
}

body.page-chat .container {
  height: calc(100vh - 3rem);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

body.page-chat .mb-4 {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

body.page-chat #chat-list {
  max-height: none;
  height: 100%;
  overflow-y: auto;
}

@supports (height: 100dvh) {
  body.page-chat {
    height: 100dvh;
  }

  body.page-chat .container {
    height: calc(100dvh - 3rem);
  }
}

.chat-loading {
  display: none;
  justify-content: center;
  padding: 8px 0 0;
}

.chat-loading img {
  width: 40px;
  height: calc(40px / 200 * 107);
}

a {
  color: var(--bs-body-color);
}

.icon {
  width: 40px;
  height: 40px;
}

.tasks-header .tasks-title {
  font-size: 60px;
  color: #1f2937;
  margin-bottom: 0;
}

.tasks-header .tasks-subtitle {
  font-size: 40px;
  color: #374151;
}

.tasks-progress-circle {
  width: 200px;
  height: 200px;
  border-radius: 999px;
  background: conic-gradient(#10b981 calc(var(--progress) * 1%), #e5e7eb 0);
  display: grid;
  place-items: center;
  padding: 10px;
}

.tasks-progress-inner {
  width: 170px;
  height: 170px;
  border-radius: 999px;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.82rem;
  line-height: 1.15;
  color: #374151;
  padding: 8px 10px;
  gap: 2px;
}

.tasks-progress-inner strong {
  line-height: 1;
}

.tasks-filters .tasks-filter-btn {
  border: 1px solid #dbe1f0;
  border-bottom: 3px solid #dbe1f0;
  background: #fff;
  color: #1f2937;
  text-decoration: none;
  padding: 8px 18px;
  border-radius: 2px;
  font-weight: 600;
  box-shadow: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.tasks-filters .tasks-filter-btn.is-active {
  background: #1e4f9a;
  color: #fff;
  border-color: #1e4f9a;
  border-bottom-color: #1e4f9a;
}

.tasks-filters .tasks-filter-btn:not(.is-active):hover {
  color: #1e4f9a;
  border-color: #1e4f9a;
  border-bottom-color: #1e4f9a;
}

.tasks-legend {
  display: none;
}

.chat-back-btn {
  display: inline-block;
  background: #111;
  color: #fff;
  padding: 8px 18px;
  border-radius: 2px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease;
}

.chat-back-btn:hover {
  color: #bcbcbc;
}

.tasks-view-btn {
  background: #bcbcbc;
  color: #fff;
  padding: 2px 10px;
  text-decoration: none;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  gap: 6px;
  transition: background 0.15s ease, transform 0.15s ease;
}

.tasks-view-btn:hover {
  color: #fff;
  background: #9e9e9e;
  transform: translateY(-1px);
}

.tasks-view-btn svg {
  flex: 0 0 auto;
}

.solution-view-count {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #fff;
  color: #bcbcbc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  flex: 0 0 28px;
}

.icon-robot path:nth-child(1) {
    opacity: 0.6;
    transition: opacity 0.3s ease-in-out, fill 0.3s ease-in-out;
}
.icon-robot:hover path:nth-child(1) {
    opacity: 1;
    fill: #83E036
}

.set-corrected.false .icon-check,
.set-state.false .icon-check {
    stroke-dasharray: 20;
    stroke-dashoffset: 20;
    transition: stroke-dashoffset 0.3s ease-in-out;
}
.set-corrected.true .icon-check,
.set-state.true .icon-check {
    stroke-dasharray: 20;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.3s ease-in-out;
}

.tasks.container .row {
  min-height: 60px;
}

.bg-blue {
  background-color: #DAE9F7;
}

.bg-green {
  background-color: #D9F2D0;
}

.bg-grey {
  background-color: #D1D1D1;
}

.bg-orange {
  background-color: #FAE2D5;
}

.chat-list {
  max-height: 60vh;
  overflow-y: auto;
}

.chat-bubble {
  max-width: 95%;
  padding: 10px 14px;
  border-radius: 16px;
  background-color: transparent;
  font-size: 0.95rem;
  line-height: 1.45;
}

.chat-user {
  background-color: #e5e7eb;
  text-align: right;
}

.chat-assistant {
  background-color: transparent;
}

.chat-file-preview {
  display: flex;
  gap: 10px;
  align-items: center;
}

.chat-preview-image {
  max-width: 160px;
  max-height: 120px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  object-fit: cover;
}

.chat-attachment-image {
  max-width: 240px;
  max-height: 180px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  object-fit: cover;
}

.chat-attachment-name {
  margin-top: 6px;
  font-size: 0.85rem;
  color: #6b7280;
}

.chat-input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background-color: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

/* Featherlight overrides */
.featherlight {
  background: rgba(255, 255, 255, 0.3) !important;
}

.featherlight .featherlight-content {
  max-width: 92vw;
  max-height: 90vh;
  width: 940px;
  height: 800px;
  margin: 40px;
  padding: 0;
  border: 0;
  background: #fff;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.featherlight-iframe .featherlight-content {
  height: 90vh;
}

.featherlight-iframe .featherlight-inner,
.featherlight-iframe iframe {
  width: 100% !important;
  height: 100% !important;
}

.featherlight .featherlight-close-icon {
  top: -14px;
  right: -14px;
  color: #111;
  background: transparent;
  border: 0;
  border-radius: 0;
  width: 28px;
  height: 28px;
  line-height: 28px;
  text-align: center;
}

.chat-textarea {
  flex: 1;
  border: 0;
  outline: none;
  resize: none;
  font-size: 0.95rem;
  line-height: 1.4;
  padding: 6px 0;
  background: transparent;
}

.chat-icon-btn {
  border: 0;
  background: transparent;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #111827;
}

.chat-icon-btn:hover {
  background-color: #f3f4f6;
}

.chat-send-btn {
  border: 0;
  background: #111827;
  color: #fff;
  fill: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chat-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.chat-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.chat-send-btn .icon {
  transform: none;
  transition: transform 0.2s ease;
}

.chat-send-btn:hover .icon {
  transform: translateX(3px);
}

.chat-message + .chat-message {
  margin-top: 6px;
}

.chat-role {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.btn-login {
  border: 0;
  background: #111827;
  color: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-login:hover {
  background: #0f172a;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

.btn-login:active {
  transform: translateY(0);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.btn-login:focus-visible {
  outline: 3px solid rgba(17, 24, 39, 0.25);
  outline-offset: 2px;
}

@media (max-width: 768px) {

  .tasks-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .tasks-header .tasks-title {
    font-size: 36px;
  }

  .tasks-header .tasks-subtitle {
    font-size: 22px;
  }

  .tasks-progress-circle {
    width: 140px;
    height: 140px;
  }

  .tasks-progress-inner {
    width: 120px;
    height: 120px;
    font-size: 0.78rem;
  }

  .tasks-filters {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .tasks-filters .d-flex {
    flex-wrap: wrap;
  }

  .tasks-filters .tasks-filter-btn {
    padding: 6px 12px;
    font-size: 0.9rem;
  }

  .tasks-view-btn {
    font-size: 0.85rem;
  }
}

@media (max-width: 992px) {
  .container,
  .container-sm {
    max-width: none;
  }

  .tasks.container > .row.bg-orange {
    flex-wrap: wrap;
  }

  .tasks.container > .row.bg-orange > .col-md-9 {
    flex: 0 0 100%;
    max-width: 100%;
    border-right: 0;
  }

  .tasks.container > .row.bg-orange > .col-md-1 {
    display: none !important;
  }

  .tasks.container .row[data-task-type] {
    flex-wrap: wrap;
    border: 1px solid #bcbcbc;
  }

  .tasks.container .row[data-task-type]:not(:last-child) {
      border-bottom: none;
  }

  .tasks.container .row[data-task-type] > .col-md-9 {
    flex: 0 0 100%;
    max-width: 100%;
    border-right: 0;
    padding-top: 20px !important;
    padding-bottom: 20px !important;
    flex-wrap: wrap;
  }

  .tasks.container .row[data-task-type] > .col-md-1 {
    flex: 0 0 33.333%;
    max-width: 33.333%;
    position: relative;
    padding-top: 26px;
  }

  .tasks.container .row[data-task-type] > .col-md-1::before {
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    content: "";
  }

  .tasks.container .row[data-task-type] > .col-md-1:nth-child(2)::before {
    content: "Gelöst";
  }

  .tasks.container .row[data-task-type] > .col-md-1:nth-child(3)::before {
    content: "Korrigiert";
  }

  .tasks.container .row[data-task-type] > .col-md-1:nth-child(4)::before {
    content: "Hilfe";
  }

  .tasks-view-btn {
    width: 140px;
  }
}

@media (max-width: 576px) {
  body.p-4 {
    padding: 0 !important;
  }
  
  body > .rounded {
    border-radius: 0 !important;
  }
  body.page-chat .container {
    height: 100dvh;
  }

  .tasks-progress-circle {
    width: 120px;
    height: 120px;
  }

  .tasks-progress-inner {
    width: 100px;
    height: 100px;
    font-size: 0.75rem;
  }
}