/* Global Resets & Fonts */
html, body {
  margin:0;
  padding:0;
  font-family:Arial, sans-serif;
  background:#f5f7fa;
  color:#333;
}

a {
  text-decoration:none;
  color:inherit;
}

ul, li {
  margin:0;
  padding:0;
  list-style:none;
}

h1, h2, h3, h4 {
  margin:0;
  font-weight:600;
}

p {
  margin:0; /* Remove default paragraph margin */
}


.hidden { display:none; }

/* Layout */
.app {
  display:flex;
  min-height:100vh;
}

/* Sidebar */
.sidebar {
  width:220px;
  background:#4a90e2;
  color:#fff;
  display:flex;
  flex-direction:column;
}
.sidebar__header {
  padding:20px;
}
.sidebar__logo {
  max-width:100%;
  height:auto;
}
.sidebar__nav {
  flex:1;
}
.nav__list { margin-top:10px; }
.nav__link {
  display:block;
  padding:15px 20px;
  color:#fff;
  opacity:0.9;
  font-size:14px;
  transition:background 0.3s,opacity 0.3s;
}
.nav__link:hover,
.nav__link--active {
  background:rgba(255,255,255,0.2);
  opacity:1;
}

/* Main Content */
.main-content {
  flex:1;
  display:flex;
  flex-direction:column;
  overflow-y:auto;
}

