/* Import Fonts */
@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono&family=Ubuntu+Mono&display=swap');

@import url('https://fonts.googleapis.com/css2?family=Squada+One&display=swap');

@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,400;0,600;1,700&display=swap');

/* Set up Variables */
:root {
    /* FONTS */
    --title-font : 'Squada One', cursive;
    --text-font : 'Poppins', sans-serif;
    /* BACKGROUND COLORS (BLACK / GREY) */
    --bg-dark: #171519;
    --bg-reg: #1b2023;
    --bg-alt: #292c34;
    --bg-light: #3a404a;

    /* TEXT COLORS */
    --tx-reg: #dce1e5;
    --tx-alt: #919fac;
    --tx-dark-button : #eee;
    --tx-light-button: #000;
    --tx-acc: var(--co-white);


    /* Main Colors */
    --co-orange: #ffb64d;
    --co-blue: #357dec;
    --co-green: #35eca3;
    --co-white: #f5faff;
    --co-purple: #6c35ec;
    --co-yellow: #ecda35;
    --co-red: #ec5035;

    /* Color Setup */
    --ux-title : var(--tx-reg);
    --ux-links : var(--co-green);
    --ux-menu : var(--co-green)

}

/* Text color fix */
h1,h2,h3,h4,h5,h6,p,b,li,td,th,a,label{
    color : var(--tx-reg);
    font-family : var(--text-font);
}

h1,h2,h3,b{
	font-weight:600;
}

/* Buttons colors */
.pure-button, a.pure-button {
    color:var(--bg-reg);
    background-color:var(--tx-reg);
    font-family : var(--text-font);
    cursor:pointer;
}

.bGrey{
	background: rgb(230, 230, 230);
}
.bDefault {
    background-color: var(--co-green);
    color :black;
}
.bGreen {
    background-color: var(--co-green); /* this is a green */
}

.bRed {
    background-color: var(--co-red); /* this is a maroon */
}

.bYellow {
    background-color: var(--co-yellow); /* this is an yellow */
}

.bOrange {
    background-color: var(--co-orange); /* this is an orange */
}

.bBlue, .bDarkBlue {
    background-color: var(--co-blue)!important; /* this is a light blue */
}

.tGreen {
    color:  var(--co-green); /*  this is light green*/
}

.tRed {
    color: var(--co-red)!important; /* this is a maroon */
}

.tYellow {
    color: var(--co-yellow); /* this is an orange */
}
/* MAIN SECTIONS */
.ktp-container {
    float:right;
    background-color: var(--bg-reg);
    width:calc(100vw - 256px);
    display:inline-block;
}

/* Menu Styling */
b.site-title {
    color: var(--ux-title);
    font-weight:bolder;
    font-family: 'Squada One', cursive;
    font-size:36px;
}
/* SHEET MODE */
.sheet-mode td input {
    margin:0;
    padding:0;
    width:200px;
    height:100%;
    background-color:#090909;
    color:#a1a9b6;
    border-bottom:0;
    border-top:0;
    border-left:0;
    border-right:0;
    border-radius:0;
    -webkit-box-shadow: inset 0 1px 3px #000;
    box-shadow: inset 0 1px 3px #000;
}

.terminal-output p {
    font-family : monospace;
}
/* Modal Fix (bootbox) */

.object-form input[type=text], .object-form select, .object-form textarea{
    width : 60%;
}
.object-form textarea{
    height:150px;
}

.object-form input[type=text], .object-form select, .object-form textarea, .object-form label{
    margin-top:5px;
    margin-bottom:5px;
}

.pure-form select {
    padding-top:6px;
}
.pure-form label {
    margin:5px;
    margin-left: 10px;
}

button.bootbox-close-button.close {
    color:white;
}

input[type=text],  input[type=date], input[type=text][disabled], input[type=password],  textarea, select{
   font-size:16px;
   background-color:var(--bg-dark);
   color:var(--tx-reg);
   border: 1px solid var(--bg-reg);
   -webkit-box-shadow: inset 0 1px 3px #000;
   box-shadow: inset 0 1px 3px #000;
}
input:focus {
   border-color: var(--ux-link);
}
input[type=text][disabled], textarea[disabled], select[disabled] {
    border: 0px solid #333;
    background-color:var(--bg-reg);
    box-shadow: none;
}


