
/* JSON Inspector WordPress Plugin Styles */
.ji-app-container {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  max-width: 100%;
  margin: 0;
  padding: 0;
  color: #1e293b;
  line-height: 1.6;
}
.ji-app-container * {
  box-sizing: border-box;
}

/* Header */
.ji-header {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #6366f1 100%);
  color: white;
  padding: 20px 24px;
  border-radius: 12px 12px 0 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.ji-header-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.ji-header h1 {
  margin: 0;
  padding: 0;
  font-size: 20px;
  font-weight: 700;
  color: white;
  line-height: 1.3;
}
.ji-header p {
  margin: 2px 0 0 0;
  font-size: 12px;
  opacity: 0.85;
}

/* Main container */
.ji-main {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-top: none;
  border-radius: 0 0 12px 12px;
  padding: 24px;
}

/* Tabs */
.ji-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 10px;
  flex-wrap: wrap;
}
.ji-tab {
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ji-tab:hover {
  color: #4f46e5;
  background: #e0e7ff;
}
.ji-tab.active {
  background: white;
  color: #4f46e5;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  font-weight: 600;
}
.ji-tab svg {
  width: 14px;
  height: 14px;
}

/* Textarea */
.ji-textarea {
  width: 100%;
  min-height: 200px;
  padding: 14px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #1e293b;
  background: #f8fafc;
  resize: vertical;
  transition: border-color 0.2s;
  outline: none;
}
.ji-textarea:focus {
  border-color: #6366f1;
  background: white;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.ji-textarea::placeholder {
  color: #94a3b8;
}

/* File upload */
.ji-file-zone {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background: #f8fafc;
  margin-bottom: 16px;
}
.ji-file-zone:hover {
  border-color: #6366f1;
  background: #eef2ff;
}
.ji-file-zone.dragover {
  border-color: #4f46e5;
  background: #e0e7ff;
}
.ji-file-zone svg {
  width: 40px;
  height: 40px;
  color: #94a3b8;
  margin-bottom: 12px;
}
.ji-file-zone p {
  color: #64748b;
  font-size: 14px;
  margin: 0;
}
.ji-file-zone .ji-browse {
  color: #4f46e5;
  font-weight: 600;
  text-decoration: underline;
}

/* Buttons */
.ji-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ji-btn svg {
  width: 15px;
  height: 15px;
}
.ji-btn-primary {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: white;
}
.ji-btn-primary:hover {
  background: linear-gradient(135deg, #4338ca, #4f46e5);
  box-shadow: 0 4px 12px rgba(79,70,229,0.3);
  transform: translateY(-1px);
}
.ji-btn-secondary {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}
.ji-btn-secondary:hover {
  background: #e2e8f0;
}
.ji-btn-danger {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}
.ji-btn-danger:hover {
  background: #fee2e2;
}
.ji-btn-success {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}
.ji-btn-success:hover {
  background: #dcfce7;
}
.ji-btn-export {
  background: white;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  padding: 12px 16px;
  border-radius: 10px;
  width: 100%;
  text-align: left;
  font-size: 14px;
  justify-content: flex-start;
}
.ji-btn-export:hover {
  border-color: #6366f1;
  background: #f5f3ff;
  color: #4f46e5;
}
.ji-btn-export .ji-export-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

/* Actions bar */
.ji-actions {
  display: flex;
  gap: 8px;
  margin: 16px 0;
  flex-wrap: wrap;
}

/* Tree view */
.ji-tree {
  font-family: 'Fira Code', monospace;
  font-size: 13px;
  line-height: 1.7;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  overflow-x: auto;
  max-height: 500px;
  overflow-y: auto;
}
.ji-tree-key {
  color: #7c3aed;
  font-weight: 600;
}
.ji-tree-string {
  color: #059669;
}
.ji-tree-number {
  color: #2563eb;
}
.ji-tree-bool {
  color: #d97706;
  font-weight: 600;
}
.ji-tree-null {
  color: #dc2626;
  font-style: italic;
}
.ji-tree-bracket {
  color: #64748b;
}
.ji-tree-toggle {
  cursor: pointer;
  user-select: none;
  display: inline-block;
  width: 16px;
  color: #94a3b8;
  font-size: 10px;
}
.ji-tree-toggle:hover {
  color: #4f46e5;
}
.ji-tree-row {
  padding: 1px 0;
}
.ji-tree-row:hover {
  background: #e0e7ff;
  border-radius: 4px;
}
.ji-tree-indent {
  display: inline-block;
  width: 20px;
}
.ji-tree-img {
  max-width: 200px;
  max-height: 150px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  margin: 4px 0;
  display: block;
}

/* Stats */
.ji-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.ji-stat {
  background: #f1f5f9;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  color: #475569;
}
.ji-stat strong {
  color: #4f46e5;
  font-weight: 700;
}

/* Search */
.ji-search {
  position: relative;
  margin-bottom: 16px;
}
.ji-search input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 13px;
  outline: none;
  background: #f8fafc;
}
.ji-search input:focus {
  border-color: #6366f1;
  background: white;
}
.ji-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #94a3b8;
}

/* Modal / Export overlay */
.ji-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
}
.ji-modal {
  background: white;
  border-radius: 16px;
  padding: 28px;
  max-width: 520px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.ji-modal h2 {
  margin: 0 0 6px 0;
  font-size: 20px;
  color: #1e293b;
}
.ji-modal .ji-modal-desc {
  color: #64748b;
  font-size: 13px;
  margin-bottom: 20px;
}
.ji-modal-close {
  float: right;
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
}
.ji-modal-close:hover {
  background: #fee2e2;
  color: #dc2626;
}
.ji-export-grid {
  display: grid;
  gap: 10px;
}

/* Cleaned text viewer */
.ji-cleaned {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 20px;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 14px;
  line-height: 1.8;
  color: #334155;
  max-height: 500px;
  overflow-y: auto;
}
.ji-cleaned img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 8px 0;
  display: block;
}

/* Status bar */
.ji-status {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12px;
  color: #64748b;
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ji-status-ok { color: #16a34a; }
.ji-status-err { color: #dc2626; }

/* Responsive */
@media (max-width: 768px) {
  .ji-tabs { flex-direction: column; }
  .ji-header h1 { font-size: 17px; }
  .ji-actions { flex-direction: column; }
  .ji-stats { flex-direction: column; }
}
