/* Base Resets */
:root {
  --font-sans: Verdana, Tahoma, Arial, "Helvetica Neue", Helvetica, sans-serif;
  --font-bold: 'Franklin Gothic Medium', 'Franklin Gothic', Arial, sans-serif;
  --blue-primary: #2563eb;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-bold);
  background-color: #f3f4f6;
  color: #1f2937;
  overflow-x: hidden;
}

/* Links */
a {
  color: #1d4ed8;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

input, textarea {
  font-family: var(--font-sans);
}

/* Layout Containers */
#main-container {
  height: calc(100vh - 53px);
  display: flex;
}

.list-table {
  width: 100%;
  border-collapse: collapse;
}

.list-table td, .list-table th {
  border: none;
  padding: 0.15rem 0.5rem;
}

.list-table tbody tr:nth-child(even) {
  background-color: #f0f6ff;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.list-top-right {
    text-align: right;
}


/* Top Bar */
.header .logo a {
  color: white;
  text-decoration: none;
}

.header .logo a:visited {
  color: white;
}

.header .logo a:hover {
  color: #d1d5db; 
  text-decoration: none;
  transition: color 0.2s ease;
}

.header .logo a:active {
  color: #9ca3af; /* gray-400 or adjust as needed */
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: 12.5rem;
  background-color: #fff;
  padding-left: 1rem;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
  height: 100%;
}
.sidebar a {
  display: block;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  border-radius: 0.5rem;
  color: #333;
}
.sidebar a:hover {
  background-color: #e5e7eb;
  text-decoration: none;
}
.sidebar a.active, .sidebar label.active {
  background-color: #dbeafe;
  color: #1d4ed8;
  font-weight: bold;
}

.sidebar h2, .sidebar h3 {
  margin: 0;
}

.sidebar h3 a {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.sidebar h3 a.active {
  background-color: #dbeafe;
  color: #1d4ed8;
  font-weight: bold;
  display: inline-block;
  border-radius: 0.5rem;
}

/* Main content */
main {
  flex-grow: 1;
  padding: 1rem 1rem 0;
}

.clickable {
  cursor: pointer;
}

tbody tr.clickable:hover {
  background-color: #dbeafe;
}

/* Dashboard Layout */
.dashboard {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100%;
  gap: 1rem;
}

.panel {
  display: flex;
  flex-direction: column;
  background: #fff;
  padding: 24px;
  border: 1px solid #ccc;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
  overflow-y: auto;
  min-height: 0;
  height: 100%;
}

.sublist h2 {
  font-size: 1.2rem;
  text-align: center;
}

/* Forms */
#task-form {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
#task-input, input[type="text"], input[type="email"], input[type="password"], textarea {
  flex: 1;
  padding: 10px 12px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
}
input:focus, textarea:focus {
  border-color: #2563eb;
  outline: none;
}

/* Buttons */
#task-form button, .floating-add-button, #floating-action-button {
  background-color: #2563eb;
  color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
#task-form button {
  font-size: 1em;
  padding: 10px 16px;
  border-radius: 6px;
}
.floating-add-button, #floating-action-button {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3.5rem;
  height: 3.5rem;
  font-size: 2.2rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  text-decoration: none;
}
.floating-add-button:hover, #floating-action-button:hover {
  background-color: #1e40af;
}

/* Floating Menu */
.floating-menu {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  z-index: 1000;
}

#floating-menu-options {
  display: flex;
  flex-direction: column;
  position: relative;
  bottom: 2.8rem;
  background: white;
  border: 1px solid #ccc;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  overflow: hidden;
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition: all 0.2s ease;
}
#floating-menu-options.hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.menu-option {
  padding: 0.75rem 1.5rem;
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
}
.menu-option:hover {
  background-color: #f3f4f6;
}

/* Task List */
.task {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  border-bottom: 1px solid #ccc;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.task:hover {
  background-color: #f3f4f6; /* light gray on hover */
}

.task:active {
  background-color: #e5e7eb; /* slightly darker when clicked */
}

.complete-btn {
  background: transparent;
  border: none;
  color: #e11d48;
  font-size: 1.2rem;
  cursor: pointer;
}
.complete-btn:hover {
  color: #b91c1c;
}

/* Calendar Styling */
.calendar-header-row h1 {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.calendar-header-row .btn-small.inline {
  padding: 0.2rem 0.5rem;
  font-size: 0.9rem;
  vertical-align: middle;
}

.calendar-time-block {
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  font-size: 15px;
  display: flex;
  gap: 16px;
  align-items: center;
}
.calendar-time-block .time {
  width: 70px;
  color: #444;
  font-weight: bold;
}

.now-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #007bff;
  z-index: 10;
}