/* DARK MODE */
body {
    background-color:var(--bg-reg);
    color:#dfe2e7;
    text-align: center;
    vertical-align: middle;
}
.logged-out {
    padding:20%;
    font-size:2em;
}

.text-page {
    margin:20px;
    max-width:960px;
    text-align:left;
}
.text-page {
    line-height: 1.5;

}

body code {
    font-family: "Ubuntu Mono", monospace;
    background-color:var(--bg-dark);
    color : var(--tx-acc);
    padding:2px;
}

body a {
    color: var(--ux-links); /*  this is light green*/
}

body li.pure-menu-heading {
    color:var(--tx-reg);
}

body li.pure-menu-selected a{
    color:var(--tx-acc)!important;
}

body li.pure-menu-item a{
    color:var(--ux-menu);
}

body .pure-menu-link:hover, body .pure-menu-link:hover{
    font-weight:bold;
    background-color:inherit;
}

.pure-sub-item.pure-menu-link {
    font-size:12px;
    text-align: left;
    margin-left:30%
}
.pure-menu-has-children>.pure-menu-link {
    font-size: 14px;
}



/* PURE CSS EXTENSION */
.pure-checkbox {
    border : 0.1em solid var(--tx-reg);
    border-radius:2px;
    width:1.5em;
    height:1.5em;
    padding:.15em;
    background-color: var(--bg-reg);
    color: var(--tx-reg);
}
.pure-checkbox.no-border {
    border : none;
}

/* TABLE STYLING */
#outputTable table, th {
	font-weight: normal;
}
#outputTable tbody tr {
    border-collapse: collapse;
    border-radius:15px;
	overflow-wrap: break-word;
	min-height:48px;
	transition-duration: .1s;
}
#outputTable tr td.col3 {
    max-width:720px!important;
    text-align:center;
}
#outputTable th, #outputTable td {
    border-left: none;
    border-right: none;
	padding:5px;
	overflow-wrap: break-word;
	height:48px;
	text-align:center;
}
#outputTable {
	width:100%;
    table-layout: auto;
}

* {
    font-family: 'Lato', sans-serif;
}

/* REQUESTS */
body.loading * {
    cursor : progress!important;
}

.yell-notification-text *{
    color : var(--bg-reg)
}
.yell-notification-text b{
    font-weight:normal;
}
.yell-notification-text {
    margin:5px;
    padding-top:5px;
    padding-bottom:5px;
    font-size:14px;
    font-family:var(--text-font);
}
.yell-notification-box {
    max-width:200px;
    border-radius:2px;
}

/* MENU GROUPS */
.main-menu .pure-menu-item {
    display:none;
}
.main-menu .pure-menu-item.active, .pure-menu-item.default-menu, .pure-menu-item.pure-menu-has-children {
    display:block;
}

.pure-menu-has-children>.pure-menu-link:after {
    content :"";
}

.pure-menu, .pure-menu-children, .pure-menu-item {
    background-color: var(--bg-reg);
}

.pure-menu-children {
    z-index:5000;
}

.pure-menu.main-menu{
    height: calc(100vh - 90px);
}
.pure-menu.user-menu{
    height: 70px;
}


/* PURECSS EXTENSION */
.pure-g > div.pure-card{
    border : 1px solid #333;
    border-radius: 15px;
    padding: 15px;
    width:20%;
    min-width: 290px;
    margin : 15px;
    display: inline-block;
    letter-spacing: normal;
    word-spacing: normal;
    vertical-align: top;
    text-rendering: auto;
}
.pure-g > div.pure-card-mini{
    border : 1px solid #333;
    border-radius: 15px;
    padding: 15px;
    width:160px;
    margin : 15px;
    display: inline-block;
    letter-spacing: normal;
    word-spacing: normal;
    vertical-align: top;
    text-rendering: auto;
}

