body {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #0d1117, #1f252d);
  color: #ffffff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: all 0.5s ease;
}
.top-bar {
  background: rgba(22, 27, 34, 0.9);
  backdrop-filter: blur(10px);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  position: sticky;
  top: 0;
  z-index: 10;
}
.top-bar h1 {
  font-size: clamp(1.2rem, 4vw, 1.5rem);
}
.status-bar {
  background: #1f252d;
  padding: 0.5rem 2rem;
  font-size: clamp(0.7rem, 2vw, 0.9rem);
  color: #ffcc00;
  display: flex;
  justify-content: space-between;
}
.ticker {
  background: #1f252d;
  padding: 0.5rem 2rem;
  font-size: clamp(0.7rem, 2vw, 0.9rem);
  color: #ffcc00;
  overflow: hidden;
  white-space: nowrap;
  position: sticky;
  top: clamp(3rem, 10vw, 4rem);
  z-index: 9;
}
.ticker span {
  display: inline-block;
  padding-right: 1rem;
  animation: ticker 20s linear infinite;
}
@keyframes ticker {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}
.overview {
  padding: 2rem;
  background: rgba(22, 27, 34, 0.8);
  border-radius: 12px;
  margin: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}
.overview-item {
  text-align: center;
  animation: fadeIn 0.5s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.container {
  display: flex;
  flex: 1;
  flex-direction: row;
  gap: 1rem;
}
.sidebar {
  width: clamp(200px, 20vw, 300px);
  background: rgba(22, 27, 34, 0.9);
  backdrop-filter: blur(10px);
  padding: 1rem;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
  transition: width 0.3s ease, transform 0.3s ease;
  overflow-y: auto;
}
.sidebar.collapsed {
  width: clamp(50px, 10vw, 60px);
  padding: 1rem 0.5rem;
}
.sidebar.collapsed .sidebar-btn span, .sidebar.collapsed #tool-search {
  display: none;
}
#tool-search {
  width: 100%;
  padding: 0.8rem;
  margin-bottom: 1rem;
  border: none;
  border-radius: 8px;
  background: rgba(13, 17, 23, 0.9);
  color: #fff;
  font-size: clamp(0.9rem, 2vw, 1rem);
}
.sidebar-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #1f252d;
  color: #ffcc00;
  border: none;
  padding: 0.8rem;
  margin-bottom: 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: clamp(0.8rem, 2vw, 1rem);
  transition: all 0.3s ease;
  position: relative;
}
.sidebar-btn.active, .sidebar-btn:hover {
  background: linear-gradient(90deg, #ffcc00, #ffb300);
  color: #121212;
  transform: scale(1.02);
}
.sidebar-btn.favorite {
  border: 2px solid #ff5555;
}
.sidebar-btn.hidden {
  display: none;
}
.sidebar-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  background: #333;
  color: #fff;
  padding: 0.3rem 0.6rem;
  border-radius: 5px;
  font-size: clamp(0.7rem, 1.5vw, 0.9rem);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
}
.sidebar.collapsed .sidebar-btn:hover::after {
  opacity: 1;
  visibility: visible;
}
.main-content {
  flex: 1;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.pinned-tools, .all-tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(clamp(300px, 45vw, 400px), 1fr));
  gap: 1rem;
}
.tool-card {
  background: rgba(22, 27, 34, 0.8);
  backdrop-filter: blur(10px);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 204, 0, 0.1);
  animation: slideUp 0.5s ease;
  position: relative;
}
.tool-card.collapsed .tool-form, .tool-card.collapsed .result, .tool-card.collapsed .history, .tool-card.collapsed .error {
  display: none;
}
.tool-card.collapsed h2 {
  margin: 0;
}
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.tool-card h2 {
  margin: 0 0 1rem;
  font-size: clamp(1rem, 3vw, 1.2rem);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 204, 0, 0.2);
}
.tool-actions {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  gap: 0.3rem;
}
.tool-actions button {
  background: none;
  color: #ffcc00;
  padding: 0.3rem;
  font-size: clamp(0.7rem, 1.5vw, 0.9rem);
  transition: color 0.2s ease;
}
.tool-actions button:hover {
  color: #ffb300;
}
.tool-form {
  display: grid;
  gap: 0.8rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  position: relative;
}
label {
  font-size: clamp(0.8rem, 2vw, 0.9rem);
  color: #ccc;
}
label::after {
  content: attr(data-tooltip);
  position: absolute;
  top: -1.5rem;
  left: 0;
  background: #333;
  color: #fff;
  padding: 0.2rem 0.5rem;
  border-radius: 5px;
  font-size: clamp(0.6rem, 1.5vw, 0.8rem);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
}
label:hover::after {
  opacity: 1;
  visibility: visible;
}
select, input {
  padding: 0.8rem;
  border: none;
  border-radius: 8px;
  background: rgba(13, 17, 23, 0.9);
  color: #fff;
  font-size: clamp(0.9rem, 2vw, 1rem);
  transition: box-shadow 0.3s ease;
}
input:focus, select:focus {
  outline: none;
  box-shadow: 0 0 5px #ffcc00;
}
.btn-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
button {
  background: linear-gradient(90deg, #ffcc00, #ffb300);
  color: #121212;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  font-size: clamp(0.8rem, 2vw, 1rem);
  transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}
button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.result {
  margin-top: 0.8rem;
  padding: 0.8rem;
  background: #1f252d;
  border-radius: 8px;
  font-size: clamp(0.9rem, 2vw, 1rem);
  color: #ffcc00;
}
.history {
  margin-top: 0.8rem;
  font-size: clamp(0.7rem, 1.5vw, 0.8rem);
  color: #ccc;
  max-height: 100px;
  overflow-y: auto;
  background: #1f252d;
  padding: 0.8rem;
  border-radius: 8px;
  position: relative;
}
.history button {
  position: absolute;
  top: 0.3rem;
  right: 0.3rem;
  padding: 0.3rem;
  font-size: clamp(0.6rem, 1.5vw, 0.8rem);
}
.error {
  color: #ff5555;
  font-size: clamp(0.7rem, 1.5vw, 0.9rem);
  margin-top: 0.3rem;
}
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  justify-content: center;
  align-items: center;
  z-index: 20;
}
.modal-content {
  background: rgba(22, 27, 34, 0.9);
  backdrop-filter: blur(10px);
  padding: 1.5rem;
  border-radius: 12px;
  max-width: 90%;
  width: clamp(300px, 50vw, 500px);
  text-align: center;
  animation: slideUp 0.5s ease;
}
.notification {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  background: rgba(255, 85, 85, 0.9);
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  color: #fff;
  font-size: clamp(0.9rem, 2vw, 1rem);
  animation: slideInRight 0.3s ease;
  z-index: 30;
}
@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
footer {
  background: rgba(22, 27, 34, 0.9);
  backdrop-filter: blur(10px);
  color: #ffcc00;
  text-align: center;
  padding: 1rem;
  font-size: clamp(0.8rem, 2vw, 1rem);
}
.light-mode {
  background: linear-gradient(135deg, #f0f0f0, #ffffff);
  color: #0d1117;
}
.light-mode .sidebar, .light-mode .tool-card, .light-mode .top-bar, .light-mode footer, .light-mode .status-bar, .light-mode .modal-content, .light-mode .overview, .light-mode .ticker {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.light-mode input, .light-mode select, .light-mode .history {
  background: rgba(240, 240, 240, 0.9);
  color: #0d1117;
}
.light-mode .result {
  background: #e0e0e0;
  color: #cc8500;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .container {
      flex-direction: column;
  }
  .sidebar {
      width: 100%;
      max-height: 50vh;
      transform: translateY(-100%);
      position: fixed;
      top: 0;
      left: 0;
      z-index: 11;
  }
  .sidebar.collapsed {
      transform: translateY(0);
      max-height: clamp(50px, 15vh, 60px);
  }
  .main-content {
      padding: 1rem;
      margin-top: clamp(60px, 15vh, 70px);
  }
  .pinned-tools, .all-tools {
      grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

@media (max-width: 768px) {
  .overview {
      grid-template-columns: 1fr;
      margin: 1rem;
      padding: 1rem;
  }
  .top-bar {
      padding: 0.8rem 1rem;
      flex-direction: column;
      gap: 0.5rem;
  }
  .top-bar div {
      display: flex;
      flex-wrap: wrap;
      gap: 0.5rem;
  }
  .pinned-tools, .all-tools {
      grid-template-columns: 1fr;
  }
  .tool-card {
      padding: 1rem;
  }
  .modal-content {
      padding: 1rem;
  }
}

@media (max-width: 480px) {
  .top-bar h1 {
      font-size: 1rem;
  }
  .status-bar, .ticker {
      padding: 0.3rem 1rem;
  }
  .tool-form {
      gap: 0.5rem;
  }
  button {
      padding: 0.6rem 1rem;
  }
}