/* --- Base and Body --- */
html {
  overflow: hidden;
}

body {
  font-family: "Roboto", sans-serif;
  margin: 0;
  background-color: #f8f9fa;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
  color: #202124;
  padding: 0;
  height: 100vh;
  overflow: hidden;
}

body.dark-mode {
  background-color: #323232;
  color: #e0e0e0;
}

/* --- App Container --- */
.app-container {
  display: flex;
  height: 100vh;
  width: 100%;
}

/* --- Sidebar --- */
.sidebar {
  width: 80px;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s ease;
  flex-shrink: 0;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

body.dark-mode .sidebar {
  background-color: rgba(30, 30, 30, 0.9);
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
}

.sidebar-header {
  padding: 20px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  transition: border-color 0.3s ease;
}

body.dark-mode .sidebar-header {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.app-icon {
  font-size: 2rem;
  color: #3c4043;
  transition: color 0.3s ease;
}

body.dark-mode .app-icon {
  color: #e0e0e0;
}

/* --- Tab Navigation --- */
.tab-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  padding-top: 110px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 20px;
}

.tab-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 12px;
  background-color: transparent;
}

.tab-item:hover {
  background-color: rgba(0, 0, 0, 0.05);
  transform: scale(1.1);
}

body.dark-mode .tab-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.tab-item.active {
  background-color: rgba(26, 115, 232, 0.1);
  transform: scale(1.15);
}

body.dark-mode .tab-item.active {
  background-color: rgba(138, 180, 248, 0.2);
}

.tab-icon {
  font-size: 1.5rem;
  filter: grayscale(100%);
  transition:
    filter 0.2s ease,
    transform 0.2s ease;
}

.tab-item:hover .tab-icon {
  filter: grayscale(0%);
  transform: scale(1.1);
}

.tab-item.active .tab-icon {
  filter: grayscale(0%);
  transform: scale(1.1);
}

/* --- Main Content --- */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  padding-top: 15vh;
  background-color: #f8f9fa;
  transition: background-color 0.3s ease;
  display: flex;
  align-items: flex-start;
  /* justify-content: center; REMOVED - shifting centering logic to children */
  scrollbar-gutter: stable;
  overflow-y: auto;
  /* Reverted to auto */
}

body.dark-mode .main-content {
  background-color: #323232;
}

/* --- Tab Content --- */
.tab-content {
  display: none;
  max-width: 600px;
  /* Enforce consistent width here */
  width: 100%;
  /* Ensure it takes space */
  margin: 0 auto;
  /* Center explicitly */
}

.tab-content.active {
  display: block;
}

/* --- Tool Card Styling --- */
.tool-card {
  background-color: #fff;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition:
    background-color 0.3s ease,
    box-shadow 0.3s ease;
  height: fit-content;
  display: flex;
  flex-direction: column;
  max-width: 600px;
  width: 100%;
}

body.dark-mode .tool-card {
  background-color: #1e1e1e;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.05);
}

/* --- Consolidated Heading Styles --- */
.tool-card h1,
.picker h2 {
  text-align: center;
  margin-top: 0;
  margin-bottom: 20px;
  color: #3c4043;
  font-weight: 500;
  transition: color 0.3s ease;
}

.tool-card h1 {
  font-size: 1.8rem;
}

.picker h2 {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

body.dark-mode .tool-card h1,
body.dark-mode .picker h2 {
  color: #e0e0e0;
}

/* --- Text Manipulator Copy/Paste Button Styles --- */

/* Make the existing input-area the positioning context */
#text-manipulator .input-area {
  position: relative;
  margin-bottom: 20px;
}

/* Add padding to the top of the textarea to prevent text overlap */
#text-manipulator textarea#inputText {
  padding-top: 40px;
  padding-right: 52px;
  padding-bottom: 44px;
}

#text-manipulator .textarea-copy-btn {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 34px;
  height: 34px;
  border: 1px solid #dfe1e5;
  border-radius: 6px;
  background-color: #f1f3f4;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.2s ease;
}

body.dark-mode #text-manipulator .textarea-copy-btn {
  background-color: #333;
  border-color: #555;
}

#text-manipulator .textarea-copy-btn:hover {
  background-color: #e8eaed;
}

