/* Remove: body { background-color: #f8f9fa; } since it's now handled by themes */

#auth-container button {
  cursor: pointer;
}

/* Scrollable textarea styling */
.scrollable-textarea {
  max-height: 300px;
  overflow-y: auto;
}

#story-content p {
  white-space: pre-wrap;
  margin-bottom: 1rem;
}

/* Debug mode styles */
.debug-content {
  background-color: rgba(255, 193, 7, 0.1);
  border-left: 4px solid #ffc107;
  padding: 0.5rem;
  margin: 0.5rem 0;
  font-style: italic;
  color: #666;
}

[data-bs-theme='dark'] .debug-content {
  background-color: rgba(255, 193, 7, 0.2);
  color: #ccc;
}

/* Dice roll specific styling */
.debug-rolls {
  background-color: rgba(13, 202, 240, 0.1);
  border-left: 4px solid #0dcaf0;
  padding: 0.5rem;
  margin: 0.5rem 0;
  font-family: 'Courier New', monospace;
  font-weight: bold;
  color: #0c63e4;
}

[data-bs-theme='dark'] .debug-rolls {
  background-color: rgba(13, 202, 240, 0.2);
  color: #58d3f7;
}

/* Story entry container */
.story-entry {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

[data-bs-theme='dark'] .story-entry {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* Session header styling */
.session-header {
  background-color: #f0f0f0;
  padding: 10px;
  margin-bottom: 10px;
  font-family: monospace;
  white-space: pre-wrap;
  border-radius: 5px;
  font-size: 0.85rem;
  opacity: 0.9;
}

/* Planning block specific styling */
.planning-block {
  background-color: #e3f2fd;
  padding: 10px;
  margin-top: 10px;
  border-radius: 5px;
  white-space: pre-wrap;
  font-family: inherit;
}

/* Structured fields styling */
.dice-rolls {
  background-color: #e8f4e8;
  padding: 8px;
  margin: 10px 0;
  border-radius: 5px;
}

.dice-rolls ul {
  margin: 5px 0;
  padding-left: 20px;
}

.resources {
  background-color: #fff3cd;
  padding: 8px;
  margin: 10px 0;
  border-radius: 5px;
}

.debug-info {
  background-color: #f5f5f5;
  padding: 10px;
  margin-top: 10px;
  border-radius: 5px;
  font-size: 0.9em;
}

.debug-info pre {
  margin: 5px 0;
}

#debug-indicator {
  background-color: #f8e88e;
  color: #5a5a5a;
  padding: 0.4rem 0.8rem;
  border-radius: 0.25rem;
  font-weight: bold;
  font-size: 0.875rem;
  display: none;
  white-space: nowrap;
}

#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  display: none;
}

#loading-overlay .spinner-border {
  width: 3rem;
  height: 3rem;
  color: white;
}

/* View management */
#auth-view,
#dashboard-view,
#new-campaign-view,
#game-view,
#settings-view {
  display: none;
}

#auth-view.active-view,
#dashboard-view.active-view,
#new-campaign-view.active-view,
#settings-view.active-view {
  display: block;
  position: relative;
  z-index: 1100;
}

#game-view.active-view {
  display: flex;
  flex-direction: column;
  height: 85vh;
}

#story-content {
  flex-grow: 1;
  overflow-y: auto;
  min-height: 0;
  border: 1px solid;
  border-radius: 0.25rem;
  padding: 1rem;
}

#interaction-form textarea {
  resize: vertical;
}

/* Icon button styling */
#shareStoryBtn,
#downloadStoryBtn {
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
}

#shareStoryBtn i,
#downloadStoryBtn i {
  font-size: 1.1rem;
}

#downloadStoryBtn {
  background-color: #98fbcb !important;
  color: #222 !important; /* dark text for contrast */
  border: none;
}
#downloadStoryBtn:hover,
#downloadStoryBtn:focus {
  background-color: #7edbb2 !important; /* slightly darker mint for hover */
  color: #111 !important;
}

/* Theme-specific active menu item styling */
.dropdown-item.active {
  background-color: var(--accent-color);
  color: var(--text-on-accent);
}