.pure-button {
    margin:5px;
}

.pureBigger {
	font-size:16px;
}

.pureSmaller {
	font-size:12px;
}

.pureMini {
	font-size:10px;
}
.pureTiny {
	font-size:8px;
}

.pure-form input[type=text], .pure-form input[type=date], .pure-form input[type=text][disabled], .pure-form input[type=password],  .pure-form textarea, .pure-form select{
   font-size:16px;
   background-color:var(--bg-dark);
   color:var(--tx-reg);
   border: 1px solid var(--bg-reg);
   -webkit-box-shadow: inset 0 1px 3px #000;
   box-shadow: inset 0 1px 3px #000;
}
.pure-form input:focus, .pure-form textarea:focus, .pure-form select:focus {
   border-color: var(--ux-links);
}
.pure-form input[type=text][disabled], .pure-form textarea[disabled], .pure-form select[disabled] {
    border: 0px solid #333;
    background-color:var(--bg-reg);
    box-shadow: none;
}

.pure-info {
    max-width:540px;
    text-align: center;
    background-color:var(--bg-alt);
    margin:10px;
    padding:15px;
    padding-top:10px;
    padding-bottom:10px;
    border-radius:10px;
}
.pure-info p{
    margin-bottom:0;
}

/* Sanitization */
a.nostyle:link {
    text-decoration: inherit;
    color: white;
}

a.nostyle:visited {
    text-decoration: inherit;
    color: white;
}
ul.ui-menu.ui-widget.ui-widget-content.ui-autocomplete {
    z-index:10000;
    list-style:none;
    background-color:var(--bg-alt);
    width: 320px;
    padding:10px;
}

.object-form input[type=select] {
    background-color: red;
}
/* */
.loading {
    display:block;
    position:fixed;
    z-index:10000;
    background-color: var(--co-yellow);
    bottom:0;
    right:0;
    font-size:16px;
    padding:5px;
    margin:5px;
    border-radius:5px;
    color:var(--bg-reg);
}
/* TASKS STYLING */
table {
    width:100vw;
}
table tr {
    min-height:48px;
}
table tr.task td{
    border-left: none;
    border-right: none;
	padding:10px;
	overflow-wrap: break-word;
	height:48px;
	text-align:center;
    margin:0;
}

tr.task:hover {
    background-color:var(--bg-alt);
}
tr.task td {
    margin:0;
}

/* MOBILE */
@media only screen and (max-width: 768px) {
  /* For mobile phones: */
  td[field=app], td[field=item] {
      display:none;
  }
}

/* ---- TaskMe toolbar ---- */
.toolbar {
  max-width: 1200px;
  margin: 18px auto;
  padding: 12px;
  text-align: left;
  background: var(--bg-alt);
  border-radius: 10px;
}

.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  justify-content: space-between;
}

.toolbar-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.toolbar-group-spacer {
  flex: 1 1 auto;
}

.toolbar-group label {
  font-size: 12px;
  color: var(--tx-alt);
}

.toolbar-group select {
  min-width: 160px;
}

.toolbar-search {
  align-items: center;
}

.toolbar-search input {
  min-width: 240px;
}

.toolbar-search .pure-button {
  margin: 0;
}

.toolbar-hint {
  font-size: 12px;
  color: var(--tx-alt);
  margin-left: 8px;
}

/* ---- table ---- */
.table-wrap {
  max-width: 1200px;
  margin: 0 auto 32px auto;
  padding: 0 8px;
}

#tasksTable {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-reg);
}

#tasksTable thead th {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid var(--bg-light);
  color: var(--tx-alt);
  font-size: 12px;
}

#tasksTable thead th.sortable {
  cursor: pointer;
  user-select: none;
}

#tasksTable thead th.sortable .sort-ind {
  display: inline-block;
  width: 10px;
  opacity: 0.6;
}

#tasksTable thead th.sortable.sort-asc .sort-ind::after {
  content: "▲";
  font-size: 10px;
}

#tasksTable thead th.sortable.sort-desc .sort-ind::after {
  content: "▼";
  font-size: 10px;
}

