/* Auris Admin - CSS */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a25;
  --bg-input: #252530;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --accent: #d4af37;
  --accent-hover: #e5c349;
  --accent-dark: #b8972f;
  --border: #2a2a35;
  --success: #4ade80;
  --success-bg: rgba(74, 222, 128, 0.1);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --error: #ef4444;
  --error-bg: rgba(239, 68, 68, 0.1);
  --info: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.1);
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* Navigation */
.admin-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.admin-nav .logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1.125rem;
}

.admin-nav .logo-icon {
  font-size: 1.5rem;
}

.admin-nav .nav-links {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.admin-nav .nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  transition: all 0.2s;
}

.admin-nav .nav-links a:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.admin-nav .nav-links a.active {
  color: var(--accent);
  background: rgba(212, 175, 55, 0.1);
}

.admin-nav .logout-btn {
  color: var(--error) !important;
}

.admin-nav .logout-btn:hover {
  background: var(--error-bg) !important;
}

/* Main content */
main {
  padding: 1.5rem;
}

main.with-nav {
  padding-top: calc(60px + 1.5rem);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-primary);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-input);
  border-color: var(--accent);
}

.btn-success {
  background: var(--success);
  color: var(--bg-primary);
}

.btn-success:hover {
  background: #22c55e;
}

.btn-warning {
  background: var(--warning);
  color: var(--bg-primary);
}

.btn-danger {
  background: var(--error);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-small {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-block {
  width: 100%;
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-group.checkbox label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.9375rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group small {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Alerts */
.alert {
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.alert-error {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(74, 222, 128, 0.3);
}

/* Login Page */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
}

.login-container {
  width: 100%;
  max-width: 380px;
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-header .logo-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.login-header h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.login-header p {
  color: var(--text-secondary);
}

.login-form {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

/* Dashboard */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.dashboard-header h1 {
  font-size: 1.75rem;
}

.filter-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.filter-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  text-decoration: none;
  color: var(--text-secondary);
  border-radius: var(--radius);
  transition: all 0.2s;
}

.filter-tab:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.filter-tab.active {
  background: var(--accent);
  color: var(--bg-primary);
}

.filter-tab .count {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
}

.filter-tab.active .count {
  background: rgba(0, 0, 0, 0.2);
}

/* Articles List */
.articles-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.article-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s;
}

.article-row:hover {
  border-color: var(--accent);
}

.article-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.article-emoji {
  font-size: 1.5rem;
}

.article-details h3 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8125rem;
}

.status {
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
  text-transform: capitalize;
}

.status-draft {
  background: var(--bg-input);
  color: var(--text-secondary);
}

.status-scheduled {
  background: var(--info-bg);
  color: var(--info);
}

.status-published {
  background: var(--success-bg);
  color: var(--success);
}

.article-meta .category {
  color: var(--accent);
}

.article-meta .date {
  color: var(--text-muted);
}

.article-actions {
  display: flex;
  gap: 0.5rem;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-state h3 {
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* Regenerate section */
.regenerate-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.regenerate-section h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.regenerate-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Editor */
.editor-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  padding-bottom: 80px;
}

.editor-main {
  min-width: 0;
}

.editor-header {
  margin-bottom: 1rem;
}

.title-input {
  width: 100%;
  padding: 1rem;
  font-size: 1.75rem;
  font-weight: 700;
  background: transparent;
  border: none;
  color: var(--text-primary);
}

.title-input:focus {
  outline: none;
}

.title-input::placeholder {
  color: var(--text-muted);
}

/* Block toolbar */
.block-toolbar {
  display: flex;
  gap: 0.25rem;
  padding: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.block-toolbar button {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1rem;
}

.block-toolbar button:hover {
  background: var(--bg-input);
  color: var(--text-primary);
  border-color: var(--border);
}

/* Blocks container */
.blocks-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.block-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s;
}

.block-wrapper:hover {
  border-color: var(--accent);
}

.block-wrapper.dragging {
  opacity: 0.5;
}

.block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
}

.block-type {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
}

.block-actions {
  display: flex;
  gap: 0.25rem;
}

.block-actions button {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.875rem;
}

.block-actions button:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}

.block-content {
  padding: 0.75rem;
}

.block-content textarea,
.block-content input[type="text"] {
  width: 100%;
  padding: 0.5rem;
  font-size: 0.9375rem;
  background: var(--bg-input);
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text-primary);
  resize: vertical;
}

.block-content textarea:focus,
.block-content input:focus {
  outline: none;
  border-color: var(--accent);
}

.block-content .list-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.block-content .list-item {
  display: flex;
  gap: 0.5rem;
}

.block-content .list-item input {
  flex: 1;
}

.block-content .add-item-btn {
  margin-top: 0.5rem;
  font-size: 0.875rem;
}

/* Info/Warning box blocks */
.block-content .box-fields {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.block-content .box-fields input {
  font-weight: 600;
}

/* Table block */
.block-content .table-editor {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.block-content .table-row {
  display: flex;
  gap: 0.5rem;
}

.block-content .table-row input {
  flex: 1;
  min-width: 0;
}

.block-content .table-row.header input {
  font-weight: 600;
  background: var(--bg-secondary);
}

/* Sidebar */
.editor-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.sidebar-section h3 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.sidebar-section select[multiple] {
  height: auto;
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: capitalize;
}

.read-time-display {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent);
}

/* FAQ items in sidebar */
#faq-items-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.faq-item-editor {
  background: var(--bg-input);
  border-radius: var(--radius);
  padding: 0.75rem;
  position: relative;
}

.faq-item-editor input,
.faq-item-editor textarea {
  margin-bottom: 0.5rem;
}

.faq-item-editor .remove-faq {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
}

.faq-item-editor .remove-faq:hover {
  color: var(--error);
}

/* Editor footer */
.editor-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  z-index: 50;
}

