/*
 * AI Productivity Prompts Plugin Styles
 * UI Kit provides base element styles (body, headings, buttons, inputs, etc.)
 * Only plugin-specific layout and component rules here.
 */

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: var(--s2);
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--s2);
}

.header h1 {
  margin: 0;
}

.main {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.intro {
  text-align: center;
  margin-bottom: var(--s3);
}

/* Category Grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--s2);
  margin-top: var(--s3);
}

.category-card p {
  margin: 0;
}

/* Custom prompts card styling */
.custom-prompts-card {
  border-left: 4px solid var(--c-accent);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--c-accent) 10%, transparent),
    color-mix(in srgb, var(--c-accent) 5%, transparent)
  );
}

.custom-prompts-card:hover {
  border-color: var(--c-accent);
  transform: translateY(-3px);
}

/* Category View */
.category-container {
  max-width: 800px;
  margin: 0 auto;
}

.selected-category {
  padding: var(--s2) 0;
  text-align: center;
  border-bottom: 1px solid var(--divider-color);
  margin-bottom: var(--s3);
}

.selected-category h2 {
  margin: 0;
}

/* Prompt List */
.prompt-list {
  display: flex;
  flex-direction: column;
  gap: var(--s);
}

.prompt-item {
  padding: var(--s2);
  cursor: pointer;
}

.prompt-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--whiteframe-shadow-4dp);
  border-color: var(--c-primary);
}

.prompt-title {
  margin: 0;
  font-weight: 600;
}

/* Prompt View */
.prompt-container {
  max-width: 800px;
  margin: 0 auto;
}

.selected-prompt-header {
  padding: var(--s2) 0;
  text-align: center;
}

.selected-prompt-header h2 {
  margin: 0 0 var(--s) 0;
}

.selected-prompt-header p {
  margin: 0;
}

.generated-prompt {
  padding: var(--s3);
}

.generated-prompt h3 {
  color: var(--c-primary);
}

.prompt-options {
  margin-bottom: var(--s3);
  padding: var(--s2);
  background: var(--bg-darker);
  border-radius: var(--card-border-radius);
  border: 1px solid var(--divider-color);
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.dropdown-label {
  display: flex;
  align-items: center;
  gap: var(--s);
  font-size: 0.9em;
  flex-wrap: wrap;
  width: 100%;
}

.task-dropdown {
  width: 100%;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.task-preview {
  margin-top: var(--s);
}

.task-count-info {
  font-size: 0.85em;
  color: var(--c-primary);
  font-weight: 500;
}

.task-count-info.tooltip {
  cursor: help;
  border-bottom: 1px dotted var(--c-primary);
}

.task-count-info.tooltip:hover {
  color: var(--c-accent);
}

.task-preview-content {
  width: 100%;
}

.task-count-header {
  font-size: 0.85em;
  color: var(--c-primary);
  font-weight: 600;
  margin-bottom: var(--s);
}

.task-preview-list {
  margin-left: var(--s);
}

.task-preview-item {
  font-size: 0.8em;
  margin-bottom: var(--s-quarter);
  line-height: 1.3;
  word-break: break-word;
}

.task-preview-more {
  font-size: 0.75em;
  color: var(--text-color-muted);
  font-style: italic;
  margin-top: var(--s-quarter);
}

.prompt-text {
  width: 100%;
  min-height: 300px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', monospace;
  font-size: 0.9em;
  line-height: 1.5;
  resize: vertical;
}

.prompt-actions {
  margin-top: var(--s2);
  display: flex;
  gap: var(--s);
  justify-content: center;
  flex-wrap: wrap;
}

/* ChatGPT button — distinct brand color */
.chatgpt-button {
  background: #10a37f;
  color: white;
  border-color: #10a37f;
}

.chatgpt-button:hover {
  background: #0d8c6b;
  border-color: #0d8c6b;
}

/* Custom prompt specific styles */
.empty-state {
  text-align: center;
  padding: var(--s3);
  background: var(--card-bg);
  border-radius: var(--card-border-radius);
  border: 2px dashed var(--divider-color);
}

.loading-container {
  text-align: center;
  padding: var(--s3);
}

.custom-prompts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--s3);
  flex-wrap: wrap;
  gap: var(--s2);
}

.custom-prompts-list {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.custom-prompt-card {
  border-left: 4px solid var(--c-primary);
}

.custom-prompt-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--s2);
}

.prompt-card-actions {
  display: flex;
  justify-content: flex-end;
}

.prompt-preview {
  margin-bottom: var(--s2);
  line-height: 1.5;
}

/* Editor styles */
.editor-header {
  margin-bottom: var(--s3);
}

.editor-container {
  max-width: 800px;
}

.editor-instructions {
  background: var(--card-bg);
  padding: var(--s2);
  border-radius: var(--card-border-radius);
  margin-bottom: var(--s3);
  border-left: 4px solid var(--c-primary);
}

.editor-instructions p {
  margin: 0 0 var(--s) 0;
}

.editor-instructions p:last-child {
  margin-bottom: 0;
}

.editor-field {
  margin-bottom: var(--s3);
}

.field-label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--s);
}

.prompt-title-input {
  width: 100%;
  font-weight: 500;
  border-width: 2px;
}

.prompt-textarea {
  width: 100%;
  min-height: 300px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', monospace;
  font-size: 0.9em;
  line-height: 1.5;
  resize: vertical;
  border-width: 2px;
}

.editor-actions {
  display: flex;
  gap: var(--s2);
  justify-content: flex-end;
  padding-top: var(--s2);
  border-top: 1px solid var(--divider-color);
}
