/* ===== Elu Kaldal CMS — Design System ===== */
/* Inspired by the static site: concrete wall + palm shadows aesthetic */

@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@400;500;600;700&display=swap');

:root {
  /* Background texture — same as static site hero */
  --bg-image: url('../images/background/background.jpg');

  /* Colors — derived from the concrete wall palette */
  --bg-overlay: rgba(30, 40, 50, 0.82);
  --bg-sidebar: rgba(20, 28, 38, 0.92);
  --bg-card: rgba(255, 255, 255, 0.07);
  --bg-card-hover: rgba(255, 255, 255, 0.12);
  --bg-input: rgba(255, 255, 255, 0.92);
  --bg-input-dark: rgba(255, 255, 255, 0.08);

  --border: rgba(255, 255, 255, 0.12);
  --border-light: rgba(255, 255, 255, 0.2);
  --border-focus: #3498db;

  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.72);
  --text-muted: rgba(255, 255, 255, 0.45);
  --text-input: #2c3e50;

  --accent: #3498db;
  --accent-hover: #2980b9;
  --accent-bg: rgba(52, 152, 219, 0.15);

  --success: #27ae60;
  --success-bg: rgba(39, 174, 96, 0.15);
  --warning: #f39c12;
  --warning-bg: rgba(243, 156, 18, 0.15);
  --danger: #e74c3c;
  --danger-bg: rgba(231, 76, 60, 0.15);

  /* Typography */
  --font-brand: 'Dancing Script', cursive;
  --font-headings: 'Playfair Display', serif;
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 50px;

  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-soft: 0 2px 12px rgba(0, 0, 0, 0.15);
  --transition: 0.25s ease;

  --sidebar-width: 240px;
  --header-height: 56px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  /* Concrete wall background — fixed across all views */
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

/* Dark overlay on entire body */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 0;
}

#app {
  position: relative;
  z-index: 1;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ===== Layout ===== */

.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-logo {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0;
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: 22px;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.sidebar-logo .logo-icon {
  display: none;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 10px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  letter-spacing: 0.01em;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-bg);
  color: var(--accent);
}

.nav-item i { font-size: 18px; width: 22px; text-align: center; }

.sidebar-footer {
  padding: 14px 10px;
  border-top: 1px solid var(--border);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  font-size: 13px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-bg);
  border: 1px solid rgba(52, 152, 219, 0.3);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.page-header {
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(20, 28, 38, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.page-header h1 {
  font-family: var(--font-headings);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.page-body {
  padding: 24px 28px;
}

/* ===== Mobile ===== */

.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(20, 28, 38, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 90;
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
}

.mobile-header .logo-text {
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 0.02em;
}

.hamburger {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
}

/* ===== Editor Layout ===== */

.editor-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}

.editor-main {
  min-width: 0; /* prevent overflow */
}

.editor-sidebar {
  min-width: 0;
}

/* ===== Mobile Responsive ===== */

@media (max-width: 768px) {
  .mobile-header { display: flex; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .main-content { margin-left: 0; padding-top: var(--header-height); }
  .page-header { position: static; }
  .page-body { padding: 12px; }

  /* --- Page Header: stack title + buttons --- */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
  }

  .page-header .d-flex { width: 100%; }
  .page-header .d-flex:last-child {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }

  .page-header h1 { font-size: 18px; }

  .page-header .btn {
    padding: 7px 14px;
    font-size: 12px;
  }

  /* --- Stats Grid --- */
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .stat-card {
    padding: 14px 16px;
  }

  .stat-info .stat-value { font-size: 22px; }

  /* --- Editor Layout: stack vertically --- */
  .editor-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .editor-sidebar {
    order: 2;
  }

  /* --- Posts Table: hide non-essential columns --- */
  .col-thumb,
  .col-tags {
    display: none !important;
  }

  .data-table th,
  .data-table td {
    padding: 10px 8px;
    font-size: 13px;
  }

  .data-table .post-title {
    font-size: 13px;
    line-height: 1.4;
  }

  /* --- Forms on mobile --- */
  .form-row { grid-template-columns: 1fr; }

  .form-input, .form-select, .form-textarea {
    font-size: 16px; /* prevent iOS zoom */
  }

  /* --- Cards --- */
  .card { padding: 14px; }

  /* --- EasyMDE on mobile --- */
  .EasyMDEContainer {
    overflow: hidden;
  }

  .EasyMDEContainer .CodeMirror {
    font-size: 15px !important; /* prevent iOS zoom */
  }

  .EasyMDEContainer .editor-toolbar {
    flex-wrap: wrap;
  }

  /* --- Build status row --- */
  .build-status {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start !important;
  }

  .build-status .btn {
    width: 100%;
    justify-content: center;
  }

  /* --- Modal adjustments --- */
  .modal-card {
    margin: 12px;
    max-width: calc(100vw - 24px) !important;
  }

  /* --- Image upload area --- */
  .image-upload-area {
    padding: 16px;
  }

  .image-upload-area img {
    max-height: 120px;
  }

  /* --- Dashboard list --- */
  .dashboard-posts .data-table .post-title {
    max-width: 200px;
    white-space: normal;
  }

  /* --- User management --- */
  .users-table td,
  .users-table th {
    padding: 8px 6px;
    font-size: 12px;
  }
}

/* ===== Buttons ===== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--radius-pill);
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-success {
  background: var(--success);
  color: white;
}
.btn-success:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: rgba(231, 76, 60, 0.3);
}
.btn-danger:hover { background: var(--danger); color: white; }

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-light);
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.35);
}

.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-icon { padding: 7px 10px; }

/* ===== Cards ===== */

.card {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: background var(--transition);
}

.card:hover {
  background: var(--bg-card-hover);
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.stat-icon.blue { background: var(--accent-bg); color: var(--accent); }
.stat-icon.green { background: var(--success-bg); color: var(--success); }
.stat-icon.yellow { background: var(--warning-bg); color: var(--warning); }

.stat-info .stat-value {
  font-family: var(--font-headings);
  font-size: 28px;
  font-weight: 700;
}
.stat-info .stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 500;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

/* ===== Table ===== */

.table-wrapper {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  font-weight: 600;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 14px;
  vertical-align: middle;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.04);
}

.data-table .post-title {
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: color var(--transition);
}
.data-table .post-title:hover { color: var(--accent); }

.post-thumb {
  width: 48px;
  height: 36px;
  object-fit: cover;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-published { background: var(--success-bg); color: var(--success); }
.badge-draft { background: var(--warning-bg); color: var(--warning); }

/* ===== Forms ===== */

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-family: var(--font-primary);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  color: var(--text-input);
  font-size: 14px;
  font-family: var(--font-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.form-input::placeholder, .form-textarea::placeholder {
  color: #999;
}

.form-textarea { resize: vertical; min-height: 80px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 768px) {
  .form-row { grid-template-columns: 1fr; }
}

/* ===== Tags Input ===== */

.tags-input-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  min-height: 42px;
  cursor: text;
}

.tags-input-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: var(--accent-bg);
  color: var(--accent);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  border: 1px solid rgba(52, 152, 219, 0.2);
}

.tag-chip .remove-tag {
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  opacity: 0.7;
}
.tag-chip .remove-tag:hover { opacity: 1; }

.tag-input-container {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 150px;
}

.tags-input-field {
  border: none;
  background: none;
  color: var(--text-input);
  font-size: 13px;
  outline: none;
  flex: 1;
  min-width: 0;
}

/* ===== Image Upload ===== */

.image-upload-area {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-muted);
}

.image-upload-area:hover {
  border-color: var(--accent);
  background: var(--accent-bg);
}

.image-upload-area.has-image {
  border-style: solid;
  padding: 8px;
}

.image-upload-area img {
  max-width: 100%;
  max-height: 200px;
  border-radius: var(--radius-sm);
}

/* ===== Editor Layout ===== */

.editor-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 1024px) {
  .editor-layout { grid-template-columns: 1fr; }
}

