/**
 * Higher-contrast, easier-to-see form controls site-wide (main content).
 * Complements Tailwind utility classes on individual fields.
 */

#main-content input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="image"]),
#main-content select,
#main-content textarea {
  width: 100%;
  max-width: 100%;
  border-width: 2px !important;
  border-color: rgb(100 116 139) !important; /* slate-500 */
  background-color: #ffffff !important;
  color: rgb(15 23 42) !important; /* slate-900 */
  min-height: 2.75rem;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

#main-content input::placeholder,
#main-content textarea::placeholder {
  color: rgb(148 163 184) !important; /* slate-400 */
  opacity: 1;
}

#main-content input:focus,
#main-content select:focus,
#main-content textarea:focus {
  border-color: rgb(79 70 229) !important; /* indigo-600 */
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.28) !important;
  outline: none !important;
}

/* Flatpickr: match visible input styling */
.flatpickr-input {
  border-width: 2px !important;
  border-color: rgb(100 116 139) !important;
  background-color: #ffffff !important;
  color: rgb(15 23 42) !important;
  min-height: 2.75rem;
}

.flatpickr-input:focus {
  border-color: rgb(79 70 229) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.28) !important;
}

/* Popup above sticky header/toolbar */
.flatpickr-calendar {
  z-index: 60 !important;
}

/* Tool forms: match polished date-difference/whois style */
.tool-hero-form-panel label {
  color: rgb(30 41 59) !important; /* slate-800 */
  font-weight: 600;
}

.tool-hero-form-panel input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="image"]),
.tool-hero-form-panel select,
.tool-hero-form-panel textarea {
  width: 100%;
  max-width: 100%;
  border-width: 2px !important;
  border-color: rgb(165 180 252) !important; /* indigo-300 */
  border-radius: 0.75rem !important;
  background-color: #ffffff !important;
  color: rgb(15 23 42) !important;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.tool-hero-form-panel input::placeholder,
.tool-hero-form-panel textarea::placeholder {
  color: rgb(148 163 184) !important; /* slate-400 */
}

.tool-hero-form-panel input:focus,
.tool-hero-form-panel select:focus,
.tool-hero-form-panel textarea:focus {
  border-color: rgb(79 70 229) !important; /* indigo-600 */
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.22) !important;
  outline: none !important;
}

.tool-hero-form-panel input[type="checkbox"],
.tool-hero-form-panel input[type="radio"] {
  accent-color: rgb(79 70 229);
}

/* Advanced file picker styling for converter-style forms */
.tool-hero-form-panel input[type="file"] {
  border: 2px solid rgb(165 180 252) !important;
  border-radius: 0.75rem !important;
  background: #ffffff !important;
  color: rgb(15 23 42) !important;
  padding: 0.85rem 0.85rem !important;
  min-height: 3.35rem !important;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.tool-hero-form-panel input[type="file"]:hover {
  border-color: rgb(99 102 241) !important;
  background: #ffffff !important;
}

.tc-file-dropzone {
  position: relative;
}

.tc-file-dropzone::after {
  content: "Drag & drop file here";
  position: absolute;
  right: 0.75rem;
  top: 0.35rem;
  font-size: 0.68rem;
  color: rgb(99 102 241);
  pointer-events: none;
}

.tc-file-dropzone-over input[type="file"] {
  border-color: rgb(79 70 229) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18) !important;
}

.tool-hero-form-panel input[type="file"]::file-selector-button {
  border: 1px solid rgb(129 140 248);
  background: rgb(79 70 229);
  color: #fff;
  border-radius: 0.65rem;
  width: 100%;
  min-width: 100%;
  display: block;
  padding: 0.78rem 0.85rem;
  margin: 0 0 0.55rem 0;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}

.tool-hero-form-panel input[type="file"]::file-selector-button:hover {
  background: rgb(67 56 202);
}

.tc-file-meta {
  position: relative;
  margin-top: 0.5rem;
  border: 1px solid rgb(186 230 253);
  background: linear-gradient(135deg, rgb(240 249 255) 0%, rgb(238 242 255) 100%);
  border-radius: 0.75rem;
  padding: 0.55rem 0.7rem;
}

