/* journal-overview.css */

.journal-overview-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  background-color: #f8f9fa;
}

/* Journal Header Top */
.journal-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.journal-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.month-nav-btn {
  background: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.2s;
}

.month-nav-btn:hover {
  background: #0056b3;
}

.month-nav-btn:disabled {
  background: #6c757d;
  cursor: not-allowed;
}

.current-month {
  font-size: 1rem;
  font-weight: 500;
  color: #495057;
  min-width: 100px;
  text-align: center;
}

/* Main Content */
.journal-main-content {
  display: flex;
  flex: 1;
  gap: 1rem;
  padding: 1rem;
  overflow: hidden;
}

/* Left Column */
.journal-left-column {
  flex: 1;
  min-width: 0; /* Allow flex item to shrink below content size */
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.journal-entries-header {
  padding: 0.5rem;
  border-bottom: 1px solid #e9ecef;
  background: #f8f9fa;
}

.journal-entries-header h2 {
  margin: 0 0 0.5rem 0;
  color: #2c3e50;
  font-size: 1.1rem;
  font-weight: 500;
}

.journal-entries-labels {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 0;
  border-bottom: 1px solid #e9ecef;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.journal-label-date {
  width: 45px;
  text-align: center;
}

.journal-label-keep {
  flex: 1;
  color: #28a745;
}

.journal-label-problem {
  flex: 1;
  color: #dc3545;
}

.journal-label-try {
  flex: 1;
  color: #007bff;
}

.journal-entries-list {
  flex: 1;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: visible;
  min-height: 0; /* Allow flex item to shrink */
}

/* Journal Entry Item */
.journal-entry-item {
  display: flex;
  border-bottom: 1px solid #e9ecef;
  transition: background-color 0.2s;
  cursor: pointer;
  min-height: 1.8rem;
  align-items: center;
}

.journal-entry-item:hover {
  background-color: #f8f9fa;
}

.journal-entry-item:last-child {
  border-bottom: none;
}

.journal-entry-date {
  width: 45px;
  padding: 0.3rem 0.2rem;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #495057;
  border-right: 1px solid #e9ecef;
  font-size: 0.9rem;
  min-height: 1.22rem;
  flex-shrink: 0; /* Prevent date column from shrinking */
}

.journal-entry-content {
  /* width: 600px; */
  width: 100%;
  padding: 0.3rem 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0; /* Prevent content area from shrinking */
}

.journal-entry-summary {
  display: flex;
  gap: 0.2rem;
  flex: 1;
  overflow: hidden; /* Prevent content from overflowing */
}

.journal-entry-summary-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  width: 30.333%;
  overflow: hidden; /* Prevent content from overflowing to other columns */
}

.journal-entry-summary-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0; /* Prevent dot from shrinking */
}

.journal-entry-summary-dot.keep {
  background-color: #28a745;
}

.journal-entry-summary-dot.problem {
  background-color: #dc3545;
}

.journal-entry-summary-dot.try {
  background-color: #007bff;
}

.journal-entry-summary-dot.empty {
  background-color: #e9ecef;
}

.journal-entry-summary-text {
  font-size: 0.75rem;
  color: #6c757d;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1; /* Take remaining space after dot */
  min-width: 0; /* Allow text to shrink */
}

.journal-entry-summary-text.empty {
  color: #adb5bd;
  font-style: italic;
}

/* Empty state */
.journal-empty-message {
  padding: 2rem;
  text-align: center;
  color: #6c757d;
  font-style: italic;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Right Column */
.journal-right-column {
  flex: 1;
  min-width: 0; /* Allow flex item to shrink below content size */
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.journal-placeholder {
  text-align: center;
  color: #6c757d;
}

.journal-placeholder h3 {
  margin-bottom: 0.5rem;
  color: #495057;
}

.journal-placeholder p {
  margin: 0;
  font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .journal-main-content {
    flex-direction: column;
  }

  .journal-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .journal-entry-item {
    flex-direction: column;
  }

  .journal-entry-date {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #e9ecef;
  }
}

/* Modal Styles */
.journal-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.journal-modal-content {
  background: white;
  border-radius: 8px;
  padding: 2rem;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.journal-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e9ecef;
}

.journal-modal-title {
  margin: 0;
  color: #2c3e50;
  font-size: 1.5rem;
  font-weight: 600;
}

.journal-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #6c757d;
  padding: 0.25rem;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.journal-modal-close:hover {
  background-color: #f8f9fa;
  color: #495057;
}

.journal-modal-sections {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.journal-modal-section {
  border-radius: 6px;
  padding: 1rem;
  border-left: 4px solid;
}

.journal-modal-section.keep {
  background-color: #f8fff9;
  border-left-color: #28a745;
}

.journal-modal-section.problem {
  background-color: #fff8f8;
  border-left-color: #dc3545;
}

.journal-modal-section.try {
  background-color: #f8fbff;
  border-left-color: #007bff;
}

.journal-modal-section-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.journal-modal-section.keep .journal-modal-section-title {
  color: #28a745;
}

.journal-modal-section.problem .journal-modal-section-title {
  color: #dc3545;
}

.journal-modal-section.try .journal-modal-section-title {
  color: #007bff;
}

.journal-modal-section-text {
  color: #495057;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.journal-modal-section-text.empty {
  color: #adb5bd;
  font-style: italic;
}

.journal-modal-section-textarea {
  width: 100%;
  min-height: 100px;
  padding: 0.75rem;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #495057;
  background-color: #fff;
  resize: vertical;
  box-sizing: border-box;
}

.journal-modal-section-textarea:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.journal-modal-save {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  margin-top: 1rem;
  transition: background-color 0.2s;
}

.journal-modal-save:hover {
  background-color: #0056b3;
}

.journal-modal-save:active {
  background-color: #004085;
}

/* Responsive Design */
@media (max-width: 768px) {
  .journal-main-content {
    flex-direction: column;
    padding: 0.5rem;
  }

  .journal-header-top {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .journal-entry-item {
    flex-direction: column;
    align-items: stretch;
  }

  .journal-entry-date {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #e9ecef;
  }

  .journal-modal-content {
    width: 95%;
    padding: 1.5rem;
  }
}

/* Activity Grid Styles */
.journal-activity-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #fff;
  overflow: hidden;
}

.journal-activity-grid {
  flex: 1;
  overflow: auto;
  padding: 1rem;
  padding-top: 3.5rem;
}

.activity-grid-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.activity-grid-table th,
.activity-grid-table td {
  padding: 0.365rem 0.2rem;
  text-align: center;
  border: 1px solid #e9ecef;
  min-height: 1.22rem;
}

.activity-grid-table th {
  background-color: #f8f9fa;
  font-weight: 600;
  color: #495057;
  position: sticky;
  top: 0;
  z-index: 10;
}

.activity-grid-date {
  background-color: #f8f9fa;
  font-weight: 600;
  color: #495057;
  width: 45px;
  min-width: 45px;
}

.activity-grid-cell {
  background-color: #fff;
  transition: background-color 0.2s;
  min-height: 1.22rem;
}

.activity-grid-cell.has-activity {
  background-color: #e3f2fd;
  color: #1976d2;
  font-weight: 600;
}

.activity-grid-cell.has-activity::after {
  content: "✕";
  font-size: 0.8rem;
}

.activity-grid-label {
  background-color: #f8f9fa;
  font-weight: 600;
  color: #495057;
  min-width: 60px;
  max-width: 60px;
  min-height: 1.22rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