body.dark-mode #text-manipulator .textarea-copy-btn:hover {
  background-color: #444;
}

#text-manipulator .textarea-copy-btn:active {
  transform: scale(0.95);
}

body.dark-mode #text-manipulator h1 {
  color: #e0e0e0;
}

/* --- Consolidated Textarea Styles --- */
#text-manipulator textarea,
#diff-checker textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #d8dee2;
  border-radius: 6px;
  box-sizing: border-box;
  font-size: 1rem;
  line-height: 1.5;
  color: #202124;
  background-color: #f8f9fa;
  transition:
    border-color 0.3s ease,
    background-color 0.3s ease,
    color 0.3s ease;
}

#text-manipulator textarea {
  resize: none;
}

#diff-checker textarea {
  resize: vertical;
  min-height: 120px;
}

body.dark-mode #text-manipulator textarea,
body.dark-mode #diff-checker textarea {
  background-color: #333;
  color: #e0e0e0;
  border-color: #555;
}

#text-manipulator textarea:focus,
#diff-checker textarea:focus {
  outline: none;
  border-color: #4285f4;
  box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.3);
}

body.dark-mode #text-manipulator textarea:focus,
body.dark-mode #diff-checker textarea:focus {
  box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.5);
}

.collapsible {
  background-color: rgb(237, 237, 237) !important;
  text-align: left;
  color: #000000 !important;
}

body.dark-mode .collapsible {
  background-color: #444 !important;
  color: #e0e0e0 !important;
}

.content {
  display: none;
  margin-top: 0.5em;
  border-left: 1px solid rgba(224, 224, 224, 0.539);
  padding-left: 10px;
  width: 100%;
  box-sizing: border-box;
}

.content button {
  margin: 5px 0;
  width: 100%;
  box-sizing: border-box;
}

.content .dual-transform-row {
  display: flex;
  gap: 10px;
  width: 100%;
}

.content .dual-transform-row button {
  width: calc(50% - 5px);
}

#text-manipulator .button-area {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
}

/* --- Info Icon Styles --- */
.action-btn-with-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  padding-left: 44px;
}

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
  font-family: serif;
  font-weight: bold;
  cursor: help;
  transition: all 0.2s ease;
}

.info-icon:hover {
  background-color: rgba(255, 255, 255, 0.2);
  border-color: #fff;
}

/* Tooltip for Info Icon */
.info-icon .tooltip-text {
  visibility: hidden;
  width: min(200px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  background-color: #333;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 8px;
  position: absolute;
  z-index: 10;
  bottom: 140%;
  /* Position above */
  left: 0;
  transform: none;
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 0.85rem;
  line-height: 1.4;
  font-weight: normal;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  pointer-events: none;
  font-family: "Roboto", sans-serif;
  /* Reset font from icon */
}

.info-icon .tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 14px;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
}

.info-icon:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

body.dark-mode .info-icon .tooltip-text {
  background-color: #555;
  border: 1px solid #777;
}

body.dark-mode .info-icon .tooltip-text::after {
  border-color: #555 transparent transparent transparent;
}

@media (max-width: 420px) {
  .info-icon .tooltip-text {
    width: min(180px, calc(100vw - 24px));
    font-size: 0.8rem;
  }
}

/* --- Consolidated Button Styles --- */
#text-manipulator button,
#diff-checker button,
#pdf-kb-calculator button {
  padding: 16px 18px;
  border: none;
  border-radius: 6px;
  background-color: #485460;
  width: 100%;
  color: #ffffff;
  font-size: 0.95rem;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    box-shadow 0.2s ease,
    color 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

body.dark-mode #text-manipulator button,
body.dark-mode #diff-checker button,
body.dark-mode #pdf-kb-calculator button {
  background-color: #485460;
  color: #e0e0e0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

#text-manipulator button:hover,
#diff-checker button:hover,
#pdf-kb-calculator button:hover {
  background-color: #d8dade;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

body.dark-mode #text-manipulator button:hover,
body.dark-mode #diff-checker button:hover,
body.dark-mode #pdf-kb-calculator button:hover {
  background-color: #747474;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