.tc-file-meta-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: rgb(30 64 175);
  font-size: 0.8rem;
  font-weight: 700;
}

.tc-file-meta-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tc-file-meta-row {
  margin-top: 0.28rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.72rem;
  color: rgb(71 85 105);
}

.tc-file-meta-actions {
  position: absolute;
  top: 0.42rem;
  right: 0.42rem;
}

.tc-file-clear-btn {
  appearance: none;
  width: 1.5rem;
  height: 1.5rem;
  border: 1px solid rgb(248 113 113);
  background: rgb(254 226 226);
  color: rgb(185 28 28);
  border-radius: 9999px;
  padding: 0;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tc-file-clear-btn:hover {
  background: rgb(254 202 202);
  border-color: rgb(239 68 68);
  color: rgb(153 27 27);
}

.converter-range-wrap input[type="range"] {
  width: 100%;
  accent-color: rgb(79 70 229);
}

.converter-range-hint {
  margin-top: 0.35rem;
  font-size: 0.74rem;
  color: rgb(71 85 105);
}

.tc-field-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
}

.tc-clipboard-field {
  padding-right: 8.6rem !important;
}

.tc-field-actions {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  z-index: 3;
}

#tool-main-form > div,
#tool-main-form .grid > div,
#tool-main-form [class*="col-span"] {
  min-width: 0;
}

.tc-action-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 1.55rem;
  border: 1px solid rgb(199 210 254);
  background: rgb(238 242 255);
  color: rgb(67 56 202);
  border-radius: 0.6rem;
  padding: 0.22rem 0.44rem;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.tc-action-btn:hover {
  background: rgb(224 231 255);
}

.tc-action-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

textarea.tc-clipboard-field {
  min-height: 6.5rem;
}

.tc-field-wrap.tc-wrap-textarea .tc-field-actions {
  top: 0.7rem;
  transform: none;
}

.tc-action-btn-copy {
  border-color: rgb(203 213 225);
  background: rgb(248 250 252);
  color: rgb(51 65 85);
}

/* Auto-icons for controls lacking explicit icon padding classes */
.tool-hero-form-panel input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="image"]):not([type="file"]):not([class*="pl-"]),
.tool-hero-form-panel select:not([class*="pl-"]),
.tool-hero-form-panel textarea:not([class*="pl-"]) {
  padding-left: 2.4rem !important;
  background-repeat: no-repeat !important;
  background-position: 0.75rem center !important;
  background-size: 0.95rem 0.95rem !important;
}

.tool-hero-form-panel input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="image"]):not([type="file"]):not([class*="pl-"]) {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.8' stroke='%236366f1'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M3 8.25h18M6.75 3h10.5A2.25 2.25 0 0 1 19.5 5.25v13.5A2.25 2.25 0 0 1 17.25 21H6.75A2.25 2.25 0 0 1 4.5 18.75V5.25A2.25 2.25 0 0 1 6.75 3Z'/%3E%3C/svg%3E") !important;
}

.tool-hero-form-panel textarea:not([class*="pl-"]) {
  background-position: 0.75rem 0.8rem !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.8' stroke='%236366f1'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M7.5 3.75h9A2.25 2.25 0 0 1 18.75 6v12A2.25 2.25 0 0 1 16.5 20.25h-9A2.25 2.25 0 0 1 5.25 18V6A2.25 2.25 0 0 1 7.5 3.75Zm2.25 4.5h4.5m-4.5 3h4.5m-4.5 3h3'/%3E%3C/svg%3E") !important;
}

.tool-hero-form-panel select:not([class*="pl-"]) {
  background-position: 0.75rem center, calc(100% - 0.75rem) center !important;
  background-size: 0.95rem 0.95rem, 0.7rem 0.7rem !important;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.8' stroke='%236366f1'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M4.5 6.75h15m-15 5.25h10.5m-10.5 5.25h6'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2394a3b8'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 0 1 1.06.02L10 11.17l3.71-3.94a.75.75 0 1 1 1.08 1.04l-4.24 4.5a.75.75 0 0 1-1.08 0l-4.24-4.5a.75.75 0 0 1 .02-1.06Z' clip-rule='evenodd'/%3E%3C/svg%3E") !important;
  padding-right: 2.2rem !important;
}
