/* Base styles */
:root {
  --primary: #FFA500;
  --primary-dark: #FF8C00;
  --secondary: #6b7280;
  --secondary-dark: #4b5563;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --sidebar-width: 40%;
  --main-width: 60%;
  --gap: 2rem;
  --honey-gradient: linear-gradient(135deg, #FFA500, #FFD700);
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  line-height: 1.5;
  color: var(--gray-800);
  background-color: #FFFAF0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Layout */
.container:not(.profile-container) {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.editor-layout {
  display: flex;
  gap: var(--gap);
  margin: 0 calc(var(--gap) * -1);
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.editor-main {
  flex: 0 0 var(--main-width);
  max-width: var(--main-width);
  padding: 0 var(--gap);
  border-right: 1px solid var(--gray-200);
}

.editor-sidebar {
  flex: 0 0 var(--sidebar-width);
  max-width: var(--sidebar-width);
  padding: 0 var(--gap);
}

/* Navigation */
.navbar {
  background: white;
  padding: 1rem 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
  border-bottom: 3px solid var(--primary);
}

.navbar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-link {
  display: flex;
  align-items: center;
  transition: transform 0.2s;
}

.logo-link:hover {
  transform: scale(1.02);
}

.logo {
  height: 40px;
  width: auto;
}

/* Cards */
.card {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  margin-bottom: 1.5rem;
  border: 1px solid var(--gray-200);
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--gray-700);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: 0.75rem;
  font-size: 1rem;
  transition: all 0.2s;
  background: var(--gray-50);
}

.form-control:hover {
  border-color: var(--primary);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 165, 0, 0.1);
  background: white;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.5rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--honey-gradient);
  color: white;
  box-shadow: 0 2px 4px rgba(255, 165, 0, 0.1);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(255, 165, 0, 0.2);
}

.btn-secondary {
  background: white;
  color: var(--gray-700);
  border: 1.5px solid var(--gray-300);
}

.btn-secondary:hover {
  background: var(--gray-50);
  transform: translateY(-1px);
  border-color: var(--gray-400);
}

/* Tables */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 0.75rem;
  overflow: hidden;
}

.table th,
.table td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
  text-align: left;
}

.table th {
  font-weight: 600;
  color: var(--gray-700);
  background: var(--gray-50);
  white-space: nowrap;
}

.table tr:last-child td {
  border-bottom: none;
}

.table tr:hover td {
  background-color: var(--gray-50);
}

/* Alerts */
.alert {
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.alert-success {
  background: #ecfdf5;
  color: #065f46;
  border-left: 4px solid var(--success);
}

.alert-error {
  background: #fef2f2;
  color: #991b1b;
  border-left: 4px solid var(--danger);
}

/* Editor */
.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 0;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-bottom: none;
  border-radius: 0;
  min-height: 30px;
}

.editor-toolbar button {
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 0;
  cursor: pointer;
  font-size: 13px;
  transition: none;
  color: #333;
  min-width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}

.editor-toolbar button:hover {
  background: #f0f0f0;
  border-color: #999;
}

.editor-toolbar button.active {
  background: #e8e8e8;
  border-color: #999;
}

.editor-content {
  position: relative;
}

.editor-content textarea {
  width: 100%;
  min-height: 500px;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  background: white;
  color: #333;
}

.editor-content textarea:focus {
  outline: none;
  border-color: #2271b1;
  box-shadow: 0 0 0 1px #2271b1;
}

/* WordPress-style buttons */
.editor-toolbar .wp-button {
  background: transparent;
  border: 1px solid transparent;
  color: #2c3338;
  font-weight: normal;
}

.editor-toolbar .wp-button:hover {
  background: #f0f0f0;
  border-color: #999;
  color: #2c3338;
}

.editor-toolbar .wp-button.active {
  background: #e8e8e8;
  border-color: #999;
  color: #2c3338;
}

/* Separator */
.editor-toolbar .separator {
  width: 1px;
  height: 24px;
  background-color: #ddd;
  margin: 3px 0;
}

