/* ==========================================================================
   PiliApp.org V2 - Tools, Generators & Calculators CSS
   ========================================================================== */

/* Tool Canvas & Controls */
.tool-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}

/* Big Input Box for Text Generators */
.generator-input-wrapper {
  position: relative;
  margin-bottom: 1.5rem;
}

.generator-input {
  width: 100%;
  min-height: 56px;
  padding: 0.85rem 1.25rem;
  font-size: 1.15rem;
  font-family: inherit;
  color: var(--text-main);
  background: var(--bg-page);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.generator-input:focus {
  border-color: var(--accent-pink);
  box-shadow: var(--shadow-glow);
  background: #ffffff;
}

/* Font Generator Result Cards */
.font-results-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.font-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.font-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  transform: translateX(3px);
  background: #faf5ff;
}
.font-card:active {
  transform: scale(0.99);
}

.font-card-left {
  flex: 1;
  min-width: 0;
}
.font-card-name {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  margin-bottom: 0.25rem;
}
.font-card-text {
  font-size: 1.25rem;
  color: var(--text-main);
  word-break: break-word;
  white-space: normal;
  line-height: 1.4;
}

.font-card-copy-btn {
  background: var(--gradient-brand);
  color: #ffffff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s ease;
}
.font-card:hover .font-card-copy-btn {
  opacity: 0.9;
}

/* Tool Form Groups (Calculator, Password, RNG) */
.tool-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 768px) {
  .tool-grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.calc-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}
.calc-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-main);
}

.form-group {
  margin-bottom: 1rem;
}
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  color: var(--text-main);
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s ease;
}
.form-control:focus {
  border-color: var(--accent-pink);
  box-shadow: 0 0 0 3px rgba(233, 64, 87, 0.15);
}

/* Universal Tool Buttons */
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.35rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1.4;
  box-sizing: border-box;
  text-align: center;
  vertical-align: middle;
}

.btn-primary {
  background: var(--gradient-brand);
  color: #ffffff !important;
  border: 1px solid transparent;
  box-shadow: 0 2px 6px rgba(233, 64, 87, 0.25);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(233, 64, 87, 0.35);
  opacity: 0.96;
  color: #ffffff !important;
}
.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: var(--bg-surface, #ffffff);
  color: var(--text-dark, #1e293b);
  border: 1px solid var(--border-color, #e2e8f0);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.btn-secondary:hover {
  background: var(--bg-subtle, #f8fafc);
  border-color: var(--primary, #e94057);
  color: var(--primary, #e94057);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.btn-secondary:active {
  transform: scale(0.98);
}
.btn-secondary.active {
  background: var(--gradient-brand);
  color: #ffffff !important;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(233, 64, 87, 0.25);
}

.btn-full {
  width: 100%;
}

/* Tool Filter & Mode Buttons */
.nick-filter-btn {
  padding: 0.45rem 1rem !important;
  font-size: 0.875rem !important;
  border-radius: var(--radius-full) !important;
}
.nick-filter-btn.active {
  background: var(--gradient-brand) !important;
  color: #ffffff !important;
  border-color: transparent !important;
}

.translit-mode-btn {
  padding: 0.45rem 0.9rem !important;
  font-size: 0.85rem !important;
  border-radius: var(--radius-sm) !important;
}
.translit-mode-btn.active {
  background: var(--gradient-brand) !important;
  color: #ffffff !important;
  border-color: transparent !important;
}

.btn-copy-row {
  padding: 0.35rem 0.75rem !important;
  font-size: 0.8rem !important;
  border-radius: var(--radius-sm) !important;
}

.calc-result-box {
  margin-top: 1.25rem;
  padding: 1rem;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  text-align: center;
}
.calc-result-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary);
  margin-top: 0.25rem;
}

/* Password Generator Specifics */
.password-display-box {
  background: #ffffff;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.password-text {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  color: var(--text-main);
  word-break: break-all;
  font-weight: 600;
}
.password-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}
.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-pink);
  cursor: pointer;
}

/* Range Slider */
.slider-group {
  margin-bottom: 1.5rem;
}
.slider-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-weight: 600;
}
.slider-input {
  width: 100%;
  height: 6px;
  accent-color: var(--accent-pink);
  cursor: pointer;
}

/* Shrug Emoji Showcase */
.shrug-hero-card {
  background: #ffffff;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  margin-bottom: 2rem;
  transition: all 0.2s ease;
}
.shrug-hero-symbol {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: block;
}

/* Search Bar on Emojis & Symbols */
.search-wrapper {
  margin-bottom: 1.5rem;
  position: relative;
}
.search-input {
  width: 100%;
  padding: 0.85rem 1.25rem 0.85rem 2.85rem;
  font-size: 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-full);
  outline: none;
  background-color: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.search-input:focus {
  border-color: var(--accent-pink);
  box-shadow: var(--shadow-glow);
}
.search-icon {
  position: absolute;
  left: 1.15rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.15rem;
  color: var(--text-light);
  pointer-events: none;
}

/* ==========================================================================
   NEW PILIAPP SUITE TOOLS (STOPWATCH, TIMER, RULER, COIN, DICE, COUNTER, QR)
   ========================================================================== */

