* {
  box-sizing: border-box;
}

body {
  font-family: "Arial", sans-serif;
  background-color: #f8f9fa;
  margin: 0;
  padding: 20px;
}

h1 {
  text-align: center;
  font-weight: bold;
  margin-bottom: 20px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(373px, 1fr));
  grid-auto-rows: 1fr;
  gap: 20px;
  width: 90vw;
  max-width: 95%;
  padding: 20px;
  justify-content: center;
  margin: 0 auto;
}

.tool-box {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.3s, box-shadow 0.3s;
  min-height: 400px;
  background: linear-gradient(to bottom right, #ffffff, #f9f9f9);
  border: 1px solid #e6e6e6;
}

.tool-box:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.tool-box h2 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 auto;
  margin-bottom: 10px;
}

.tool-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tool-actions {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

input,
textarea,
select,
button,
.custom-file-upload,
.download-link {
  padding: 12px;
  border-radius: 5px;
  border: 1px solid #ced4da;
  margin-bottom: 15px;
  width: 100%;
  box-sizing: border-box;
  font-size: 1rem;
  font-weight: bold;
  font-family: inherit;
  line-height: 1.4;
  text-align: center;
}

.custom-file-upload {
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: bold;
}

input:focus,
textarea:focus,
select:focus,
button:hover,
.custom-file-upload:hover {
  border-color: #80bdff;
  outline: none;
}

button,
.custom-file-upload {
  background-color: #4f45e4;
  color: white;
  cursor: pointer;
  transition: background-color 0.3s;
  margin-top: 10px;
}

button:hover,
.custom-file-upload:hover {
  background-color: #3d35b3;
}

.download-link {
  display: inline-block;
  background-color: #2fc2a0;
  color: white;
  padding: 12px;
  border-radius: 5px;
  text-decoration: none;
  text-align: center;
  transition: background-color 0.3s;
}

.download-link::before {
  margin-right: 5px;
}

.download-link:hover {
  background-color: #24967e;
}

#colorPreview {
  width: 100%;
  height: 90%;
  border-radius: 5px;
  margin: 10px 0;
  border: 1px solid #ced4da;
}

textarea {
  resize: vertical;
  min-height: 80px;
  max-height: 150px;
}

.tool-box p {
  margin: 0;
  font-size: 0.95rem;
  color: #444;
}

input,
textarea,
select {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  box-shadow: 0 0 4px rgba(0, 123, 255, 0.25);
}

#qrCode {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  margin: 0 auto;
}

input[type="color"] {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  width: 100%;
  height: 20px;
  border-radius: 100px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  background: none;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: 1px solid #ced4da;
  border-radius: 6px;
  border: none; /* Remove the white border */
}

#color-palette-generator .palette-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.palette-swatch {
  height: 40px;
  border-radius: 4px;
  border: 1px solid #ccc;
  cursor: pointer;
}

#timestampResult {
  margin-top: 10px;
  font-size: 0.95rem;
  color: #444;
  word-break: break-word;
  background-color: #f1f1ff;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  white-space: pre-wrap;
}

#regexResult {
  margin-top: 0px;
  font-size: 0.95rem;
  color: #444;
  white-space: pre-wrap;
  background-color: #f9f9f9;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  height: 50px; /* prevent card from growing too tall */
  overflow-y: auto; /* allow scrolling if content is long */
}

.regex-highlight {
  background-color: #ffe600;
  padding: 0 2px;
  border-radius: 3px;
}

.gradient-preview {
  height: 80px;
  border-radius: 6px;
  margin-top: 10px;
  border: 1px solid #ccc;
}

.shadow-preview {
  height: 80px;
  background-color: white;
  border: 1px solid #ccc;
  margin-top: 10px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: #333;
}

#box-shadow-visualizer .tool-content {
  overflow-y: auto;
  max-height: 100%;
}

#box-shadow-visualizer.tool-box {
  max-height: 513px; /* match your standard height */
}