#text-manipulator button:focus,
#diff-checker button:focus,
#pdf-kb-calculator button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.5);
}

/* --- PDF Calculator Styles --- */
#pdf-kb-calculator .pdf-input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 20px;
}

#pdf-kb-calculator .pdf-input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#pdf-kb-calculator label {
  font-weight: 500;
  color: #3c4043;
}

body.dark-mode #pdf-kb-calculator label {
  color: #e0e0e0;
}

#pdf-kb-calculator input {
  padding: 12px;
  border: 1px solid #d8dee2;
  border-radius: 6px;
  box-sizing: border-box;
  font-size: 1rem;
  color: #202124;
  background-color: #f8f9fa;
  transition:
    border-color 0.3s ease,
    background-color 0.3s ease,
    color 0.3s ease;
}

body.dark-mode #pdf-kb-calculator input {
  background-color: #333;
  color: #e0e0e0;
  border-color: #555;
}

#pdf-kb-calculator input:focus {
  outline: none;
  border-color: #4285f4;
  box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.3);
}

body.dark-mode #pdf-kb-calculator input:focus {
  box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.5);
}

#pdf-kb-calculator .pdf-result {
  margin-top: 15px;
  padding: 12px;
  border-radius: 6px;
  background-color: #f0f0f0;
  border: 1px solid #d8dee2;
  font-weight: 500;
  color: #202124;
  text-align: center;
}

body.dark-mode #pdf-kb-calculator .pdf-result {
  background-color: #282828;
  border-color: #555;
  color: #e0e0e0;
}

#pdf-kb-calculator .pdf-result.optimal {
  background-color: #eaf7ee;
  border-color: #2e7d32;
  color: #1b5e20;
}

body.dark-mode #pdf-kb-calculator .pdf-result.optimal {
  background-color: #1f3b25;
  border-color: #81c995;
  color: #b7f7c2;
}

#pdf-kb-calculator .pdf-result.heavy {
  background-color: #fff8e1;
  border-color: #f9ab00;
  color: #8a5a00;
}

body.dark-mode #pdf-kb-calculator .pdf-result.heavy {
  background-color: #4a3a1a;
  border-color: #ffd666;
  color: #ffe7a6;
}

#pdf-kb-calculator .pdf-result.action {
  background-color: #fdeaea;
  border-color: #d93025;
  color: #b3261e;
}

body.dark-mode #pdf-kb-calculator .pdf-result.action {
  background-color: #4a1f1f;
  border-color: #ff7b72;
  color: #ffb4ab;
}

/* --- Color Picker Card Content --- */
.picker {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  font-family: sans-serif;
  height: 100%;
  width: 100%;
}

body.dark-mode #color-picker h1 {
  color: #e0e0e0;
}

.picker .color-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.color-preview {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  border: 1px solid #ccc;
  cursor: pointer;
  position: relative;
  transition:
    transform 0.1s ease,
    background-color 0.3s ease,
    border-color 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

body.dark-mode .color-preview {
  border-color: #555;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.color-label {
  font-size: 0.8rem;
  color: white;
  text-align: center;
  pointer-events: none;
  padding: 5px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  transition:
    color 0.3s ease,
    text-shadow 0.3s ease;
}

.color-preview:active {
  transform: scale(0.95);
}

.hex {
  font-size: 1rem;
  font-weight: bold;
  letter-spacing: 1px;
  color: #333;
  transition: color 0.3s ease;
  flex-shrink: 1;
  background-color: #f0f0f0;
  padding: 5px 10px;
  border-radius: 4px;
  min-width: 6ch;
  text-align: center;
}

body.dark-mode .hex {
  color: #e0e0e0;
  background-color: #333;
}

/* --- Diff Checker Specific Styles --- */
#diff-checker .input-section {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

#diff-checker .textarea-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 280px;
}

/* --- Consolidated Label Styles --- */
#diff-checker label {
  margin-bottom: 8px;
  font-weight: 500;
  color: #3c4043;
}

body.dark-mode #diff-checker label {
  color: #e0e0e0;
}

#diff-checker .diff-output {
  margin-top: 25px;
  border-top: 1px solid #eee;
  padding-top: 20px;
}