.editor-main { min-width: 0; }

.editor-sidebar {
  position: sticky;
  top: 80px;
}

/* ===== Modal ===== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-card {
  background: rgba(30, 40, 55, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
  animation: scaleIn 0.2s ease;
}

.modal-card h2 {
  font-family: var(--font-headings);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ===== Login ===== */

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  /* Login uses same background as body — no extra overlay needed */
}

.login-card {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
  text-align: center;
}

.login-card h1 {
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: 36px;
  color: var(--text-primary);
  margin-bottom: 32px;
  letter-spacing: 0.02em;
}

.login-card .subtitle {
  display: none;
}

.login-card .form-group {
  text-align: left;
}

.login-card .form-group label {
  color: var(--text-secondary);
  font-size: 11px;
}

.login-card .form-input {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-pill);
  padding: 12px 20px;
  color: var(--text-input);
  font-size: 14px;
}

.login-card .form-input:focus {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.login-card .form-input::placeholder {
  color: #999;
}

.login-card .btn-primary {
  border-radius: var(--radius-pill);
  padding: 13px 20px;
  font-size: 14px;
  font-weight: 600;
  margin-top: 8px;
  letter-spacing: 0.02em;
}

.login-error {
  background: var(--danger-bg);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
  text-align: left;
}

.login-error.visible { display: block; }

@media (max-width: 480px) {
  .login-card {
    padding: 36px 24px;
    margin: 0 12px;
  }

  .login-card h1 {
    font-size: 30px;
  }
}

/* ===== Toast / notifications ===== */

.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow);
  animation: slideIn 0.3s ease;
  max-width: 320px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.toast-success { background: rgba(39, 174, 96, 0.9); color: #d5f5e3; }
.toast-error { background: rgba(192, 57, 43, 0.9); color: #fadbd8; }
.toast-info { background: rgba(41, 128, 185, 0.9); color: #d6eaf8; }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===== Media Grid ===== */

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.media-item {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color var(--transition), transform var(--transition);
}

.media-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.media-item.selected { border-color: var(--accent); }

.media-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-item .media-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6px 8px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  font-size: 10px;
  color: rgba(255, 255, 255, 0.8);
}

/* ===== Build status ===== */

.build-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
}

.build-status.running { background: var(--accent-bg); color: var(--accent); }
.build-status.success { background: var(--success-bg); color: var(--success); }
.build-status.failed { background: var(--danger-bg); color: var(--danger); }

/* ===== Utilities ===== */

.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.empty-state i { font-size: 40px; margin-bottom: 12px; display: block; }

/* ===== Loading spinner ===== */

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

/* ===== EasyMDE Dark Theme ===== */

.EasyMDEContainer {
  border: none !important;
}

.EasyMDEContainer .CodeMirror {
  background: rgba(255, 255, 255, 0.92) !important;
  color: #2c3e50 !important;
  border: 1px solid var(--border) !important;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm) !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-size: 14px !important;
  line-height: 1.7 !important;
  padding: 12px !important;
}

