/**
 * SmartPaste Publisher — Styles
 * Applied in Gutenberg editor, admin page, and frontend (for responsive tables)
 */

/* ============================================
   RESPONSIVE TABLE ENGINE
   ============================================ */
.smartpaste-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  margin-bottom: 1.5em;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.smartpaste-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
  min-width: 400px;
}

.smartpaste-table th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background-color: #f8fafc;
  color: #64748b;
  border-bottom: 2px solid #e2e8f0;
}

.smartpaste-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #374151;
  vertical-align: top;
}

.smartpaste-table tr:last-child td {
  border-bottom: none;
}

.smartpaste-table tr:hover td {
  background-color: #f8fafc;
}

/* Mobile: stack columns hint */
@media (max-width: 600px) {
  .smartpaste-table-wrapper {
    border-radius: 4px;
  }
  .smartpaste-table {
    font-size: 0.85em;
  }
  .smartpaste-table th,
  .smartpaste-table td {
    padding: 8px 10px;
  }
}

/* ============================================
   ADMIN PAGE STYLES
   ============================================ */
.smartpaste-admin-wrap h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.smartpaste-admin-container {
  max-width: 900px;
}

.smartpaste-admin-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 28px 32px;
  margin-bottom: 24px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}

.smartpaste-admin-card h2 {
  margin-top: 0;
  font-size: 1.25em;
  color: #1a202c;
}

.smartpaste-admin-card h3 {
  font-size: 1em;
  color: #374151;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 8px;
  margin-bottom: 16px;
}

.sp-desc {
  color: #64748b;
  margin-bottom: 16px;
  font-size: 0.95em;
}

.smartpaste-paste-zone {
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  padding: 20px;
  min-height: 200px;
  background: #f8fafc;
  color: #374151;
  font-size: 0.95em;
  line-height: 1.6;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  cursor: text;
  position: relative;
}

.smartpaste-paste-zone:empty::before {
  content: attr(data-placeholder);
  color: #94a3b8;
  pointer-events: none;
}

.smartpaste-paste-zone:focus {
  border-color: #0ea5a0;
  background: #f0fdfa;
}

.sp-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.sp-actions .button-hero {
  height: auto;
  padding: 10px 22px;
  font-size: 1em;
}

.sp-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.sp-meta label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  font-size: 0.85em;
  color: #374151;
}

.sp-meta select {
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  width: 100%;
}

@media (max-width: 600px) {
  .sp-meta { grid-template-columns: 1fr; }
}

/* Preview content in admin */
.sp-preview-content {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 24px;
  max-height: 500px;
  overflow-y: auto;
  margin-bottom: 20px;
}

.sp-preview-content h1,
.sp-preview-content h2,
.sp-preview-content h3,
.sp-preview-content h4 {
  margin-top: 1.2em;
  margin-bottom: 0.5em;
}

.sp-preview-content a { color: #0ea5a0; }

/* ============================================
   GUTENBERG SIDEBAR PANEL
   ============================================ */
.smartpaste-sidebar-panel .smartpaste-panel-inner {
  padding: 4px 0;
}

.smartpaste-sidebar-panel .smartpaste-hint {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 12px;
  line-height: 1.5;
}

.smartpaste-sidebar-panel .smartpaste-open-btn {
  width: 100%;
  justify-content: center;
  background: #0ea5a0;
  border-color: #0ea5a0;
  color: #fff;
}

.smartpaste-sidebar-panel .smartpaste-open-btn:hover {
  background: #0c8f8a;
  border-color: #0c8f8a;
}

/* ============================================
   GUTENBERG MODAL
   ============================================ */
.smartpaste-modal .components-modal__header {
  background: linear-gradient(135deg, #0ea5a0, #06b6d4);
  color: #fff;
}

.smartpaste-modal .components-modal__header button {
  color: #fff;
}

.smartpaste-modal .smartpaste-modal-body {
  padding: 16px 0;
}

.smartpaste-modal .smartpaste-modal-hint {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 16px;
  line-height: 1.5;
  background: #f0fdfa;
  border-left: 3px solid #0ea5a0;
  padding: 10px 14px;
  border-radius: 0 6px 6px 0;
}

.smartpaste-modal .smartpaste-paste-zone {
  width: 100%;
  min-height: 240px;
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  padding: 16px;
  background: #f8fafc;
  font-size: 13px;
  line-height: 1.6;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.smartpaste-modal .smartpaste-paste-zone:focus {
  border-color: #0ea5a0;
  background: #f0fdfa;
}

.smartpaste-modal .smartpaste-paste-zone:empty::before {
  content: attr(data-placeholder);
  color: #94a3b8;
}

.smartpaste-modal .smartpaste-modal-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.smartpaste-modal .smartpaste-import-btn {
  background: #0ea5a0 !important;
  border-color: #0ea5a0 !important;
  color: #fff !important;
}

.smartpaste-modal .smartpaste-import-btn:hover:not(:disabled) {
  background: #0c8f8a !important;
}

.smartpaste-modal .smartpaste-import-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
