/* Page-specific styles */

/* Page Header */
.page-header {
  padding: 24px 32px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-header h1 {
  font-size: 28px;
  font-weight: 600;
}

.page-header .page-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--input-bg);
  min-width: 200px;
}

.page-search input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: var(--text-primary);
  width: 100%;
}

.page-search svg { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }

.page-body {
  padding: 0 32px 32px;
  flex: 1;
}

/* Library Page */
.library-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
}

.library-tab {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 14px;
  color: var(--text-secondary);
  transition: background var(--transition);
}

.library-tab:hover { background: var(--bg-hover); }
.library-tab.active { background: var(--bg-active); color: var(--text-primary); font-weight: 500; }

.library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.library-view-toggle {
  display: flex;
  gap: 4px;
}

.library-view-toggle button {
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

.library-view-toggle button:hover,
.library-view-toggle button.active { background: var(--bg-hover); color: var(--text-primary); }

.library-view-toggle button svg { width: 18px; height: 18px; }

.library-table-header {
  display: grid;
  grid-template-columns: 1fr 120px 100px;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}

.library-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 64px 32px;
  text-align: center;
  margin-top: 16px;
  transition: border-color var(--transition), background var(--transition);
}

.library-upload-area:hover {
  border-color: var(--text-muted);
  background: var(--bg-secondary);
}

.library-upload-area svg {
  width: 32px;
  height: 32px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.library-upload-area p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.btn-upload {
  padding: 8px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 14px;
  background: var(--bg-primary);
}

.btn-upload:hover { background: var(--bg-hover); }

.library-file-list { margin-top: 16px; }

.library-file-item {
  display: grid;
  grid-template-columns: 1fr 120px 100px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  align-items: center;
  font-size: 14px;
  transition: background var(--transition);
}

.library-file-item:hover { background: var(--bg-hover); }

.library-file-name {
  display: flex;
  align-items: center;
  gap: 10px;
}

.library-file-name svg { width: 18px; height: 18px; color: var(--text-muted); }

/* Plugins Page */
.plugin-section { margin-bottom: 32px; }

.plugin-section h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

.plugin-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.plugin-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: background var(--transition), border-color var(--transition);
}

.plugin-card:hover { background: var(--bg-hover); }

.plugin-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.plugin-info { flex: 1; min-width: 0; }
.plugin-info h4 { font-size: 14px; font-weight: 500; margin-bottom: 2px; }
.plugin-info p { font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.plugin-add-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}

.plugin-add-btn:hover { background: var(--bg-active); }
.plugin-add-btn.connected { background: var(--accent); color: white; border-color: var(--accent); }
.plugin-add-btn svg { width: 16px; height: 16px; }

.plugin-more-card {
  grid-column: 1 / -1;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background var(--transition);
}

.plugin-more-card:hover { background: var(--bg-hover); }

.plugin-more-icons {
  display: flex;
  gap: -4px;
}

.plugin-more-icons span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 2px solid var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  margin-left: -8px;
}

.plugin-more-icons span:first-child { margin-left: 0; }

/* Projects Page */
.projects-empty {
  text-align: center;
  padding: 64px 32px;
}

.projects-empty h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.projects-empty p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.5;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.project-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition);
}

.project-card:hover {
  background: var(--bg-hover);
  box-shadow: var(--shadow-sm);
}

.project-card h4 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.project-card p { font-size: 13px; color: var(--text-secondary); }

/* Images Page */
.images-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
  width: 100%;
}

.images-input-area {
  margin-bottom: 32px;
}

.images-section h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.images-carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.image-prompt-card {
  min-width: 160px;
  height: 200px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform var(--transition);
}

.image-prompt-card:hover { transform: scale(1.02); }

.image-prompt-card .card-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-prompt-card .card-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: white;
  font-size: 13px;
  font-weight: 500;
}

.image-prompt-card .card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}

.image-result {
  margin-top: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
}

.image-result img {
  max-width: 100%;
  border-radius: var(--radius-md);
}

/* Codex Page */
.codex-page {
  min-height: 100%;
  background: linear-gradient(135deg, #e8f4fd 0%, #f0e6ff 50%, #fdf2f8 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  text-align: center;
}

[data-theme="dark"] .codex-page {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.codex-logo {
  width: 80px;
  height: 80px;
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.codex-logo img { width: 48px; height: 48px; }

.codex-page h1 {
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 12px;
}

.codex-page p {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 500px;
}

.codex-btn {
  padding: 12px 32px;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border-radius: var(--radius-full);
  font-size: 16px;
  font-weight: 500;
}

.codex-trusted {
  margin-top: 64px;
}

.codex-trusted p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.codex-logos {
  display: flex;
  gap: 32px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-secondary);
  opacity: 0.6;
}

/* Shop Page */
.shop-page { padding: 24px 32px; }

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.shop-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--transition);
}

.shop-card:hover { box-shadow: var(--shadow-md); }

.shop-card-image {
  height: 160px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}

.shop-card-body { padding: 16px; }
.shop-card-body h4 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.shop-card-body p { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.shop-card-body .price { font-size: 16px; font-weight: 600; }

/* Help / Document Pages */
.doc-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.doc-page h1 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 8px;
}

.doc-page .doc-date {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.doc-page h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 24px 0 12px;
}

.doc-page p, .doc-page li {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.doc-page ul { padding-left: 24px; }

/* Help Center */
.help-search-box {
  width: 100%;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 16px;
  background: var(--input-bg);
  color: var(--text-primary);
  outline: none;
  margin-bottom: 32px;
}

.help-categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.help-category {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition);
}

.help-category:hover { background: var(--bg-hover); }
.help-category h4 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.help-category p { font-size: 13px; color: var(--text-secondary); }

/* Download Page */
.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.download-card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: background var(--transition);
}

.download-card:hover { background: var(--bg-hover); }
.download-card svg { width: 40px; height: 40px; margin-bottom: 12px; color: var(--text-secondary); }
.download-card h4 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.download-card button {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 13px;
  margin-top: 8px;
}

/* Keyboard Shortcuts */
.shortcuts-list { margin-top: 16px; }

.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
}

.shortcut-keys {
  display: flex;
  gap: 4px;
}

.shortcut-keys kbd {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  background: var(--bg-secondary);
  font-family: inherit;
}

/* Release Notes */
.release-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.release-item h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.release-item .release-date {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.release-item ul {
  padding-left: 20px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Codex Workspace (logged in) */
.codex-workspace {
  display: grid;
  grid-template-columns: 220px 1fr 320px;
  height: calc(100vh - var(--header-height));
  gap: 0;
}

.codex-files {
  border-right: 1px solid var(--border);
  padding: 16px;
  overflow-y: auto;
}

.codex-editor {
  display: flex;
  flex-direction: column;
}

.codex-editor-toolbar {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
}

.codex-editor-toolbar button {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.codex-editor-area {
  flex: 1;
  padding: 16px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 14px;
  line-height: 1.6;
  background: var(--bg-secondary);
  border: none;
  outline: none;
  resize: none;
  color: var(--text-primary);
}

.codex-chat {
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.codex-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.codex-chat-input {
  padding: 12px;
  border-top: 1px solid var(--border);
}

.codex-chat-input textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--input-bg);
  color: var(--text-primary);
  resize: none;
  outline: none;
  font-size: 13px;
}

@media (max-width: 900px) {
  .plugin-grid { grid-template-columns: 1fr; }
  .codex-workspace { grid-template-columns: 1fr; }
  .codex-files, .codex-chat { display: none; }
}

@media (max-width: 768px) {
  .page-header, .page-body { padding-left: 16px; padding-right: 16px; }
}