.EasyMDEContainer .CodeMirror-cursor {
  border-left-color: #2c3e50 !important;
}

.EasyMDEContainer .CodeMirror-selected {
  background: rgba(52, 152, 219, 0.25) !important;
}

.EasyMDEContainer .editor-toolbar {
  background: rgba(20, 28, 38, 0.7) !important;
  border: 1px solid var(--border) !important;
  border-bottom: none !important;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0 !important;
  padding: 6px !important;
}

.EasyMDEContainer .editor-toolbar button {
  color: var(--text-secondary) !important;
  border: none !important;
  border-radius: 4px !important;
}

.EasyMDEContainer .editor-toolbar button:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: var(--text-primary) !important;
}

.EasyMDEContainer .editor-toolbar button.active {
  background: var(--accent-bg) !important;
  color: var(--accent) !important;
}

.EasyMDEContainer .editor-toolbar i.separator {
  border-left-color: var(--border) !important;
}

/* Preview mode */
.EasyMDEContainer .editor-preview {
  background: rgba(255, 255, 255, 0.95) !important;
  color: #2c3e50 !important;
  padding: 20px !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 15px !important;
  line-height: 1.8 !important;
}

.EasyMDEContainer .editor-preview img {
  max-width: 100%;
  border-radius: 8px;
  margin: 12px 0;
}

.EasyMDEContainer .editor-preview h1,
.EasyMDEContainer .editor-preview h2,
.EasyMDEContainer .editor-preview h3 {
  font-family: var(--font-headings);
  color: #1a1a1a;
}

/* Side-by-side mode */
.EasyMDEContainer .editor-preview-side {
  background: rgba(255, 255, 255, 0.95) !important;
  color: #2c3e50 !important;
  border-left: 1px solid var(--border) !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 14px !important;
  line-height: 1.7 !important;
}

.EasyMDEContainer .editor-preview-side img {
  max-width: 100%;
  border-radius: 8px;
}

/* ===== Phone Preview ===== */

.phone-preview-wrapper {
  max-width: 420px;
  width: 100%;
  padding: 0 20px;
}

.phone-frame {
  width: 375px;
  max-width: 100%;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 40px;
  border: 4px solid #333;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), inset 0 0 0 2px #555;
  overflow: hidden;
  position: relative;
}

.phone-notch {
  width: 150px;
  height: 28px;
  background: #333;
  border-radius: 0 0 18px 18px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.phone-screen {
  height: 680px;
  overflow-y: auto;
  padding: 16px 20px 32px;
  background: #ffffff;
  -webkit-overflow-scrolling: touch;
}

.phone-screen::-webkit-scrollbar {
  width: 3px;
}
.phone-screen::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.phone-article {
  color: #2c3e50;
  font-family: 'Inter', sans-serif;
}

.phone-title {
  font-family: var(--font-headings);
  font-size: 22px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.3;
  margin-bottom: 8px;
}

.phone-meta {
  font-size: 12px;
  color: #888;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #eee;
}

.phone-body {
  font-size: 14px;
  line-height: 1.7;
  color: #333;
}

.phone-body h2 {
  font-family: var(--font-headings);
  font-size: 18px;
  font-weight: 600;
  margin: 20px 0 10px;
  color: #1a1a1a;
}

.phone-body h3 {
  font-family: var(--font-headings);
  font-size: 16px;
  font-weight: 600;
  margin: 16px 0 8px;
  color: #1a1a1a;
}

.phone-body p {
  margin: 0 0 14px;
}

.phone-body img {
  max-width: 100%;
  border-radius: 8px;
  margin: 12px 0;
  display: block;
}

.phone-body ul, .phone-body ol {
  padding-left: 20px;
  margin: 10px 0;
}

.phone-body li {
  margin-bottom: 4px;
}

.phone-body a {
  color: #3498db;
  text-decoration: underline;
}

.phone-body strong {
  font-weight: 600;
}

.phone-body blockquote {
  border-left: 3px solid #3498db;
  padding-left: 14px;
  margin: 12px 0;
  color: #555;
  font-style: italic;
}

@media (max-width: 480px) {
  .phone-preview-wrapper { padding: 0 8px; }
  .phone-frame { border-radius: 28px; border-width: 3px; width: 100%; }
  .phone-screen { height: 500px; padding: 12px 16px 24px; }
  .phone-notch { width: 120px; height: 22px; }
}