/* Link Dialog */
.link-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 20px;
  border-radius: 0;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  width: 90%;
  max-width: 400px;
  border: 1px solid #ddd;
}

.link-dialog h3 {
  margin: 0 0 15px 0;
  color: #1d2327;
  font-size: 14px;
  font-weight: 600;
  padding-bottom: 10px;
  border-bottom: 1px solid #ddd;
}

.link-dialog .form-group {
  margin-bottom: 15px;
}

.link-dialog .form-label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #1d2327;
  font-size: 13px;
}

.link-dialog .form-control {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid #ddd;
  border-radius: 0;
  font-size: 13px;
}

.link-dialog .form-control:focus {
  border-color: #2271b1;
  box-shadow: 0 0 0 1px #2271b1;
  outline: none;
}

.link-dialog .button-group {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #ddd;
}

.link-dialog .btn {
  padding: 5px 10px;
  border-radius: 0;
  font-size: 13px;
  cursor: pointer;
  transition: none;
}

.link-dialog .btn-primary {
  background: #2271b1;
  color: white;
  border: 1px solid #2271b1;
}

.link-dialog .btn-primary:hover {
  background: #135e96;
  border-color: #135e96;
}

.link-dialog .btn-secondary {
  background: #f6f7f7;
  color: #2c3338;
  border: 1px solid #c3c4c7;
}

.link-dialog .btn-secondary:hover {
  background: #f0f0f1;
  border-color: #2271b1;
  color: #2271b1;
}

.link-dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-publish {
  background: #ecfdf5;
  color: #065f46;
}

.status-draft {
  background: var(--gray-100);
  color: var(--gray-700);
}

/* Footer */
.footer {
  margin-top: 80px;
  padding: 2rem 0;
  background: white;
  border-top: 3px solid var(--primary);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-logo {
  height: 30px;
  width: auto;
  opacity: 0.9;
}

.footer-copyright {
  color: var(--gray-600);
  font-size: 0.875rem;
}

/* Utility Classes */
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.mx-4 { margin-left: 1rem; margin-right: 1rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-4 { gap: 1rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.font-semibold { font-weight: 600; }
.w-full { width: 100%; }

/* Responsive */
@media (max-width: 1024px) {
  .editor-layout {
    flex-direction: column;
    margin: 0;
  }

  .editor-main,
  .editor-sidebar {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 0;
  }

  .editor-main {
    border-right: none;
    border-bottom: 1px solid var(--gray-200);
    padding-bottom: 2rem;
    margin-bottom: 2rem;
  }
}

@media (max-width: 768px) {
  .navbar-content {
    flex-direction: column;
    gap: 1rem;
  }

  .container {
    padding: 0 1rem;
  }

  .card {
    padding: 1.5rem;
  }

  .editor-toolbar {
    padding: 0.75rem;
  }

  .editor-content textarea {
    padding: 1rem;
  }
}

/* Loading Animation */
.loading {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Category List */
.category-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.category-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: background-color 0.2s;
}

.category-item:hover {
  background-color: var(--gray-50);
}

.category-item input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 0.25rem;
  border: 2px solid var(--gray-300);
  transition: all 0.2s;
  cursor: pointer;
}

.category-item input[type="checkbox"]:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

/* Credit Info */
.credit-info {
  background: var(--gray-50);
  padding: 1.5rem;
  border-radius: 0.75rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--gray-200);
}

.credit-info p {
  margin-bottom: 0.5rem;
}

.credit-info p:last-child {
  margin-bottom: 0;
}

/* Warning Messages */
.warning {
  background: #fff7ed;
  border-left: 4px solid var(--warning);
  color: #9a3412;
  padding: 1.25rem;
  border-radius: 0.75rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Table Responsive */
.table-responsive {
  border-radius: 0.75rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1.5rem;
  border: 1px solid var(--gray-200);
}

/* Separator */
.separator {
  width: 1px;
  height: 24px;
  background-color: var(--gray-300);
  margin: 0 0.5rem;
}

.back-to-dashboard-btn {
  margin-bottom: 4rem;
}

main.container {
  min-height: 300px;
}
