/* ── Tisk Task v1.0.4 Custom Styles ────────────────── */

@layer base {
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

/* ── Custom Scrollbar ──────────────────────────────────────────── */
.custom-scrollbar::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #e2e8f0;
  border-radius: 20px;
}

.dark .custom-scrollbar::-webkit-scrollbar-thumb {
  background: #1e293b;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #cbd5e1;
}

/* ── Animations ────────────────────────────────────────────────── */
@keyframes modalEnter {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── UI Components ─────────────────────────────────────────────── */
dialog::backdrop {
  background: rgba(2, 6, 23, 0.8);
  backdrop-filter: blur(12px);
}

/* Sidebar Responsive */
@media (max-width: 1023px) {
  #leftSidebar {
    position: fixed;
    top: 0;
    left: -360px;
    bottom: 0;
    width: 340px;
    z-index: 100;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex !important;
    box-shadow: 25px 0 50px -12px rgba(0, 0, 0, 0.25);
  }

  #leftSidebar.sidebar-open {
    left: 0;
  }

  #activitySidebar {
    position: fixed;
    top: 0;
    right: -360px;
    bottom: 0;
    width: 340px;
    z-index: 100;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex !important;
    box-shadow: -25px 0 50px -12px rgba(0, 0, 0, 0.25);
  }

  #activitySidebar.sidebar-open {
    right: 0;
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.6);
    backdrop-filter: blur(4px);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .sidebar-overlay.show {
    opacity: 1;
    pointer-events: auto;
  }
}

/* ── Rich Editor ───────────────────────────────────────────────── */
.rich-editor ul {
  list-style-type: disc;
  padding-left: 1.5rem;
  margin: 0.5rem 0;
}

.rich-editor a {
  color: #2563eb;
  text-decoration: underline;
  font-weight: 700;
}

/* ── Masquerade Bar Adjustment ─────────────────────────────────── */
body.is-masquerading #appView {
  height: calc(100vh - 40px);
}

.force-hidden {
  display: none !important;
}

/* ── Dark Mode Tweaks ─────────────────────────────────────────── */
.dark input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}

/* ── Custom Mobile Tweaks ─────────────────────────────────────────── */
@media (max-width: 768px) {
  #taskOptionsModal .task-options-header {
    padding-right: 30px;
    padding-left: 30px;
  }

  #taskOptionsModal .task-options {
    padding-right: 15px;
    padding-left: 15px;
  }

  #taskOptionsModal .task-options .task-status,
  #taskOptionsModal .task-options .task-owner,
  #taskOptionsModal .task-options .task-owner .task-datetime,
  #taskItemsContainer .task-item-row .grid {
    grid-template-columns: auto;
  }

  #taskItemsContainer .task-hours label,
  #taskItemsContainer .task-hours input {
    text-align: left;
  }

  #taskOptionsModal .task-options-footer {
    padding-right: 30px;
    padding-left: 30px;
    flex-direction: column;
  }
  
  #loginView .login-container {
    padding-left: 30px;
    padding-right: 30px;
  }
  
  #otpStep .digits-container {
    gap: 0;
    margin-bottom: 10px;
  }
  
  #otpStep .digits-container input {
    max-width: 2.35rem;
    height: 2.75rem;
    font-size: 1rem;
    border-radius: 0;
    border-right: 0;
  }
  
  #otpStep .digits-container input:first-child {
    border-top-left-radius: .75rem;
    border-bottom-left-radius: .75rem;
  }
  
  #otpStep .digits-container input:last-child {
    border-right: 2px solid #e2e8f0;
    border-top-right-radius: .75rem;
    border-bottom-right-radius: .75rem;
  }
  
  #backToEmailBtn {
    margin-top: 15px;
  }
}

@media (max-width: 540px) {
  #loginView .login-container {
    padding-left: 20px;
    padding-right: 20px;
  }
  
  #appView header {
    padding-left: 30px;
    padding-right: 30px;
    position: relative;
  }

  #profileTrigger {
    padding-right: 0.5em;
  }

  #profileTrigger>svg {
    display: none;
  }

  #appView header .r540 {
    position: absolute;
    border-bottom-width: 1px;
    border-color: rgb(226 232 240 / var(--tw-border-opacity, 1));
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom-left-radius: 0;
    right: 0px;
    top: 80px;
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    padding-right: 30px;
    padding-left: 30px;
  }

  .dark #appView header .r540 {
    border-color: rgb(30 41 59 / var(--tw-border-opacity, 1));
  }

  #dashboardWrapper main {
    margin-top: 40px;
  }

  #dashboardWrapper main>div:nth-child(1) {
    padding-left: 30px;
    padding-right: 30px;
  }

  #dashboardWrapper main>div:nth-child(1)>div {
    padding-left: 0;
    padding-right: 0
  }

  #dashboardWrapper main .r540 {
    padding-left: 30px;
    padding-right: 20px;
  }

  #activitySidebar {
    right: -90vw;
    width: 80vw;
  }

  #leftSidebar {
    left: -90vw;
    width: 80vw;
  }

  #adminModal .admin-table-container {
    max-height: none;
  }

  #adminModal .admin-table-container table thead {
    display: none;
  }

  #adminAddUserBtn {
    width: 100%;
  }

  #adminUserList tr {
    display: flex;
    flex-direction: column;
  }

  #adminUserList tr:not(:last-child) {
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 15px;
  }

  #dateFilterModal .range-choices {
    grid-template-columns: auto;
  }

  #dateFilterModal .date-range-footer {
    flex-direction: column;
  }
}

@media(max-width: 480px) {
  #masqTargetName+span {
    display: none;
  }
}