body.dark-mode #diff-checker .diff-output {
  border-top-color: #444;
}

#diff-checker .diff-output h2 {
  text-align: center;
  margin-top: 0;
  margin-bottom: 15px;
  color: #3c4043;
  font-size: 1.5rem;
  font-weight: 500;
}

body.dark-mode #diff-checker .diff-output h2 {
  color: #e0e0e0;
}

#diff-checker .diff-result-content {
  background-color: #f0f0f0;
  border: 1px solid #d8dee2;
  border-radius: 6px;
  padding: 15px;
  min-height: 100px;
  max-height: 400px;
  overflow-y: auto;
  font-family: monospace;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #202124;
  transition:
    background-color 0.3s ease,
    border-color 0.3s ease,
    color 0.3s ease;
}

body.dark-mode #diff-checker .diff-result-content {
  background-color: #282828;
  border-color: #555;
  color: #e0e0e0;
}

/* --- Consolidated Diff Highlighting Styles --- */
#diff-checker .added {
  background-color: #e6ffed;
  color: #28a745;
  padding: 1px 3px;
  border-radius: 3px;
}

body.dark-mode #diff-checker .added {
  background-color: #2f4f4f;
  color: #90ee90;
}

#diff-checker .removed {
  background-color: #ffeef0;
  color: #dc3545;
  padding: 1px 3px;
  border-radius: 3px;
  text-decoration: line-through;
}

body.dark-mode #diff-checker .removed {
  background-color: #5b2f2f;
  color: #ffb6c1;
}

#diff-checker .legend {
  margin-top: 15px;
  text-align: center;
  font-size: 0.85rem;
  color: #555;
}

body.dark-mode #diff-checker .legend {
  color: #bbb;
}

#diff-checker .legend span {
  padding: 3px 8px;
  border-radius: 4px;
  margin: 0 5px;
}

#diff-checker .added-legend {
  background-color: #e6ffed;
  color: #28a745;
}

body.dark-mode #diff-checker .added-legend {
  background-color: #2f4f4f;
  color: #90ee90;
}

#diff-checker .removed-legend {
  background-color: #ffeef0;
  color: #dc3545;
}

body.dark-mode #diff-checker .removed-legend {
  background-color: #5b2f2f;
  color: #ffb6c1;
}

/* --- Theme Toggle Button --- */
.theme-toggle-button {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: 2px solid #838d97;
  background-color: #fff;
  color: #3c4043;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 22px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition:
    background-color 0.3s ease,
    color 0.3s ease,
    transform 0.2s ease,
    border-color 0.2s;
  padding: 0;
  margin: 0;
}

.sidebar-header .theme-toggle-button {
  margin: 0;
  box-shadow: none;
}

body.dark-mode .theme-toggle-button {
  background-color: #555;
  color: #f0f0f0;
  border-color: #838d97;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.theme-toggle-button:hover,
.theme-toggle-button:focus {
  border-color: #24508e;
  outline: none;
  box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.25);
}

.theme-toggle-button:active {
  transform: scale(0.95);
}

.color-picker-wrapper {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  padding: 4px;
  background: conic-gradient(
    red,
    orange,
    yellow,
    lime,
    cyan,
    blue,
    violet,
    red
  );
  animation: spinBorder 20s linear infinite;
}

@keyframes spinBorder {
  0% {
    transform: rotate(0turn);
  }

  100% {
    transform: rotate(1turn);
  }
}

.color-picker-wrapper input[type="color"] {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  appearance: none;
  background: none;
}

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

.color-picker-wrapper input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
}

