:root {
  --primary-color: #4338ca; /* Slightly adjusted primary color */
  --primary-hover: #3730a3;
  --secondary-color: #0ea5e9; /* Changed to a nice blue */
  --light-bg: #f8fafc;
  --light-card: #ffffff;
  --light-text: #1e293b;
  --light-border: #e2e8f0;
  --dark-bg: #0f172a; /* Deeper dark background */
  --dark-card: #1e293b;
  --dark-text: #f8fafc;
  --dark-border: #334155;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; /* Using Inter font */
  background-color: var(--light-bg);
  color: var(--light-text);
  transition: var(--transition);
  line-height: 1.5;
}

body.dark-mode {
  background-color: var(--dark-bg);
  color: var(--dark-text);
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header {
  background-color: var(--primary-color);
  color: white;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo h1 {
  font-size: 1.8rem;
  font-weight: 700;
  animation: fadeInDown 0.6s ease-out;
  position: relative;
}

.logo h1::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: white;
  transition: width 0.3s ease;
}

.logo h1:hover::after {
  width: 100%;
}

.search-container {
  display: flex;
  flex: 1;
  max-width: 500px;
  margin: 0 2rem;
  position: relative;
  animation: fadeIn 0.8s ease-out;
}

/* Improve the search bar text color and overall styling */
.search-container input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 4px 0 0 4px;
  font-size: 1rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) inset;
  transition: all 0.3s ease;
  color: #333; /* Darker text color for better readability */
}

.search-container input::placeholder {
  color: #666; /* Darker placeholder text */
}

.dark-mode .search-container input {
  color: #f0f0f0; /* Lighter text in dark mode */
  background-color: #2d3748; /* Darker background in dark mode */
}

.dark-mode .search-container input::placeholder {
  color: #aaa; /* Lighter placeholder in dark mode */
}

.search-container button {
  background-color: white;
  color: var(--primary-color);
  border: none;
  padding: 0 1rem;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  transition: all 0.3s ease;
}

.dark-mode .search-container button {
  background-color: #4a5568;
  color: white;
}

/* Improve search suggestions */
.search-suggestions {
  border-radius: 0 0 8px 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid #eee;
  border-top: none;
}

.dark-mode .search-suggestions {
  border-color: #4a5568;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.search-suggestion-item {
  padding: 12px 15px !important;
  border-bottom: 1px solid #eee;
}

.search-suggestion-item:last-child {
  border-bottom: none;
}

.theme-toggle button {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

.theme-toggle button:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: rotate(15deg);
}

/* Main Content */
main {
  padding: 2rem 0;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

/* Enhanced card styling */
.tool-card {
  background-color: var(--light-card);
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 10px 15px -3px rgba(0, 0, 0, 0.03);
  overflow: hidden;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  border: 1px solid var(--light-border);
  position: relative;
  z-index: 1;
}

.dark-mode .tool-card {
  background-color: var(--dark-card);
  border-color: var(--dark-border);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.tool-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.tool-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  opacity: 0;
  border-radius: 12px;
  transform: scale(0.9);
  transition: all 0.4s ease;
}

.tool-card:hover::before {
  opacity: 0.05;
  transform: scale(1);
}

/* Enhanced tool icon */
.tool-icon {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  padding: 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.tool-icon::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: -100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: all 0.6s ease;
}

.tool-card:hover .tool-icon::after {
  left: 100%;
}

.tool-icon i {
  font-size: 2.5rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  transition: all 0.4s ease;
}

.tool-card:hover .tool-icon i {
  transform: scale(1.2);
}

.tool-info {
  padding: 1.5rem;
}

.tool-info h3 {
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
  position: relative;
  display: inline-block;
}

.tool-info h3::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}

.tool-card:hover .tool-info h3::after {
  width: 100%;
}

.tool-info p {
  color: #6b7280;
  font-size: 0.9rem;
  line-height: 1.5;
}

.dark-mode .tool-info p {
  color: #d1d5db;
}

/* Modal */
.tool-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(5px);
}

.tool-modal.active {
  display: flex;
  animation: modalFadeIn 0.4s forwards;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Enhanced modal */
.modal-content {
  background-color: var(--light-card);
  border-radius: 16px;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: modalSlideIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid var(--light-border);
}

.dark-mode .modal-content {
  background-color: var(--dark-card);
  border-color: var(--dark-border);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--light-border);
  position: relative;
}

.modal-header::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, var(--primary-color), transparent);
}

.dark-mode .modal-header {
  border-color: var(--dark-border);
}

.modal-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  animation: fadeInRight 0.5s ease;
}

.modal-header button {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--light-text);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.dark-mode .modal-header button {
  color: var(--dark-text);
}

