/* =========================
   BASE
========================= */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f5f5f5;
}

/* =========================
   HEADER & STATS
========================= */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
}

.top-bar h1 {
  margin: 0;
  font-size: 20px;
}

.stats-bar {
  display: flex;
  justify-content: space-between;
  padding: 8px 20px;
  font-size: 14px;
}

/* =========================
   LAYOUT
========================= */
.layout {
  display: flex;
  max-width: 1400px;
  margin: auto;
  gap: 10px;
}

/* =========================
   ADS
========================= */
.ad-box {
  width: 180px;
  border: 2px dashed #ccc;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-placeholder {
  color: #999;
  font-size: 14px;
}

/* =========================
   EDITOR
========================= */
.editor-wrapper {
  flex: 1;
  background: #fff;
  border: 3px solid #000;
}

#editor {
  min-height: 56vh;
  padding: 14px;
  outline: none;
  font-size: 14px;
}

/* =========================
   CONTROLS
========================= */
.controls {
  max-width: 1400px;
  margin: 12px auto;
  text-align: center;
  position: sticky;
  bottom: 0;
  background: #f5f5f5;
  padding: 8px 0;
  z-index: 10;
}

.group {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

/* =========================
   BUTTON BASE + FEEDBACK
========================= */
.controls button {
  padding: 8px 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: #fff;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    filter 0.12s ease,
    background-color 0.12s ease;
  box-shadow: 0 3px 0 rgba(0,0,0,0.15);
}

/* Hover feedback */
.controls button:hover {
  filter: brightness(1.08);
}

/* Click feedback (PRESS) */
.controls button:active {
  transform: scale(0.96);
  box-shadow: 0 1px 0 rgba(0,0,0,0.2);
}

/* Keyboard focus (accessibility) */
.controls button:focus-visible {
  outline: 2px solid rgba(0,0,0,0.25);
  outline-offset: 2px;
}

/* =========================
   SUCCESS FLASH (Copy, Save)
========================= */
.controls button.flash {
  animation: flash-success 0.35s ease;
}

@keyframes flash-success {
  0%   { filter: brightness(1); }
  50%  { filter: brightness(1.4); }
  100% { filter: brightness(1); }
}

/* =========================
   BUTTON COLORS (Adsense-safe)
========================= */
#copyBtn { background: #6c757d; }
#boldBtn { background: #0d6efd; }
#italicBtn { background: #6610f2; }
#underlineBtn { background: #198754; }
#resetFormatBtn { background: #dc3545; }
#upperBtn { background: #fd7e14; }
#lowerBtn { background: #20c997; }
#capWordsBtn { background: #0dcaf0; }
#capSentenceBtn { background: #6f42c1; }

/* =========================
   DARK MODE
========================= */
.dark {
  background: #1e1e1e;
  color: #fff;
}

.dark .editor-wrapper {
  background: #121212;
  border-color: #444;
}

.dark #editor {
  background: #121212;
  color: #fff;
}

.dark .ad-box {
  border-color: #444;
}

.dark .controls {
  background: #1e1e1e;
}

.dark button {
  filter: brightness(1.05);
}