.color-picker-wrapper input[type="color"]::-moz-color-swatch {
  border: none;
  border-radius: 50%;
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0 15px;
  }

  body.dark-mode .sidebar {
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }

  .sidebar-header {
    padding: 10px 0;
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    border-bottom: none;
  }

  .app-icon {
    font-size: 1.5rem;
  }

  .tab-nav {
    flex-direction: row;
    justify-content: center;
    gap: 20px;
    padding: 10px 0;
    align-items: center;
    margin: 0;
    padding-top: 0, 5em;
    flex: unset;
  }

  .tab-item {
    width: 45px;
    height: 45px;
  }

  .tab-icon {
    font-size: 1.3rem;
  }

  .main-content {
    padding: 15px;
  }

  .tool-card {
    padding: 20px;
    max-width: 460px;
    margin: 0 auto;
  }

  .tool-card h1 {
    font-size: 1.5rem;
    margin-bottom: 15px;
  }

  #diff-checker .input-section {
    flex-direction: column;
    gap: 15px;
  }

  #diff-checker .textarea-group {
    min-width: unset;
  }

  .picker .color-controls {
    gap: 15px;
  }

  .color-preview {
    width: 60px;
    height: 60px;
  }

  .color-picker-wrapper {
    width: 50px;
    height: 50px;
  }

  .hex {
    font-size: 0.9rem;
  }

  #pdf-kb-calculator .pdf-input-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Color Converter Styles --- */
.converter-section {
  margin-top: 30px;
  width: 100%;
  max-width: 600px;
  border-top: 1px solid #eee;
  padding-top: 20px;
}

body.dark-mode .converter-section {
  border-top-color: #444;
}

.converter-section h3 {
  text-align: center;
  margin-bottom: 20px;
  color: #3c4043;
  font-size: 1.4rem;
  font-weight: 500;
}

body.dark-mode .converter-section h3 {
  color: #e0e0e0;
}

.converter-grid {
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: center;
}

.converter-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.converter-group label {
  font-weight: 500;
  color: #5f6368;
}

body.dark-mode .converter-group label {
  color: #aaa;
}

.converter-group select,
.converter-group input {
  padding: 10px;
  border: 1px solid #dfe1e5;
  border-radius: 6px;
  font-size: 1rem;
  background-color: #fff;
  color: #202124;
  transition: all 0.3s ease;
}

body.dark-mode .converter-group select,
body.dark-mode .converter-group input {
  background-color: #333;
  border-color: #555;
  color: #e0e0e0;
}

.converter-group input:focus,
.converter-group select:focus {
  outline: none;
  border-color: #4285f4;
  box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
}

.input-container {
  display: flex;
  gap: 10px;
}

.input-container input,
#dynamicInputContainer input {
  flex: 1;
  min-width: 0;
  width: 100%;
  /* Ensure it fills the dynamic container */
}

.output-container {
  display: flex;
  gap: 10px;
}

.output-container input {
  flex: 1;
  background-color: #f1f3f4;
  cursor: default;
}

body.dark-mode .output-container input {
  background-color: #2a2a2a;
}

#copyConverterOutput,
#pasteToInput {
  padding: 0 15px;
  background-color: #f1f3f4;
  border: 1px solid #dfe1e5;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.dark-mode #copyConverterOutput,
body.dark-mode #pasteToInput {
  background-color: #333;
  border-color: #555;
}

#copyConverterOutput:hover,
#pasteToInput:hover {
  background-color: #e8eaed;
}

body.dark-mode #copyConverterOutput:hover,
body.dark-mode #pasteToInput:hover {
  background-color: #444;
}

#copyConverterOutput:active,
#pasteToInput:active {
  transform: scale(0.95);
}

@media (min-width: 600px) {
  .converter-grid {
    flex-direction: row;
    align-items: flex-end;
  }
}

/* Additional responsive breakpoints for very narrow screens */
@media (max-width: 480px) {
  .main-content {
    padding: 10px;
  }

  .tool-card {
    padding: 15px;
    margin: 0 5px;
    max-width: 340px;
  }

  .tool-card h1 {
    font-size: 1.3rem;
    margin-bottom: 12px;
  }

  .picker .color-controls {
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .color-preview {
    width: 50px;
    height: 50px;
  }

  .color-picker-wrapper {
    width: 45px;
    height: 45px;
  }

  .hex {
    font-size: 0.8rem;
    padding: 3px 8px;
  }
}

@media (max-width: 360px) {
  .tool-card {
    padding: 12px;
    margin: 0 2px;
    max-width: 340px;
  }

  .tool-card h1 {
    font-size: 1.2rem;
  }

  .picker .color-controls {
    gap: 8px;
  }

  .color-preview {
    width: 45px;
    height: 45px;
  }

  .color-picker-wrapper {
    width: 40px;
    height: 40px;
  }
}