.footer-left,
.footer-right {
  display: flex;
  gap: 0.5rem;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 200;
  padding: 2rem;
}

.modal.open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  width: 100%;
  max-width: 1000px;
  max-height: calc(100vh - 4rem);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.modal-content.modal-small {
  max-width: 500px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 1.125rem;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.5rem;
}

.modal-close:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
}

.modal-body .form-group {
  margin-bottom: 1rem;
}

.modal-body .form-group:last-of-type {
  margin-bottom: 0;
}

#preview-iframe {
  flex: 1;
  border: none;
  background: white;
}

/* Drop zone */
.drop-zone {
  padding: 3rem 2rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--accent);
  background: rgba(212, 175, 55, 0.05);
}

.drop-zone p {
  color: var(--text-secondary);
}

.upload-progress {
  text-align: center;
}

.upload-progress.hidden {
  display: none;
}

.progress-bar {
  height: 4px;
  background: var(--bg-input);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0;
  transition: width 0.3s;
}

/* Settings */
.settings-container {
  max-width: 600px;
  margin: 0 auto;
}

.settings-container h1 {
  margin-bottom: 2rem;
}

.settings-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.settings-section h2 {
  font-size: 1.125rem;
  margin-bottom: 1.25rem;
}

.settings-form {
  max-width: 400px;
}

.config-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.config-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.config-item label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.config-item code {
  padding: 0.5rem 0.75rem;
  background: var(--bg-input);
  border-radius: var(--radius);
  font-size: 0.8125rem;
  color: var(--text-muted);
  word-break: break-all;
}

.config-note {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Error page */
.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
}

.error-container {
  text-align: center;
}

.error-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.error-container h1 {
  margin-bottom: 0.5rem;
}

.error-message {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* Toast notifications */
.toast {
  position: fixed;
  bottom: 80px;
  right: 1.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s;
  z-index: 300;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  border-color: var(--success);
  color: var(--success);
}

.toast-error {
  border-color: var(--error);
  color: var(--error);
}

/* Cover image preview */
.cover-preview {
  width: 100%;
  height: 120px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cover-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-preview .no-cover {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

/* Quill Editor */
.quill-editor {
  background: var(--bg-input);
  border-radius: 8px;
}

.quill-editor .ql-editor {
  min-height: 150px;
  max-height: 400px;
  overflow-y: auto;
}

.html-block textarea {
  font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
  font-size: 0.8125rem;
  line-height: 1.5;
}

/* Responsive */
@media (max-width: 1024px) {
  .editor-layout {
    grid-template-columns: 1fr;
  }

  .editor-sidebar {
    order: -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  .admin-nav {
    flex-wrap: wrap;
    height: auto;
    padding: 0.75rem;
    gap: 0.5rem;
  }

  .admin-nav .nav-links {
    width: 100%;
    justify-content: center;
  }

  .article-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .article-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .filter-tabs {
    flex-wrap: wrap;
  }

  .editor-footer {
    flex-direction: column;
    height: auto;
    padding: 1rem;
    gap: 0.75rem;
  }

  .footer-left,
  .footer-right {
    width: 100%;
    justify-content: center;
  }
}

/* SEO Score Checker */
.seo-section {
  border: 1px solid rgba(212, 175, 55, 0.2);
}

.seo-score-display {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.seo-score-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: 4px solid var(--error);
  transition: border-color 0.3s;
}

.seo-score-circle.score-low {
  border-color: var(--error);
}

.seo-score-circle.score-medium {
  border-color: var(--warning);
}

.seo-score-circle.score-good {
  border-color: var(--success);
}

.seo-score-circle span {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.seo-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.seo-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--bg-secondary);
  border-radius: 6px;
  font-size: 0.8rem;
}

.seo-item .seo-icon {
  font-size: 0.9rem;
  width: 18px;
  text-align: center;
}

.seo-item.pass .seo-icon {
  color: var(--success);
}

.seo-item.fail .seo-icon {
  color: var(--error);
}

.seo-item.warning .seo-icon {
  color: var(--warning);
}

.seo-item .seo-label {
  flex: 1;
  color: var(--text-secondary);
}

.seo-item .seo-value {
  font-weight: 500;
  color: var(--text-muted);
  min-width: 35px;
  text-align: right;
}

/* Internal Linking */
.link-suggestions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.link-suggestion {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  font-size: 0.85rem;
}

.link-suggestion-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.link-suggestion-keyword {
  background: rgba(212, 175, 55, 0.2);
  color: var(--accent);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
  font-size: 0.8rem;
}

.link-suggestion-target {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.link-suggestion-target a {
  color: var(--accent);
}

.link-suggestion-context {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
  font-style: italic;
}

.link-suggestion-actions {
  display: flex;
  gap: 0.5rem;
}

.link-suggestion-actions button {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

.link-stats {
  font-size: 0.85rem;
}

.link-stats-row {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}

.link-stats-row:last-child {
  border-bottom: none;
}

.link-stats-label {
  color: var(--text-secondary);
}

.link-stats-value {
  color: var(--accent);
  font-weight: 500;
}

.no-suggestions {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 1rem;
}