#tasksTable tbody td {
  padding: 10px;
  border-bottom: 1px solid var(--bg-dark);
  vertical-align: top;
}

.cell-select {
  text-align: center;
}

.cell-tags {
  text-align: left;
}

.cell-time {
  white-space: nowrap;
  color: var(--tx-alt);
  font-size: 12px;
}

/* ---- tags ---- */
.tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--bg-light);
  margin: 2px 6px 2px 0;
  font-size: 12px;
  color: var(--tx-reg);
  background: var(--bg-dark);
}

.tag-rel {
  opacity: 0.85;
  font-size: 11px;
}

.task-title {
  font-weight: 600;
}

.cell-title-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.task-sub {
  margin-top: 4px;
}

.task-due-mobile {
  display: none;
}

.tag-empty {
  opacity: 0.6;
}

/* ---- due / overdue ---- */
.due {
  color: var(--tx-reg);
}

.due-overdue {
  color: var(--co-red);
  font-weight: 600;
}

.row-overdue {
  background: rgba(236, 80, 53, 0.06);
}

/* ---- side pane ---- */
.pane {
  position: fixed;
  top: 0;
  right: 0;
  width: min(520px, 92vw);
  height: 100vh;
  background: var(--bg-alt);
  border-left: 1px solid var(--bg-light);
  box-shadow: -10px 0 30px rgba(0,0,0,0.12);
  z-index: 999;
  display: flex;
  flex-direction: column;
}

.pane-header {
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--bg-light);
}

.pane-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--tx-reg);
  margin-right: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Editable title input in pane header */
input.pane-title-input {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--tx-reg);
  border: 1px solid transparent;
  background: transparent;
  box-shadow: none;
  -webkit-box-shadow: none;
  padding: 6px 8px;
  border-radius: 10px;
}

input.pane-title-input:focus {
  outline: none;
  border-color: var(--bg-light);
  background: rgba(255,255,255,0.03);
}

.pane-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pane-link {
  color: var(--tx-alt);
  text-decoration: none;
  padding: 8px;
}

.pane-body {
  padding: 14px;
  overflow: auto;
}

.pane-section {
  margin-bottom: 14px;
}

.pane-label {
  font-size: 12px;
  color: var(--tx-alt);
  margin-bottom: 6px;
}

.pane-section select {
  width: 100%;
}

.pane-desc {
  padding: 10px;
  background: var(--bg-reg);
  border: 1px solid var(--bg-light);
  border-radius: 10px;
  white-space: pre-wrap;
}

.pane-tags .tag {
  margin-right: 6px;
}

.pane-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.pane-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pane-due {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.pane-due input {
  min-width: 220px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--bg-light);
  background: var(--bg-reg);
  color: var(--tx-reg);
}

.pane-gtd {
  padding: 10px;
  background: var(--bg-reg);
  border: 1px solid var(--bg-light);
  border-radius: 10px;
}

.pane-textarea{
  width:100%;
  min-height:120px;
  padding:10px;
  border-radius:10px;
  border:1px solid var(--bg-light);
  background:var(--bg-reg);
  color:var(--tx-reg);
  box-shadow: none;
  -webkit-box-shadow: none;
  resize:vertical;
}

/* When the detail pane is open, keep the dashboard visible on larger screens */
@media (min-width: 1200px) {
  body.pane-open .logged-in {
    margin-right: 540px; /* pane width (520) + a bit of breathing room */
    transition: margin-right 160ms ease;
  }
}

