/* ===== ICON BUTTONS ===== */
.icon-btn { 
  width: 34px; 
  height: 34px; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  line-height: 0; 
  background: var(--button-bg); 
  color: var(--button-text); 
  border: 1px solid var(--button-border); 
  border-radius: 10px; 
  position: relative; 
  cursor: pointer; 
}

.icon-btn svg { 
  width: 22px; 
  height: 22px; 
}

.icon-btn[title]::after {
  content: attr(title);
  position: absolute; 
  top: calc(100% + 8px); 
  left: 50%; 
  transform: translateX(-50%);
  background: #101319; 
  color: #fff; 
  border: 1px solid var(--button-border); 
  padding: 6px 8px; 
  border-radius: 8px; 
  white-space: nowrap; 
  font-size: 12px; 
  opacity: 0; 
  pointer-events: none; 
  transition: opacity .12s ease;
}

body[data-theme="light"] .icon-btn[title]::after { 
  background: #24292f; 
}

.icon-btn:hover::after { 
  opacity: 0.95; 
}

/* Active state for alignment buttons */
.icon-btn.align.active { 
  outline: 2px solid var(--active); 
  background: rgba(255,255,255,0.06); 
}

/* Active state for B / I / U in Card Maker */
#qStyleRow .icon-btn.active,
#aStyleRow .icon-btn.active,
#dStyleRow .icon-btn.active {
  outline: 2px solid var(--active);
  background: rgba(255,255,255,0.06);
}

/* Ensure deck style buttons are clickable */
#dStyleRow .icon-btn {
  cursor: pointer;
  transition: all 0.2s ease;
}

#dStyleRow .icon-btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--active);
}

#qStyleRow .icon-btn b, 
#aStyleRow .icon-btn b,
#dStyleRow .icon-btn b { 
  font-weight: 800; 
}

#qStyleRow .icon-btn u, 
#aStyleRow .icon-btn u,
#dStyleRow .icon-btn u { 
  text-decoration: underline; 
  text-underline-offset: 2px; 
}

/* Danger variant for icon-only buttons */
.icon-btn.danger { 
  border-color: rgba(255,99,99,0.35); 
  color: #ffdede; 
  background: rgba(255,77,77,0.10); 
}

.icon-btn.danger:hover { 
  background: rgba(255,77,77,0.18); 
  border-color: rgba(255,99,99,0.55); 
}

.icon-btn.danger.del-import {
  width: 34px; 
  height: 34px; 
  border-radius: 10px;
  display: inline-flex; 
  align-items: center; 
  justify-content: center;
  border: 1px solid rgba(255,99,99,.35);
  background: rgba(255,77,77,.10); 
  color: #ffdede;
}

.icon-btn.danger.del-import:hover {
  background: rgba(255,77,77,.18);
  border-color: rgba(255,99,99,.55);
}

/* ===== THEMED BUTTONS ===== */
button.themed-btn, 
.themed-btn {
  display: inline-flex; 
  align-items: center; 
  gap: 10px;
  padding: 10px 14px; 
  border: 1px solid var(--border); 
  border-radius: 12px;
  background: rgba(255,255,255,0.04); 
  color: #fff; 
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .05s ease;
  line-height: 1; 
  font-weight: 600;
  -webkit-appearance: none; 
  appearance: none;
  box-shadow: none; 
  outline: none; 
  text-shadow: none;
  font: inherit;
  color: var(--text, #e6e6e6);
  border-radius: 14px;
  padding: 12px 18px;
  white-space: nowrap;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
}

.themed-btn svg { 
  width: 18px; 
  height: 18px; 
}

button.themed-btn:disabled { 
  opacity: .5; 
  cursor: not-allowed; 
}

.themed-btn:hover { 
  background: rgba(255,255,255,0.08); 
  border-color: var(--border-strong, #3a3f4d); 
  background: rgba(255,255,255,0.10); 
  border-color: rgba(255,255,255,0.18); 
}

.themed-btn:active { 
  transform: translateY(1px); 
}

/* Primary themed button */
.themed-btn.primary {
  background: #2f3542;
  border: 1px solid rgba(255,255,255,0.08);
  color: #eaecef;
  background: #3a4152;
  border-color: rgba(255,255,255,.12);
  font-weight: 600;
}

.themed-btn.primary:hover { 
  background: #3a4152; 
  background: #465064;
}

.themed-btn.primary svg { 
  width: 18px; 
  height: 18px; 
  margin-right: 10px; 
}

.themed-btn.primary span { 
  font-weight: 600; 
}

/* Danger themed button */
.themed-btn.danger { 
  border-color: #ff6b6b33; 
  color: #ffdede; 
  background: rgba(255,77,77,0.10); 
  border-color: rgba(255,99,99,0.35); 
  color: #ffdede; 
  background: rgba(255,77,77,0.10); 
}

.themed-btn.danger:hover { 
  background: rgba(178,74,74,0.18); 
  background: rgba(255,77,77,0.18); 
  border-color: rgba(255,99,99,0.55); 
}

/* File button variant */
.themed-btn.file-btn {
  display: flex; 
  flex-direction: row; 
  align-items: center; 
  gap: 12px;
  padding: 14px 18px;
  min-width: 300px;
  height: 76px; 
  min-height: 76px;
  padding-right: 16px !important;
}

.themed-btn.file-btn .txt { 
  display: flex; 
  flex-direction: column; 
  line-height: 1.1; 
}

.themed-btn.file-btn .txt .title { 
  font-weight: 700; 
  font-size: 16px; 
}

.themed-btn.file-btn .txt .sub { 
  font-size: 12px; 
  opacity: .7; 
  margin-top: 4px; 
}

.themed-btn.file-btn svg { 
  width: 20px; 
  height: 20px; 
  opacity: .9; 
}

/* Icon-only themed button */
.themed-btn.icon-only { 
  padding: 0 18px; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  min-width: 56px; 
  min-height: 56px;
  width: 76px; 
  height: 76px; 
  margin-top: 7px;
}

/* Text style buttons */
.icon-btn[id*="AllCaps"] span,
.icon-btn[id*="AllLower"] span {
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.icon-btn[id*="AllCaps"] span {
  letter-spacing: 0.5px;
  font-weight: 700;
}

.icon-btn[id*="AllLower"] span {
  letter-spacing: 0.3px;
  font-weight: 700;
}

.themed-btn.icon-only svg { 
  width: 24px; 
  height: 24px; 
}

/* ===== FONT SCREEN BUTTONS ===== */
.fonts-screen .btn { 
  appearance: none; 
  border: 1px solid var(--button-border); 
  background: var(--button-bg); 
  color: var(--button-text); 
  border-radius: 10px; 
  padding: 8px 12px; 
  display: inline-flex; 
  align-items: center; 
  gap: 8px; 
  cursor: pointer; 
}

.fonts-screen .btn.primary { 
  background: #22314a; 
  border-color: #30425f; 
  color: #fff; 
}

#fontsImportBtn {
  height: 45px;
  margin-bottom: 20px;
}