.section-heading {
  margin-bottom: 10px;
  font-size: 1.5rem;
  text-align: center;
}
.search-input {
  width: 100%;
  max-width: 400px;
  padding: 10px;
  font-size: 1rem;
  margin: 20px 0;
  border-radius: 6px;
  border: 1px solid #ccc;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.search-input:focus {
  outline: none;
  border-color: #4f45e4; /* Add your highlight color */
}

/* Toggle Switch */
.switch {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: relative;
  width: 40px;
  height: 20px;
  background-color: #ccc;
  border-radius: 50px;
  transition: 0.4s;
}

.slider:before {
  content: "";
  position: absolute;
  height: 12px;
  width: 12px;
  border-radius: 50px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
}

input:checked + .slider {
  background-color: #4f45e4;
}

input:checked + .slider:before {
  transform: translateX(20px);
}
/* Dark mode styles */
body.dark-mode {
  background-color: #121212; /* Dark background for body */
  color: #e0e0e0; /* Light text color for readability */
}

/* Tool-box styles for dark mode */
body.dark-mode .tool-box {
  background: linear-gradient(
    to bottom right,
    #2c2c2c,
    #3a3a3a
  ); /* Darker background for tool boxes */
  border: 1px solid #555; /* Lighter border */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5); /* Darker shadow for depth */
}

/* Tool box titles and text in dark mode */
body.dark-mode .tool-box h2,
body.dark-mode .tool-box p {
  color: #e0e0e0; /* Lighter text */
}

/* Inputs, buttons, and other interactive elements */
body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select,
body.dark-mode button,
body.dark-mode .custom-file-upload,
body.dark-mode .download-link {
  background-color: #333; /* Dark background for inputs */
  border: 1px solid #555; /* Dark border */
  color: #e0e0e0; /* Light text */
}

/* Focus and hover states */
body.dark-mode input:focus,
body.dark-mode textarea:focus,
body.dark-mode select:focus,
body.dark-mode button:hover,
body.dark-mode .custom-file-upload:hover {
  border-color: #777; /* Lighter focus border */
}

body.dark-mode button,
body.dark-mode .custom-file-upload {
  background-color: #4f45e4; /* Primary button color */
}

body.dark-mode button:hover,
body.dark-mode .custom-file-upload:hover {
  background-color: #3d35b3; /* Darker button color on hover */
}

/* Download link */
body.dark-mode .download-link {
  background-color: #2fc2a0; /* Download button color */
}

body.dark-mode .download-link:hover {
  background-color: #24967e; /* Darker download button on hover */
}

/* Search input in dark mode */
body.dark-mode .search-input {
  background-color: #333;
  color: #fff;
  border-color: #444;
}

/* Section headings in dark mode */
body.dark-mode .section-heading {
  color: #ddd; /* Light text color for headings */
}

/* Gradient preview in dark mode */
body.dark-mode .gradient-preview {
  background-color: #333;
  border-color: #444;
}

/* Box shadow preview in dark mode */
body.dark-mode .shadow-preview {
  background-color: #333;
  border-color: #444;
}

/* Color palette preview in dark mode */
body.dark-mode .palette-swatch {
  border: 1px solid #444;
}

/* Tooltip and other text elements */
body.dark-mode .tooltip {
  background-color: #444; /* Dark tooltips */
  color: #fff;
}

/* Modal (hidden by default) */
.modal {
  display: none; /* Hidden by default */
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8); /* Black background with opacity */
  display: flex; /* Flexbox for centering */
  justify-content: center; /* Center horizontally */
  align-items: center; /* Center vertically */
}

.modal-content {
  max-width: 80%; /* Limit the width of the content */
  max-height: 80%; /* Limit the height of the content */
  animation: zoomIn 0.3s;
  border-radius: 8px; /* Optional: Add rounded corners */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Optional: Add shadow */
  object-fit: contain; /* Ensure the image scales properly */
  display: block;
  margin: auto; /* Center horizontally and vertically */
}

#image-holder {
  transform: translate(-50%, -50%);
  position: absolute;
  top: 50%;
  left: 50%;
}
/* Close button (X) */
.close {
  position: absolute;
  top: 20px;
  right: 25px;
  color: #fff;
  font-size: 36px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover,
.close:focus {
  color: #bbb;
  text-decoration: none;
  cursor: pointer;
}