/* Navbar brand link styling */
a.navbar-brand {
  color: inherit;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

a.navbar-brand:hover {
  opacity: 0.8;
  color: inherit;
}

/* ========== CAMPAIGN LIST STYLING ========== */

/* Ensure consistent campaign list layout between local and production */
.list-group-item .d-flex {
  flex-wrap: nowrap !important;
  align-items: center !important;
}

.list-group-item .d-flex > div:last-child {
  display: flex !important;
  align-items: center !important;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}

.list-group-item .edit-campaign-btn {
  margin-right: 0.5rem !important;
  flex-shrink: 0 !important;
}

.list-group-item .text-muted {
  font-size: 0.875rem !important;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}

/* Ensure campaign title doesn't overflow */
.list-group-item h5.mb-1 {
  flex: 1 1 auto !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  margin-right: 1rem !important;
}

/* ========== STRUCTURED FIELDS STYLING ========== */

/* Session Header - Gray background with monospace font */
.session-header {
  background-color: #f0f0f0;
  padding: 10px;
  margin-bottom: 10px;
  font-family: monospace;
  white-space: pre-wrap;
  border-radius: 5px;
}

/* God Mode Response - Purple border with emphasis */
.god-mode-response {
  background-color: #f8f4ff;
  padding: 10px;
  margin: 10px 0;
  border-radius: 5px;
  border-left: 4px solid #9c27b0;
}

.god-mode-response pre {
  margin: 10px 0 0 0;
  padding: 10px;
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  overflow-x: auto;
}

/* Entities Mentioned - Light blue background */
.entities-mentioned {
  background-color: #e7f3ff;
  padding: 10px;
  margin: 10px 0;
  border-radius: 5px;
  border-left: 4px solid #2196f3;
}

.entities-mentioned ul {
  margin: 5px 0 0 20px;
  padding: 0;
}

/* Location Confirmed - Alice blue background */
.location-confirmed {
  background-color: #f0f8ff;
  padding: 10px;
  margin: 10px 0;
  border-radius: 5px;
  border-left: 4px solid #4169e1;
}

/* Dice Rolls - Light green background */
.dice-rolls {
  background-color: #e8f4e8;
  padding: 10px;
  margin: 10px 0;
  border-radius: 5px;
  border-left: 4px solid #4caf50;
}

.dice-rolls ul {
  margin: 5px 0 0 20px;
  padding: 0;
}

/* Resources - Yellow background */
.resources {
  background-color: #fff3cd;
  padding: 10px;
  margin: 10px 0;
  border-radius: 5px;
  border-left: 4px solid #ffc107;
}

/* State Updates - Light gray background */
.state-updates {
  background-color: #f5f5f5;
  padding: 10px;
  margin: 10px 0;
  border-radius: 5px;
  border-left: 4px solid #9e9e9e;
}

.state-updates pre {
  margin: 5px 0 0 0;
  background-color: rgba(255, 255, 255, 0.5);
  padding: 8px;
  border-radius: 4px;
  font-size: 0.9em;
}

/* Planning Block - Light blue background */
.planning-block {
  background-color: #e3f2fd;
  padding: 15px;
  margin: 15px 0;
  border-radius: 5px;
  border-left: 4px solid #2196f3;
  white-space: pre-wrap;
}

/* Planning block choice buttons - simplified design */
.planning-block-choices {
  margin-top: 10px;
  margin-bottom: 0;
}

.choice-button {
  display: block;
  width: 100%;
  margin-bottom: 0.5rem;
  padding: 0.75rem;
  text-align: left;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: pre-wrap;
  font-family: inherit;
  color: #212529;
}

.choice-button:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

.choice-button:active {
  background: #dee2e6;
}

.planning-block-thinking {
  margin-bottom: 0.5rem;
  font-style: italic;
  opacity: 0.8;
}

/* Debug Info - Light gray with nested sections */
.debug-info {
  background-color: #f8f9fa;
  padding: 15px;
  margin: 10px 0;
  border-radius: 5px;
  border: 1px solid #dee2e6;
}

/* DM Notes - Light purple background */
.dm-notes {
  background-color: #f8f4ff;
  padding: 10px;
  margin: 10px 0;
  border-radius: 5px;
  border-left: 4px solid #9c27b0;
}

.dm-notes ul {
  margin: 5px 0 0 20px;
  padding: 0;
}

/* State Rationale - Light yellow background */
.state-rationale {
  background-color: #fff8e7;
  padding: 10px;
  margin: 10px 0;
  border-radius: 5px;
  border-left: 4px solid #ff9800;
}

/* Dark theme adjustments for structured fields */
[data-bs-theme='dark'] .session-header {
  background-color: #2a2a2a;
  color: #e0e0e0;
}

[data-bs-theme='dark'] .god-mode-response {
  background-color: rgba(156, 39, 176, 0.1);
  color: #e0e0e0;
}

[data-bs-theme='dark'] .entities-mentioned {
  background-color: rgba(33, 150, 243, 0.1);
  color: #e0e0e0;
}

[data-bs-theme='dark'] .location-confirmed {
  background-color: rgba(65, 105, 225, 0.1);
  color: #e0e0e0;
}

[data-bs-theme='dark'] .dice-rolls {
  background-color: rgba(76, 175, 80, 0.1);
  color: #e0e0e0;
}

[data-bs-theme='dark'] .resources {
  background-color: rgba(255, 193, 7, 0.1);
  color: #e0e0e0;
}

[data-bs-theme='dark'] .state-updates {
  background-color: rgba(158, 158, 158, 0.1);
  color: #e0e0e0;
}

[data-bs-theme='dark'] .planning-block {
  background-color: rgba(33, 150, 243, 0.1);
  color: #e0e0e0;
}

[data-bs-theme='dark'] .choice-button {
  background: #343a40;
  border-color: #495057;
  color: #e0e0e0;
}

[data-bs-theme='dark'] .choice-button:hover {
  background: #495057;
  border-color: #6c757d;
}

[data-bs-theme='dark'] .choice-button:active {
  background: #6c757d;
}

[data-bs-theme='dark'] .planning-block-thinking {
  color: #adb5bd;
}

[data-bs-theme='dark'] .debug-info {
  background-color: rgba(248, 249, 250, 0.05);
  border-color: #495057;
  color: #e0e0e0;
}

[data-bs-theme='dark'] .dm-notes {
  background-color: rgba(156, 39, 176, 0.1);
  color: #e0e0e0;
}

[data-bs-theme='dark'] .state-rationale {
  background-color: rgba(255, 152, 0, 0.1);
  color: #e0e0e0;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
}
