
/* clientlog.css */

/* ===== Panel container ===== */
.client-log-panel {
  display: flex;
  flex-direction: column;
  /* use shared .panel padding; keep visual treatments */
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  height: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

/* Tiny top gap above divider for Client Log (wins in cascade) */
#main-panels > #client-list-section.panel--bottom {
  padding-top: var(--space-3);   /* bump to var(--space-3) if you want ~12px */
}

/* ===== Header ===== */
.panel-header {
  position: relative;
  min-width: 0;
  /* tighten: rely on shared .panel-header spacing (smaller) */
  padding-top: 0;
  margin-bottom: 0.25rem;
}

/* ===== Header Actions Grid Layout ===== */
#clientlog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  width: 100%;
  min-width: 0;
  padding: 0;
  background: none;
}

/* Group import button and info icon tightly */
#clientlog-actions .left-actions {
  display: flex;
  align-items: center;
  gap: 0.23em;
  z-index: 2; /* Above background, below title */
}

/* Quick Add button (match Call Log "Add Call" look) */
#quick-add-client-button {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
  margin-left: 12px; /* nudge right ~1/8" */
}
#quick-add-client-button .plus {
  height: 20px;
  width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: bold;
  line-height: 20px;
}
#quick-add-client-button .label {
  font-size: 12px;
  line-height: 14px;
  white-space: nowrap;
}

/* Keyboard focus, keep subtle */
#quick-add-client-button:focus {
  outline: 2px solid #a6c1ee;
  outline-offset: 4px;
  border-radius: 6px;
}

/* ===============================
   Quick Add Client Modal (Client Log)
   Match Call Log "Add Call" modal look
   =============================== */
#quick-add-client-modal {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
}

#quick-add-client-modal.hidden {
  display: none !important;
}

#quick-add-client-modal .modal-content {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  padding: 2.5rem 2rem 2rem 2rem;
  width: 100%;
  max-width: 440px;
  min-width: 300px;
  position: relative;
  text-align: left;
  animation: modal-pop-in 0.2s cubic-bezier(.4,2,.6,1) backwards;
}

#quick-add-client-modal .modal-content h2 {
  margin: 0 0 1.25rem 0;
  font-size: 1.45rem;
  font-weight: 700;
  text-align: center;
  color: #22294f;
}

#quick-add-client-modal label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 1rem;
  font-weight: 600;
  color: #223;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#quick-add-client-modal input[type="text"],
#quick-add-client-modal textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  margin-bottom: 1rem;
  border: 1px solid #ccd6e6;
  border-radius: 6px;
  font-size: 1rem;
  background: #f7fafd;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

#quick-add-client-modal input[type="text"]:focus,
#quick-add-client-modal textarea:focus {
  outline: none;
  border-color: #4b6cb7;
  background: #fff;
}

#quick-add-client-modal .radio-group {
  display: flex;
  gap: 1.2rem;
  margin-bottom: 1.2rem;
  padding-left: 0.3rem;
}

#quick-add-client-modal .radio-group label {
  font-size: 1rem;
  font-weight: 500;
  color: #223;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

#quick-add-client-modal .button-group {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
}

#quick-add-client-modal .button-group button {
  min-width: 90px;
  padding: 0.5rem 1.3rem;
  border-radius: 1.5rem;
  border: none;
  background: #a6c1ee;
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

#quick-add-client-modal .button-group button:hover,
#quick-add-client-modal .button-group button:focus {
  background: #7ea5e5;
}

#quick-add-client-modal .button-group #qa-cancel {
  background: #ddd;
  color: #333;
}

#quick-add-client-modal .button-group #qa-cancel:hover,
#quick-add-client-modal .button-group #qa-cancel:focus {
  background: #bbb;
}

/* Centered title */
#clientlog-actions .panel-title {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  font-size: 1.25rem;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  background: none;
  z-index: 1;
}

/* All Clients button right aligned */
#clientlog-actions .action-button:last-child {
  z-index: 2;
}

/* ===== Sleek outlined buttons (Calendar import ONLY) ===== */
#import-ics-button {
  appearance: none;
  -webkit-appearance: none;

  min-width: 120px;            /* smaller */
  padding: 0.4rem 1rem;        /* slimmer */
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;

  background: #fff;            /* white center */
  color: #007bff;              /* app's blue text */
  border: 2px solid #a6c1ee;   /* light blue outline used elsewhere */
  border-radius: 1.5rem;       /* rounded */
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.2px;
  line-height: 1.2;

  box-shadow: none;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

/* All Clients button (match Quick Add / Add Call look) */
#show-clients-button {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
  margin-left: 12px;

  /* remove default button styling (this is a div now, but keep safe) */
  background: none;
  border: none;
  padding: 0;
  color: #000; /* icon + label black */
}

#show-clients-button .plus {
  height: 20px;
  width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 20px;
}

#show-clients-button .label {
  font-size: 12px;
  line-height: 14px;
  white-space: nowrap;
}

#show-clients-button:focus {
  outline: 2px solid #a6c1ee;
  outline-offset: 4px;
  border-radius: 6px;
}

/* ===== Info icon styling ===== */
/* Tooltip for info icon */
/* ===== Individual Tab Button ===== */
.clientlog-tab {
  flex: 1;
  padding: 0.5rem 0.25rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-weight: 500;
  text-align: center;
  transition: border-color 0.2s, color 0.2s;
  min-width: 0;
  overflow: hidden;
}

.clientlog-tab:hover {
  color: #007bff;
}

.clientlog-tab.active {
  border-color: #007bff;
  color: #007bff;
}

/* ===== Day content area ===== */

/* ===== No-events message ===== */