.modal-header button:hover {
  background-color: rgba(0, 0, 0, 0.05);
  transform: rotate(90deg);
}

.dark-mode .modal-header button:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.modal-body {
  padding: 1.5rem;
}

/* Tool Content Styles */
.tool-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: fadeIn 0.5s ease;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-group label {
  font-weight: 500;
  position: relative;
  display: inline-block;
  margin-bottom: 0.3rem;
}

.input-group label::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 30px;
  height: 2px;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}

.input-group:hover label::after {
  width: 50px;
}

/* Enhanced input fields */
.input-group input,
.input-group textarea,
.input-group select {
  padding: 0.75rem 1rem;
  border: 1px solid var(--light-border);
  border-radius: 8px;
  font-size: 1rem;
  background-color: var(--light-card);
  color: var(--light-text);
  transition: all 0.3s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.2);
  transform: translateY(-1px);
}

.dark-mode .input-group input,
.dark-mode .input-group textarea,
.dark-mode .input-group select {
  border-color: var(--dark-border);
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--dark-text);
}

/* Enhanced buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.025em;
}

.btn::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: -100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: all 0.6s ease;
}

.btn:hover::after {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  box-shadow: 0 4px 6px -1px rgba(67, 56, 202, 0.2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(67, 56, 202, 0.3);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--secondary-color), #0284c7);
  color: white;
  box-shadow: 0 4px 6px -1px rgba(14, 165, 233, 0.2);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(14, 165, 233, 0.3);
}

/* Enhanced result box */
.result-box {
  background-color: rgba(0, 0, 0, 0.03);
  padding: 1.25rem;
  border-radius: 8px;
  font-family: "Fira Code", "Consolas", monospace; /* Better monospace font */
  white-space: pre-wrap;
  word-break: break-all;
  transition: all 0.3s ease;
  border-left: 3px solid var(--primary-color);
  line-height: 1.6;
}

.dark-mode .result-box {
  background-color: rgba(255, 255, 255, 0.03);
}

/* Footer */
/* Improved footer */
footer {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  padding: 2rem 0;
  text-align: center;
  margin-top: 3rem;
  position: relative;
  overflow: hidden;
}

footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
}

/* Animations */
/* Enhanced animations */
@keyframes modalSlideIn {
  from {
    transform: translateY(-30px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.fade-in {
  animation: fadeIn 0.5s ease;
}

/* Tool-specific animations */
/* Enhanced tool card animations */
.tool-card {
  animation: toolCardAppear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

@keyframes toolCardAppear {
  from {
    transform: scale(0.8) translateY(20px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* Animation delay for tool cards */
.tools-grid {
  perspective: 800px;
}

.tool-card:nth-child(1) {
  animation-delay: 0.1s;
}
.tool-card:nth-child(2) {
  animation-delay: 0.15s;
}
.tool-card:nth-child(3) {
  animation-delay: 0.2s;
}
.tool-card:nth-child(4) {
  animation-delay: 0.25s;
}
.tool-card:nth-child(5) {
  animation-delay: 0.3s;
}
.tool-card:nth-child(6) {
  animation-delay: 0.35s;
}
.tool-card:nth-child(7) {
  animation-delay: 0.4s;
}
.tool-card:nth-child(8) {
  animation-delay: 0.45s;
}
.tool-card:nth-child(9) {
  animation-delay: 0.5s;
}
.tool-card:nth-child(10) {
  animation-delay: 0.55s;
}
.tool-card:nth-child(11) {
  animation-delay: 0.6s;
}
.tool-card:nth-child(12) {
  animation-delay: 0.65s;
}

/* Search suggestions */
.search-suggestion-item {
  transition: all 0.2s ease;
}

.search-suggestion-item:hover {
  background-color: #f5f7ff !important;
}

.dark-mode .search-suggestion-item:hover {
  background-color: #2d3748 !important;
}

.dark-mode .search-suggestions {
  background-color: var(--dark-card) !important;
}

.dark-mode .search-suggestion-item {
  border-color: var(--dark-border) !important;
}

.dark-mode .search-suggestion-item div:last-child {
  color: #9ca3af !important;
}

/* Responsive */
/* Responsive improvements */
@media (max-width: 768px) {
  header .container {
    flex-direction: column;
    gap: 1rem;
  }

  .search-container {
    width: 100%;
    max-width: none;
    margin: 0;
  }

  .theme-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
  }

  .tool-card {
    animation-delay: 0.1s !important;
  }

  .modal-content {
    width: 95%;
    max-height: 85vh;
  }

  .btn {
    padding: 0.7rem 1.2rem;
  }
}

