.json-key {
  color: #0d6efd;
}

.json-string {
  color: #198754;
}

.json-number {
  color: #fd7e14;
}

.json-boolean {
  color: #d63384;
}

.json-null {
  color: gray;
}
.node {
  cursor: pointer;
  user-select: none;
  margin-left: 15px;
}

.toggle {
  font-weight: bold;
  margin-right: 5px;
}

.hidden {
  display: none;
}
:root {
  --bg: #f7f6f3;
  --card: #ffffff;
  --accent: #c49a4a;
  --muted: #6c757d;
  --navy: #0f2133;
}
ul {
  padding-left: 15px;
}

.node {
  cursor: pointer;
}

.toggle {
  cursor: pointer;
  margin-right: 4px;
}

.hidden {
  display: none;
}

body {
  background: linear-gradient(180deg, #fbfaf7 0%, #f1efe8 100%);
  font-family: "Inter", sans-serif;
  color: var(--navy);
  min-height: 100vh;
}

.tool-link {
  text-decoration: none;
  color: #333;
}

.navbar-nav {
  gap: 20px;
}

.navbar {
  background: linear-gradient(90deg, #0f2133, #1a334f);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
  font-family: "Merriweather", serif;
  font-weight: 700;
  color: white !important;
}

.nav-link {
  color: white !important;
  font-weight: 500;
}

.hero {
  background: linear-gradient(135deg, #fff, #f9f7f3);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  padding: 40px;
}

.tool-card {
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  padding: 24px;
  cursor: pointer;
}

.tool-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.tool-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #f0d595);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  margin-right: 14px;
}

footer {
  margin-top: 60px;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
  padding-bottom: 30px;
}

.calc-display {
  overflow: hidden;
  resize: none;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 40px;
  max-height: 1000px;
}

.history-item {
  padding: 6px 8px;
  border-bottom: 1px dashed #e7e7e7;
  font-size: 0.95rem;
}

.calculator button {
  font-size: 1.1rem;
  padding: 12px;
  border-radius: 8px;
  font-weight: 600;
}

.calculator .btn-light {
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  border: 1px solid #dee2e6;
}

.calculator .btn-light:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
  transition: all 0.2s ease;
}

.calc-display {
  overflow-x: auto;
  overflow-y: hidden;
  white-space: pre-wrap;
  word-wrap: break-word;
  min-height: 50px;
  max-height: 200px;
  height: auto;
  resize: none;
  line-height: 1.4;
  transition: height 0.2s ease;
}

.history-item {
  background: #f8f9fa;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 5px;
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
}

.tool-section {
  display: none;
}

.password-output {
  font-family: "Courier New", monospace;
  font-size: 1.2rem;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  word-break: break-all;
}

.strength-bar {
  height: 8px;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.strength-weak {
  background: #dc3545;
  width: 33%;
}

.strength-medium {
  background: #ffc107;
  width: 66%;
}

.strength-strong {
  background: #28a745;
  width: 100%;
}

/* Image compressor styles */
.img-compress-preview {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  display: block;
  margin-bottom: 10px;
}

.quality-btn-group .btn {
  min-width: 90px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

#jsonBox {
  width: 100%;
  min-height: 520px;
  max-height: 600px;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: monospace;
  font-size: 15px;
  line-height: 1.45;
  resize: vertical;
  background: #fff;
}

/* whole json viewer height */
.json-viewer {
  height: 420px; /* same feel as textarea */
}

/* left & right panels */
.json-panel {
  height: 100%;
  padding: 6px;
}

/* actual scroll area */
.json-scroll {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  background: #fafafa;
  border-radius: 4px;
  padding: 8px;
}

#jsonViewerSection .d-flex.gap-2 {
  align-items: center;
}

@media (max-width: 576px) {
  #jsonInput,
  #jsonOutput {
    min-height: 220px;
  }
}
/* Mobile Search reposition */
@media (max-width: 768px) {
  /* Hero layout normal rahe */
  .hero {
    padding-bottom: 100px;
    /* space for bottom search */
  }

  /* Search ko bottom bhejo */
  @media (max-width: 768px) {
    #heroSearch {
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      /*  MOST IMPORTANT */
      width: 100vw;
      /*  FULL SCREEN WIDTH */
      margin: 0;
      padding: 12px;
      background: #ffffff;
      box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.08);
      z-index: 999;
      border-radius: 0;
    }
    #footer {
      margin-bottom: 40px;
    }
    .json-btn-group {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 2px;
    }

    .json-btn-group .btn {
      min-width: 70px;
      /* buttons equal size */
    }
  }

  #heroSearch .form-control {
    border-radius: 6px 0 0 6px;
  }

  #heroSearch .btn {
    border-radius: 0 6px 6px 0;
  }
  .border-md-end {
    border-right: 1px solid #dee2e6;
  }
}