/* Header */
.main-header {
  background:#fff;
  padding:20px;
  border-bottom:1px solid #ddd;
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.main-header__title {
  font-size:20px;
}
.main-header__actions {
  display:flex;
  align-items:center;
}

/* Buttons */
.btn {
  background:#4a90e2;
  color:#fff;
  border:none;
  padding:6px 10px;
  font-size:14px;
  cursor:pointer;
  border-radius:4px;
  margin:0;
}
.btn:hover {
  background:#3f7fc4;
}
.btn--small {
  padding:4px 8px;
  font-size:12px;
}
.btn--primary {
  background:#4a90e2;
}

/* Additional Button Classes for Conversations Consistency */
.btn--intervene {
  background:#f0ad4e;
}
.btn--intervene:hover {
  background:#ec9a2f;
}

.btn--details {
  background:#5bc0de;
}
.btn--details:hover {
  background:#48afc9;
}

/* Search Bar */
.search-bar {
  display:flex;
  gap:10px;
  align-items:center;
}
.search-bar__input {
  padding:6px;
  border:1px solid #ccc;
  border-radius:4px;
  flex:1;
}
.search-bar__button {
  background:#4a90e2; color:#fff;
  border:none; border-radius:4px;
  padding:6px 10px;
  cursor:pointer;
}
.search-bar__button:hover {
  background:#3f7fc4;
}

/* Dashboard Layout */
.dashboard-insights {
  display:flex;
  flex-wrap:wrap;
  gap:20px;
  padding:20px;
}
.dashboard-insights__card {
  background:#fff;
  border-radius:6px;
  padding:20px;
  flex:1 1 200px;
  box-shadow:0 1px 3px rgba(0,0,0,0.1);
}
.dashboard-insights__card h2 {
  font-size:16px;
  margin-bottom:10px;
}
.dashboard-suggestions {
  background:#fff;
  margin:0 20px 20px 20px;
  padding:20px;
  border-radius:6px;
  box-shadow:0 1px 3px rgba(0,0,0,0.1);
}
.dashboard-suggestions h2 {
  font-size:16px;
  margin-bottom:10px;
}
.dashboard-suggestions ul li {
  font-size:14px; margin-bottom:5px;
}

/* Sections */
section.conversations, section.appointments {
  background:#fff;
  margin:20px;
  padding:20px;
  border-radius:6px;
  box-shadow:0 1px 3px rgba(0,0,0,0.1);
}
section.conversations h2, section.appointments h2 {
  font-size:16px; margin-bottom:20px;
}

/* Conversations List (Global) */
.conversations__list .conversation-item {
  padding:15px 0;
  border-bottom:1px solid #eee;
}
.conversations__list .conversation-item:last-child {
  border-bottom:none;
}
.conversation-item__client {
  font-size:14px;
  margin-bottom:5px;
  font-weight:bold;
}
.conversation-item__preview {
  font-size:14px;
  color:#666;
  margin-bottom:5px;
}
.conversation-item__time {
  font-size:12px; color:#999;
}

/* Chat Interface */
.chat-interface {
  position:fixed; right:20px; bottom:20px;
  width:300px; max-width:90%;
  background:#fff; border-radius:6px;
  box-shadow:0 1px 3px rgba(0,0,0,0.1);
  border:1px solid #ddd; display:flex;
  flex-direction:column; transition:height 0.3s;
  z-index:9999;
}
.chat-header {
  background:#4a90e2; color:#fff; padding:10px; font-size:14px;
  display:flex; justify-content:space-between; align-items:center;
}
.chat-header__actions { display:flex; align-items:center; }
.chat-toggle-btn {
  background:none; border:none; color:#fff;
  cursor:pointer; font-size:16px;
}
.chat-toggle-btn:focus { outline:none; }
.chat-body {
  display:flex; flex-direction:column; height:400px;
}
.chat-messages {
  flex:1; padding:10px; overflow-y:auto;
}
.chat-message { display:flex; margin-bottom:10px; }
.chat-message__avatar {
  width:30px; height:30px; background:#ccc; border-radius:50%; margin-right:10px; flex-shrink:0;
}
.chat-message__avatar img {
  width:100%; height:100%; border-radius:50%; object-fit:cover;
}
.chat-message__content {
  background:#f0f0f0; padding:10px; border-radius:6px; max-width:80%; font-size:14px;
}
.chat-message--user .chat-message__content {
  background:#d9fdd3;
}
.chat-input {
  border-top:1px solid #ddd; display:flex; padding:10px; gap:10px;
}
.chat-input__field {
  flex:1; padding:6px; border:1px solid #ccc; border-radius:4px;
}
.chat-input__send {
  background:#4a90e2; color:#fff; border:none;
  padding:6px 10px; border-radius:4px; cursor:pointer;
}
.chat-interface.minimized .chat-body { display:none; }

/* Conversations Page Specific */
.dashboard-view[data-section="conversations"] .conv-section-container {
  background:#fff; border-radius:6px; padding:20px; box-shadow:0 1px 3px rgba(0,0,0,0.1); margin-bottom:20px;
}

.dashboard-view[data-section="conversations"] .conversations__tabs {
  margin-bottom:20px;
}

.dashboard-view[data-section="conversations"] .tabs__list {
  display:flex; gap:20px; border-bottom:1px solid #ddd;
}

.dashboard-view[data-section="conversations"] .tabs__button {
  background:none; border:none; padding:10px 0;
  cursor:pointer; font-size:14px; border-bottom:2px solid transparent; color:#333;
}

.dashboard-view[data-section="conversations"] .tabs__button--active {
  border-bottom:2px solid #4a90e2; font-weight:bold;
}

.dashboard-view[data-section="conversations"] .conversation-item {
  /* conversation-item styling for conversations page
     is already handled globally by .conversations__list .conversation-item */
}

.dashboard-view[data-section="conversations"] .history-filters {
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:20px;
}
.dashboard-view[data-section="conversations"] .history-filters input[type="text"] {
  padding:6px; border:1px solid #ccc; border-radius:4px;
}
/* ===== Appointments Page Specific ===== */

/* Calendar View Layout */
.appointments__calendar-view {
  margin-top:20px;
}

.calendar-view-controls {
  display:flex;
  gap:10px;
}

/* Calendar view mode buttons can reuse .btn, .btn--small already defined.
   We'll rely on .btn--small and just toggle a visual "active" state: */
.calendar-view-btn--active {
  background:#3f7fc4; /* Slightly darker to indicate active state */
}

/* Calendar Container */
.calendar-container {
  margin-top:20px; /* spacing above calendar */
}

/* Monthly Calendar Grid */
.calendar-monthly-grid {
  display:flex;
  flex-direction:column;
  gap:5px;
}

.calendar-row {
  display:grid;
  grid-template-columns: repeat(7, 1fr);
  gap:5px;
}

.calendar-row--header {
  font-weight:bold;
}

.calendar-cell {
  background:#fafafa;
  padding:10px;
  border-radius:4px;
  min-height:80px;
  position:relative;
}

.calendar-cell--header {
  background:#e9ecef;
}

.calendar-date {
  font-size:14px;
  font-weight:bold;
  margin-bottom:5px;
  display:block;
}

.calendar-appointment-indicator {
  background:#5bc0de;
  color:#fff;
  font-size:12px;
  border-radius:4px;
  padding:2px 4px;
  margin-top:5px;
}

/* Appointment details panel */
.appointment-details-panel {
  /* Already styled similarly to other panels */
}

/* Bookings View */
.appointments__bookings-view {
  margin-top:20px;
}

/* We can reuse .tabs__list, .tabs__item, .tabs__button for the
   Today/This Week/Custom Range sub-tabs without adding duplicates. */

/* Tables in bookings views reuse existing table styles, just ensure
   consistent padding and borders. */
.bookings-table table th,
.bookings-table table td {
  border-bottom:1px solid #ddd;
  padding:10px;
  font-size:14px;
}

/* Slight differentiation for table header */
.bookings-table table th {
  background:#f0f0f0;
  font-weight:bold;
}

/* Custom range filters aligned with existing .history-filters */
.bookings-table .history-filters input,
.bookings-table .history-filters select {
  font-size:14px;
  padding:4px 6px;
  border:1px solid #ccc;
  border-radius:4px;
}

/* We already have .hidden class, no duplication needed */
/* Modal Styles */
.edit-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.edit-modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.edit-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.edit-modal-header h2 {
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    color: #666;
}

.close-modal:hover {
    color: #333;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}