/* 1. Stopwatch & Countdown Timer */
.timer-hero-display {
  font-family: var(--bs-font-monospace, monospace);
  font-size: 3.5rem;
  font-weight: 700;
  text-align: center;
  color: var(--text-main);
  padding: 1.5rem 0;
  letter-spacing: 0.05em;
}
@media (min-width: 640px) {
  .timer-hero-display {
    font-size: 5rem;
  }
}
.timer-controls {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.btn-timer {
  padding: 0.85rem 1.75rem;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: 120px;
}
.btn-timer-start {
  background: var(--gradient-brand);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(233, 64, 87, 0.3);
}
.btn-timer-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(233, 64, 87, 0.4);
}
.btn-timer-pause {
  background: #f59e0b;
  color: #ffffff;
}
.btn-timer-lap {
  background: #3b82f6;
  color: #ffffff;
}
.btn-timer-reset {
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}
.btn-timer-reset:hover {
  color: #ef4444;
  border-color: #ef4444;
}

/* Laps Table */
.laps-container {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-top: 1rem;
}
.laps-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}
.laps-table th, .laps-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border-color);
}
.laps-table th {
  background: var(--bg-body);
  font-weight: 700;
  color: var(--text-muted);
}
.lap-fastest {
  color: #10b981;
  font-weight: 700;
}
.lap-slowest {
  color: #ef4444;
  font-weight: 700;
}

/* Preset Pills */
.timer-presets {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.timer-preset-btn {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  background: var(--gradient-subtle);
  border: 1px solid rgba(233, 64, 87, 0.2);
  color: var(--primary);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.timer-preset-btn:hover {
  background: rgba(233, 64, 87, 0.15);
}

/* 2. Word & Character Counter Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
  transition: border-color 0.15s ease;
}
.stat-card:hover {
  border-color: var(--primary);
}
.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
  margin-bottom: 0.25rem;
}
.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* 3. Case Converter Buttons */
.case-buttons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.65rem;
  margin-top: 1rem;
}
.btn-case {
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}
.btn-case:hover {
  border-color: var(--primary);
  background: var(--gradient-subtle);
  color: var(--primary);
  transform: translateY(-2px);
}

/* 4. Invisible Character Hub Cards */
.invisible-char-card {
  background: var(--bg-surface);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  text-align: center;
  margin-bottom: 1.5rem;
  transition: border-color 0.2s ease;
}
.invisible-char-card:hover {
  border-color: var(--primary);
}
.invisible-preview-box {
  width: 100%;
  height: 90px;
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  user-select: all;
}

/* 5. 3D Coin Flip Simulator */
.coin-stage {
  perspective: 1000px;
  width: 160px;
  height: 160px;
  margin: 1.5rem auto;
}
.coin {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.coin-face {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 800;
  text-transform: uppercase;
  backface-visibility: hidden;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15), inset 0 0 0 6px rgba(255,255,255,0.4);
}
.coin-heads {
  background: linear-gradient(135deg, #f59e0b, #d97706, #fbbf24);
  color: #78350f;
}
.coin-tails {
  background: linear-gradient(135deg, #94a3b8, #64748b, #cbd5e1);
  color: #1e293b;
  transform: rotateY(180deg);
}
.coin.flipping {
  animation: flipCoin 1.2s ease-out forwards;
}
@keyframes flipCoin {
  0% { transform: rotateY(0) scale(1); }
  50% { transform: rotateY(900deg) scale(1.3) translateY(-40px); }
  100% { transform: rotateY(1800deg) scale(1) translateY(0); }
}

/* 6. 3D Dice Roller */
.dice-container {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin: 1.5rem 0;
}
.dice-box {
  width: 72px;
  height: 72px;
  background: #ffffff;
  border: 2px solid var(--border-color);
  border-radius: 14px;
  box-shadow: 0 6px 14px rgba(0,0,0,0.08);
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  padding: 8px;
  position: relative;
  transition: transform 0.15s ease;
}
.dice-box.rolling {
  animation: rollDice 0.6s ease-in-out forwards;
}
@keyframes rollDice {
  0% { transform: rotate(0) scale(1); }
  25% { transform: rotate(-25deg) scale(1.1); }
  50% { transform: rotate(25deg) scale(1.1); }
  75% { transform: rotate(-10deg) scale(1.05); }
  100% { transform: rotate(0) scale(1); }
}
.dice-dot {
  width: 12px;
  height: 12px;
  background: #e11d48;
  border-radius: 50%;
  align-self: center;
  justify-self: center;
}

/* 7. Actual Size Screen Ruler */
.ruler-viewport {
  width: 100%;
  overflow-x: auto;
  border: 2px solid #334155;
  border-radius: var(--radius-md);
  background: #fef08a;
  box-shadow: var(--shadow-md);
  margin: 1.5rem 0;
  position: relative;
}
.ruler-scale {
  height: 120px;
  position: relative;
  user-select: none;
}
.ruler-tick {
  position: absolute;
  bottom: 0;
  width: 1px;
  background: #1e293b;
}
.ruler-tick.major {
  height: 35px;
  width: 1.5px;
}
.ruler-tick.medium {
  height: 22px;
}
.ruler-tick.minor {
  height: 12px;
}
.ruler-label {
  position: absolute;
  top: 15px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #1e293b;
  transform: translateX(-50%);
}

/* 8. QR Code Generator */
.qr-preview-box {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  margin-bottom: 1.25rem;
}