/* Utility */
.container {
  padding: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}
.flex {
  display: flex;
}
.flex-between {
  justify-content: space-between;
  align-items: center;
}
.grid {
  display: grid;
  gap: 1.5rem;
}
.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.calendar-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 119px); /* Adjust for header/sidebar */
}

.all-day-bar {
  max-height: 120px;
  overflow-y: auto;
  border-bottom: 1px solid #ccc;
  background: #f8f8f8;
}

.all-day-scroll {
  display: flex;
  flex-direction: column;
  padding-left: 55px;
  background-color: #f3f4f6;
  border: 1px solid #ccc;
  border-bottom: none;
}

.all-day-bar .calendar-event {
  height: 30px;
  line-height: 30px;
  padding: 0 8px;
  margin: 1px 4px;
  border-radius: 4px;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
}


/* ================= FORM / EDIT TASK ================== */

.container {
  padding: 1.5rem;
  max-width: 640px;
  margin: 2rem auto;
}

.card {
  background-color: #ffffff;
  padding: 1rem 2rem;
  border-radius: 0.5rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.form-container {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  position: relative;
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-link {
    position: absolute;
    top: 0.7rem;
    right: 1.1rem;
    font-size: 1.3rem;
    text-decoration: none;
    color: #666;
    cursor: pointer;
}

.close-link:hover {
    color: red;
    font-weight: bold;
    text-decoration: none;
}

.js-dropdown {
    position: relative;
}

.dropdown-menu-wrapper {
    position: relative;
    display: inline-block;
}

.dropdown-menu button {
  font-family: var(--font-bold);
  font-size: 1rem;
}

.dropdown-toggle.btn {
  padding: 0.2rem 0.5rem;
  font-size: 1rem;
  cursor: pointer;
  background-color: inherit;
  border: solid 1px black;
}
.inline-dropdown .dropdown-toggle:hover {
  background-color: #e5e7eb;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    z-index: 100;
    min-width: 200px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.dropdown-menu.dropup-menu {
  top: auto;
  bottom: 100%;
}

.dropdown-menu-wrapper:hover .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: block;
    white-space: nowrap;
    padding: 0.2em 1em 0.25em;
    text-decoration: none;
    color: black;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover {
  text-decoration: none;
  background-color: #e5e7eb;
}

.dropdown-item.danger {
    color: red;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #374151; /* text-gray-700 */
}

input[type="text"],
textarea,
input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 0.75rem;
  border-radius: 0.375rem;
  border: 1px solid #d1d5db;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus,
textarea:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.4); /* Blue-500, semi-transparent */
  outline: none;
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-size: 1.25rem;
  padding-right: 3rem;
  background-color: white;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="%23222" viewBox="0 0 20 20"><path d="M5 8l5 5 5-5"/></svg>');
  background-repeat: no-repeat;
  background-position: right 1rem center;
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  color: #111827;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  line-height: 1.5;
}
select:focus {
  border-color: #2563eb;
  outline: none;
}

textarea.autosize-textarea {
  overflow: hidden;
  resize: none;
}

.form-group.error {
    border-left: 4px solid #e53935; /* red accent */
    padding-left: 0.75rem;
    /* background-color: #ffe6e6; /* subtle pink background */
}

.form-group.error label {
    color: #b71c1c;
    font-weight: bold;
}

.form-group.error input,
.form-group.error textarea {
    border-color: #e53935;
    background-color: #fff5f5;
}

.form-group .error {
    color: #b71c1c;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}


.button-group {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.btn {
  background-color: #e5e7eb;
  color: #1f2937;
  padding: 0.5rem 1.25rem;
  border: none;
  border-radius: 0.375rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  filter: brightness(0.9);
  text-decoration: none;
}

.btn-blue {
  background-color: #2563eb;        /* blue-600 */
  color: white;
  border: none;
  border-radius: 6px;               /* soften corners */
  padding: 0.5rem 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* subtle drop shadow */
  transition: all 0.15s ease;
}

.btn-blue:hover {
  background-color: #1d4ed8;        /* blue-700 */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15); /* slightly stronger on hover */
}

.btn-blue:active {
  background-color: #1e40af;        /* blue-800 */
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2); /* pressed in */
  transform: translateY(1px);       /* subtle press down */
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
    border: none;
}

.btn-default {
  all: unset; /* remove inherited or custom styles */
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid ButtonBorder;
  background-color: ButtonFace;
  color: ButtonText;
  font: menu; /* system font */
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  user-select: none;
}
.btn-default:hover {
  filter: brightness(95%);
  text-decoration: none;
}

#inbox-list {
  display: flex;
  flex-direction: column;
  gap: 1rem; /* optional: adds nice vertical space between items */
}

.inbox-item {
  background: #fff;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: background 0.2s;
}

.inbox-item:hover {
  background: #f3f4f6;
}

.item-list {
  font-family: var(--font-sans);
  font-size: 0.9rem;
}

.item-list a { /* I think this is obsolete since .item-list became table */
  display: block;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  text-decoration: none;
  color: inherit;
  transition: background-color 0.2s;
}

.item-list a:hover {
  background-color: #f9fafb; /* subtle hover */
}

.actions-cell {
    text-align: right;
    white-space: nowrap;
    padding-left: 1rem;
    width: 1%; /* shrink to fit content */
}

.item-list .dropdown-toggle.btn {
  padding: 0;
  border: 0;
  background-color: transparent; 
}

.item-list .dropdown-toggle:hover {
  background-color: transparent;
  border: solid black 1px;
}

td.empty-message {
  width: 100%;
  text-align: center;
  padding: 0.5rem;
}

.calendar-page {
  display: flex;
  gap: 1rem;
}

#calendar-main {
  flex: 2;
  min-width: 500px;
}

