/**
 * LiveLang Pro Admin Dashboard Stylesheet
 * High-Productivity, World-Class UI/UX Design System
 */

:root {
  --ll-primary: #2563eb;
  --ll-primary-hover: #1d4ed8;
  --ll-primary-light: #eff6ff;
  --ll-primary-border: #bfdbfe;

  --ll-success: #10b981;
  --ll-success-light: #ecfdf5;
  --ll-success-border: #a7f3d0;

  --ll-warning: #f59e0b;
  --ll-warning-light: #fffbeb;

  --ll-danger: #ef4444;
  --ll-danger-light: #fef2f2;
  --ll-danger-border: #fecaca;

  --ll-dark: #0f172a;
  --ll-slate: #1e293b;
  --ll-text-main: #334155;
  --ll-text-muted: #64748b;
  --ll-text-light: #94a3b8;

  --ll-bg-page: #f8fafc;
  --ll-bg-card: #ffffff;
  --ll-bg-alt: #f1f5f9;
  --ll-border: #e2e8f0;
  --ll-border-strong: #cbd5e1;

  --ll-radius-sm: 6px;
  --ll-radius: 10px;
  --ll-radius-lg: 14px;

  --ll-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --ll-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --ll-shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

/* Base Reset inside Dashboard */
.livelang-admin-dashboard {
  width: 100%;
  max-width: 1320px;
  margin: auto;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  color: var(--ll-text-main);
  box-sizing: border-box;
}

.livelang-admin-dashboard * {
  box-sizing: border-box;
}

/* Header Section */
.livelang-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  background: var(--ll-bg-card);
  padding: 18px 24px;
  border-radius: var(--ll-radius-lg);
  border: 1px solid var(--ll-border);
  box-shadow: var(--ll-shadow);
}

.livelang-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.livelang-brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.livelang-header h1 {
  font-size: 20px !important;
  font-weight: 700 !important;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--ll-dark) !important;
  display: flex;
  align-items: center;
  gap: 10px;
}

.livelang-header-badge {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: var(--ll-primary);
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border: 1px solid var(--ll-primary-border);
}

.livelang-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Metrics Overview Row */
.livelang-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.livelang-stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--ll-bg-card);
  border: 1px solid var(--ll-border);
  border-radius: var(--ll-radius);
  padding: 18px 20px;
  box-shadow: var(--ll-shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.livelang-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--ll-shadow);
}

.livelang-stat-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.livelang-stat-icon-wrap.blue {
  background: #eff6ff;
  color: #2563eb;
}

.livelang-stat-icon-wrap.green {
  background: #ecfdf5;
  color: #10b981;
}

.livelang-stat-icon-wrap.purple {
  background: #f3e8ff;
  color: #9333ea;
}

.livelang-stat-icon-wrap.amber {
  background: #fffbeb;
  color: #d97706;
}

.livelang-stat-icon-wrap .dashicons {
  font-size: 22px !important;
  width: 22px !important;
  height: 22px !important;
}

.livelang-stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--ll-dark);
  line-height: 1.1;
}

.livelang-stat-label {
  font-size: 12px;
  color: var(--ll-text-muted);
  font-weight: 600;
  margin-top: 3px;
}

/* Main Layout Grid */
.livelang-main-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  align-items: start;
}

/* Sidebar Navigation */
.livelang-sidebar {
  background: var(--ll-bg-card);
  border-radius: var(--ll-radius-lg);
  padding: 10px;
  border: 1px solid var(--ll-border);
  box-shadow: var(--ll-shadow-sm);
  position: sticky;
  top: 40px;
}

.livelang-sidebar-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--ll-text-light);
  text-transform: uppercase;
  padding: 10px 14px 6px 14px;
}

.livelang-nav-item {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  margin-bottom: 3px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--ll-text-muted);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s ease;
  cursor: pointer;
}

.livelang-nav-item:hover {
  background: var(--ll-bg-alt);
  color: var(--ll-dark);
}

.livelang-nav-item.is-active {
  background: var(--ll-primary) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.livelang-nav-item.is-active .dashicons {
  color: #ffffff !important;
}

.livelang-nav-item .dashicons {
  font-size: 17px !important;
  width: 17px !important;
  height: 17px !important;
  margin-right: 10px;
  color: var(--ll-text-muted);
}

/* Content Area & Cards */
.livelang-content {
  min-width: 0;
}

.livelang-tab-panel {
  display: none;
}

.livelang-tab-panel.is-active {
  display: block;
  animation: livelangFade 0.2s ease-out;
}

@keyframes livelangFade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.livelang-card {
  background: var(--ll-bg-card);
  border-radius: var(--ll-radius-lg);
  border: 1px solid var(--ll-border);
  box-shadow: var(--ll-shadow-sm);
  margin-bottom: 24px;
  overflow: hidden;
}

.livelang-card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--ll-border);
  background: #fafafa;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.livelang-card-header h2 {
  margin: 0 !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  color: var(--ll-dark) !important;
  display: flex;
  align-items: center;
  gap: 8px;
}

.livelang-card-body {
  padding: 24px;
}

/* Settings Form Tables */
.livelang-settings-table {
  width: 100%;
  border-collapse: collapse;
}