/* ===== Times table ===== */

  border: 1px solid #eee;
  padding: 0.5rem;
  vertical-align: top;
  min-width: 0;
  max-width: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
  word-break: break-word;
}

/* Hour labels */
  width: 4rem;
  background-color: #f9f9f9;
  font-weight: 500;
  min-width: 0;
  max-width: 4rem;
  text-align: right;
  white-space: nowrap;
}

/* Appointment block styling */


/* ===== Responsive tweaks ===== */
@media (max-width: 800px) {
  .client-log-panel {
    padding: 0.5rem;
  }

@media (max-width: 500px) {
  .client-log-panel .panel-header .panel-title,
  #clientlog-actions .panel-title {
    font-size: 1rem;
  }
    font-size: 0.8rem;
    padding: 0.15rem 0.2rem;
  }

  /* compact buttons on mobile */
  #import-ics-button,
  #show-clients-button {
    min-width: 90px;
    padding-left: 0.4em;
    padding-right: 0.4em;
    font-size: 0.92em;
  }
}

/* ===============================
   Client Log Widgets (Home)
   3 columns, 10 rows each, no internal scrolling
   =============================== */

#clientlog-widgets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  /* Slightly tighter padding so the Client Log never forces page scroll */
  padding: 6px 10px 6px 10px;
  min-width: 0;
}



/* ===== Widget sizing tweaks (match Quick Search width + fill vertical space) ===== */
/* Make widget row use more of the Client Log panel height */
#clientlog-widgets {
  align-content: stretch;
}

/* Give the 3 widgets a consistent taller height so they sit closer to the bottom divider */
#clientlog-recent-widget,
#clientlog-added-widget,
#clientlog-utilizers-widget {
  height: clamp(210px, 32vh, 320px);
}

/* Make widget internals flexible so lists can scroll within the fixed widget height */
.clientlog-widget {
  display: flex;
  flex-direction: column;
}

.clientlog-widget-title {
  flex: 0 0 auto;
}

.clientlog-widget-list {
  flex: 1 1 auto;
  overflow: auto;
  padding-right: 2px; /* tiny breathing room for scrollbar */
}

/* Keep the Quick Search widget compact (even if its position changes) */
#clientlog-quicksearch-widget {
  height: 72px;
}

/* Slightly reduce bottom padding inside the widget grid so there isn't a big gap above the divider */
#clientlog-widgets {
  padding-bottom: 4px;
}
.clientlog-widget {
  background: #f7fafd;
  border: 1px solid #ccd6e6;
  border-radius: 10px;
  padding: 9px 10px 7px 10px;
  min-width: 0;
  overflow: hidden; /* prevent scrollbars */
}

.clientlog-widget-title {
  font-weight: 700;
  font-size: 14px;
  color: #22294f;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clientlog-widget-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.clientlog-widget-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 6px;
  border-radius: 8px;
}

.clientlog-widget-list li:hover {
  background: rgba(166, 193, 238, 0.25);
}

.clientlog-client-link {
  color: #223;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  line-height: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.clientlog-client-meta {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
  flex: 0 0 auto;
}

/* Responsive: stack to 1 column on narrow screens */
@media (max-width: 1100px) {
  #clientlog-widgets { grid-template-columns: 1fr; }
}


/* ===============================
   Client Log Quick Search (Home)
   Full-width widget under the 3 widgets
   =============================== */

.clientlog-widget-wide {
  grid-column: 1 / -1; /* span full width of the widget grid */
  /* Make this widget a fixed height so searching never changes layout */
  height: 72px;
  padding-bottom: 0px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.clientlog-quicksearch-header {
  display: flex;
  align-items: center;
  justify-content: center; /* center the search box */
  gap: 12px;
  margin-bottom: 6px;
}

.clientlog-quicksearch-inputwrap {
  flex: 1;
  display: flex;
  justify-content: center;
}

#clientlog-quicksearch-input {
  width: min(520px, 100%);
  padding: 9px 10px;
  border: 1px solid #ccd6e6;
  border-radius: 10px;
  background: #ffffff;
  font-size: 13px;
  outline: none;
  text-align: center;
}

#clientlog-quicksearch-input::placeholder {
  color: #9aa3af;
  text-align: center;
}

/* Left-align once user starts typing (JS toggles .has-value) */
#clientlog-quicksearch-input.has-value,
#clientlog-quicksearch-input:focus {
  border-color: #7aa7ff;
  box-shadow: 0 0 0 3px rgba(122, 167, 255, 0.20);
  text-align: left;
}

#clientlog-quicksearch-input.has-value {
  text-align: left;
}

.clientlog-quicksearch-results {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  /* Reserve space even before searching so the widget never grows */
  height: 30px;
  overflow: hidden;
}

.clientlog-quicksearch-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 10px;
  border: 1px solid #ccd6e6;
  border-radius: 10px;
  background: #ffffff;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  color: #223;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  font-size: 12px;
  flex: 1 1 0;
  min-width: 0;
}


.clientlog-quicksearch-pill:hover {
  background: rgba(166, 193, 238, 0.20);
}

.clientlog-quicksearch-sub {
  font-weight: 500;
  color: #6b7280;
  font-size: 12px;
}

.clientlog-quicksearch-empty {
  font-size: 12px;
  color: #6b7280;
}

@media (max-width: 1100px) {
  #clientlog-quicksearch-input { width: 100%; }
  .clientlog-quicksearch-inputwrap { justify-content: flex-start; }
  .clientlog-quicksearch-header { align-items: flex-start; flex-direction: column; }
}


.clientlog-quicksearch-ellipsis {
  flex: 0 0 auto;
  font-size: 18px;
  line-height: 1;
  color: #6b7280;
  padding: 0 4px;
  user-select: none;
}