#calendar-right {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.calendar-grid {
  position: relative;
  border: 1px solid #ccc;
  max-height: calc(100vh - 133px);
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
}

.calendar-row {
  display: flex;
  height: 30px;
}
.calendar-time {
  width: 60px;
  text-align: right;
  padding-right: 1rem;
  font-size: 11px;
  margin-top: -8px;
}
.calendar-slot {
  flex: 1;
  cursor: pointer;
  background: #fdfdfd;
  border-top: solid 1px #bbb;
}
.calendar-slot[data-hour="0"] {
  border-top: none;
}
.calendar-row:first-child .calendar-slot {
  border-top: none;
}

div.all-day-bar .calendar-event {
  position: relative;
  left: 0;
  right: 0;
}

.sublist .calendar-event {
  position: absolute;
  left: 54px;
  right: -6px;
  width: auto;
  margin-left: 60px;
  height: 30px;
  margin: 1px 4px;
}

.calendar-event {
  display: block;
  position: absolute; /* Already expected */
  left: 60px; /* or whatever aligns with your time labels */
  width: calc(100% - 60px);
  font-size: 0.8rem;
  /*
    high: 30, 100%, 65%
    medium: 30, 100%, 80%
    low: 30, 100%, 95%
  */
  background-color: hsl(30, 100%, 95%);
  border-left: 4px solid #333;
  padding: 0px 0.5rem;
  color: black;
  border: 1px solid transparent;
  border-radius: 4px;
  text-decoration: none;
  font-size: 11px;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: var(--font-sans);
  font-weight: 500;
}

.calendar-event:hover {
  border-color: #999;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  text-decoration: none;
}
#calendar-month {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border: 1px solid #999;
  border-radius: 4px;
}

.month-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  margin-bottom: 0.25rem;
}


.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 6px;
  margin: 0;
  padding: 0;
  border: none;
  outline: none;
  box-shadow: none;
  box-sizing: border-box;
  font-size: 11px;
}

.month-weekday {
  font-weight: bold;
  text-align: center;
  padding: 4px 0;
  background: #eee;
}

.month-date {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  text-decoration: none;
  color: #333;
  background: #f9f9f9;
  border-radius: 3px;
  transition: background 0.2s ease;
  padding: 5px;
}

.month-date.current {
  background-color: #fff;
  color: #111;
}

.month-date.off {
  background-color: #f0f0f0;
  color: black;
}

.month-date.today {
  background-color: #007BFF;
  color: #fff;
  font-weight: bold;
}

.month-date.active {
  border: 2px solid #007BFF;
  box-sizing: border-box;
}

.month-date:hover {
  background: #dceeff;
  cursor: pointer;
  text-decoration: none;
}

.auth-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 90vh;
  padding: 2rem;
}

.auth-wrapper .form-container {
  max-width: 420px;
  width: 100%;
}

.form-error {
  padding: 5px 0;
}

.general-error {
  color: #b71c1c;
}

.form-container .footer {
  padding: 5px 0;
}