.livelang-settings-table tr {
  border-bottom: 1px solid #f1f5f9;
}

.livelang-settings-table tr:last-child {
  border-bottom: none;
}

.livelang-settings-table th {
  width: 240px;
  text-align: left;
  padding: 18px 0;
  font-weight: 600;
  font-size: 13px;
  vertical-align: top;
  color: var(--ll-dark);
}

.livelang-settings-table td {
  padding: 18px 0;
}

.livelang-settings-table select,
.livelang-settings-table input[type="text"],
.livelang-settings-table input[type="number"],
.livelang-settings-table input[type="search"] {
  width: 100%;
  max-width: 380px;
  border: 1px solid var(--ll-border-strong);
  border-radius: 8px;
  padding: 9px 12px;
  height: 40px;
  font-size: 13px;
  color: var(--ll-dark);
  background: #ffffff;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.livelang-settings-table select:focus,
.livelang-settings-table input[type="text"]:focus,
.livelang-settings-table input[type="number"]:focus,
.livelang-settings-table input[type="search"]:focus {
  border-color: var(--ll-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Toggle Switch UI */
.livelang-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.livelang-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.livelang-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .25s ease;
  border-radius: 24px;
}

.livelang-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .25s ease;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

input:checked+.livelang-slider {
  background-color: var(--ll-primary);
}

input:checked+.livelang-slider:before {
  transform: translateX(20px);
}

/* Modern Tables */
.livelang-table {
  width: 100%;
  border-collapse: collapse;
}

.livelang-table th {
  background: #f8fafc;
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--ll-border);
  color: var(--ll-text-muted);
}

.livelang-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--ll-border);
  font-size: 13px;
  color: var(--ll-dark);
  vertical-align: middle;
}

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

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

.livelang-code-chip {
  font-family: Consolas, Monaco, "Ubuntu Mono", monospace;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
  color: #0f172a;
}

/* Badges */
.livelang-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.livelang-status-active {
  background: var(--ll-success-light);
  color: #059669;
  border: 1px solid var(--ll-success-border);
}

.livelang-status-inactive {
  background: var(--ll-danger-light);
  color: #dc2626;
  border: 1px solid var(--ll-danger-border);
}

.livelang-lang-tag {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
}

/* Button UI */
.livelang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none !important;
  transition: all 0.15s ease;
  border: none;
  line-height: 1;
}

.livelang-btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.livelang-btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.livelang-btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
}

.livelang-btn-success:hover {
  background: linear-gradient(135deg, #059669, #047857);
}

.livelang-btn-outline {
  background: #ffffff;
  color: var(--ll-text-main) !important;
  border: 1px solid var(--ll-border-strong);
}

.livelang-btn-outline:hover {
  background: var(--ll-bg-alt);
  border-color: #94a3b8;
  color: var(--ll-dark) !important;
}

.livelang-btn-danger {
  background: #ef4444;
  color: #ffffff !important;
}

.livelang-btn-danger:hover {
  background: #dc2626;
}

/* Split Layout for Preview */
.livelang-visual-settings {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
}

/* Preview Canvas Modern */
.livelang-preview-canvas {
  background: #f1f5f9;
  border-radius: var(--ll-radius);
  height: 440px;
  position: relative;
  border: 1px solid var(--ll-border);
  overflow: hidden;
}

.livelang-mock-browser {
  background: #fff;
  margin: 16px;
  height: calc(100% - 32px);
  border-radius: 8px;
  box-shadow: var(--ll-shadow-lg);
  display: flex;
  flex-direction: column;
}

.livelang-browser-header {
  height: 32px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  padding: 0 12px;
}

.livelang-dot {
  height: 8px;
  width: 8px;
  border-radius: 50%;
  background: #cbd5e1;
  margin-right: 6px;
}

/* Filter Bar & Controls */
.livelang-filters-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px;
}

.livelang-filters-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
}

.livelang-search-wrap {
  position: relative;
  flex: 1 1 280px;
  min-width: 240px;
}

.livelang-search-wrap .dashicons {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ll-text-muted);
  font-size: 17px;
  width: 17px;
  height: 17px;
  pointer-events: none;
}

.livelang-search-wrap input[type="search"] {
  width: 100% !important;
  height: 40px !important;
  padding: 0 14px 0 38px !important;
  border: 1px solid var(--ll-border) !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  color: var(--ll-text-main) !important;
  background: #ffffff !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

.livelang-search-wrap input[type="search"]:focus {
  border-color: var(--ll-primary) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
  outline: none !important;
}

.livelang-filters-form select,
.livelang-bulk-actions-bar select,
.livelang-danger-form select {
  height: 40px !important;
  padding: 0 34px 0 14px !important;
  border: 1px solid var(--ll-border) !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: var(--ll-text-main) !important;
  background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2064748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 12px center !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
  cursor: pointer !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

.livelang-filters-form select:focus,
.livelang-bulk-actions-bar select:focus,
.livelang-danger-form select:focus {
  border-color: var(--ll-primary) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
  outline: none !important;
}

.livelang-bulk-actions-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 16px 0;
  padding: 0 4px;
}

/* Toast Notifications */
.livelang-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--ll-dark);
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.livelang-toast.show {
  opacity: 1;
  transform: translateY(0);
}