/* --- Modal (Quick Add Task) --- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}

.modal-card {
  position: relative;
  width: min(640px, calc(100vw - 24px));
  margin: 8vh auto 0;
  background: var(--bg-alt);
  border-radius: 10px;
  border: 1px solid var(--bg-light);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--bg-light);
}

.modal-title {
  font-weight: 700;
  color: var(--tx-reg);
}

.modal-body {
  padding: 14px;
}

.modal-label {
  font-size: 12px;
  color: var(--tx-alt);
  margin-bottom: 6px;
}

.modal-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--bg-light);
  border-radius: 8px;
  background: var(--bg-reg);
  color: var(--tx-reg);
}

.quick-step-search {
  margin-bottom: 10px;
}

.modal-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.modal-buttons .pure-button[hidden] {
  display: none !important;
}

.modal-buttons .pure-button.is-active {
  outline: 2px solid var(--co-blue);
  outline-offset: 1px;
}

/* Improve contrast for buttons inside the Quick Add modal */
.modal .pure-button {
  border: 1px solid rgba(255,255,255,0.12);
}
.modal .pure-button.bDefault {
  background: var(--bg-reg);
  color: var(--tx-reg);
}
.modal .pure-button.bGrey {
  background: var(--bg-light);
  color: var(--tx-reg);
}
.modal .pure-button:focus {
  outline: 2px solid rgba(255,255,255,0.18);
  outline-offset: 2px;
}

.modal-hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--tx-alt);
}

.quick-create-status {
  color: var(--co-blue);
  font-weight: 600;
}

.modal-card.is-busy {
  cursor: progress;
}

.modal-card.is-busy .modal-input,
.modal-card.is-busy .pure-button {
  pointer-events: none;
  opacity: 0.7;
}

/* --- Mobile quick add (mobile-only) --- */
.mobile-quick-add {
  display: none;
  max-width: 1200px;
  margin: 10px auto 14px auto;
  padding: 0 8px;
}

.mobile-quick-card {
  text-align: left;
  background: var(--bg-alt);
  border: 1px solid var(--bg-light);
  border-radius: 12px;
  padding: 12px;
}

.mobile-quick-primary {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mobile-quick-label {
  font-size: 12px;
  color: var(--tx-alt);
  margin: 10px 0 6px 0;
}

.mobile-quick-input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--bg-light);
  background: var(--bg-reg);
  color: var(--tx-reg);
}

.mobile-quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mobile-quick-grid .pure-button {
  min-height: 44px;
  padding: 10px;
  border-radius: 10px;
}

.mobile-quick-grid .pure-button.is-active {
  outline: 2px solid var(--co-blue);
  outline-offset: 1px;
}

.mobile-quick-submit {
  width: 100%;
  min-height: 56px;
  margin-top: 0;
  font-size: 18px;
  font-weight: 700;
  border-radius: 12px;
}

.mobile-quick-options-toggle {
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
  border-radius: 10px;
}

.mobile-quick-options {
  margin-top: 8px;
}

@media only screen and (max-width: 768px) {
  .toolbar {
    display: none;
  }

  .mobile-quick-add {
    display: block;
    margin: 8px auto 10px auto;
  }

  .table-wrap {
    margin-bottom: 20px;
    padding: 0 6px;
  }

  #tasksTable thead th:nth-child(1),
  #tasksTable thead th:nth-child(n+4) {
    display: none;
  }

  #tasksTable tbody td:nth-child(1),
  #tasksTable tbody td:nth-child(n+4) {
    display: none;
  }

  #tasksTable thead th:nth-child(2) {
    width: 56px;
    text-align: center;
  }

  #tasksTable tbody td:nth-child(2) {
    width: 52px;
    text-align: center;
    padding: 10px 6px;
    vertical-align: middle;
  }

  #tasksTable tbody td:nth-child(3) {
    padding: 10px 6px 10px 4px;
    text-align: left;
    vertical-align: middle;
  }

  #tasksTable .cell-title-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
  }

  #tasksTable .task-title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 17px;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  #tasksTable .task-sub {
    display: none;
  }

  #tasksTable .task-due-mobile {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    font-size: 11px;
    line-height: 1;
    color: var(--tx-alt);
    border: 1px solid var(--bg-light);
    border-radius: 999px;
    padding: 4px 8px;
    white-space: nowrap;
    margin-top: 2px;
  }

  #tasksTable .task-due-mobile.due-overdue {
    border-color: rgba(236, 80, 53, 0.65);
  }

  #tasksTable .btn-done {
    width: 44px;
    height: 44px;
    padding: 0;
  }
}
