/* style.css */

body {
  font-family: Arial, sans-serif;
  margin: 20px;
  background: #f6f8fa;
  color: #111;
  line-height: 1.6;
}

.container {
  max-width: 1100px;
  margin: auto;
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* --- Typography & Headings --- */
h1 {
  font-size: 2rem;
  margin: 0;
  color: #111;
}

h2 {
  font-size: 1.5rem;
  margin-top: 1.5rem;
  border-bottom: 1px solid #eee;
  padding-bottom: 0.5rem;
}

a {
  color: #2563eb;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* --- Forms & Inputs --- */
label, .form-label {
  display: block;
  margin-top: 12px;
  font-weight: 600;
  margin-bottom: 6px;
}

input[type=text],
input[type=number],
input[type=file],
select,
.form-control {
  width: 100%;
  padding: 10px;
  margin-top: 0;
  border-radius: 6px;
  border: 1px solid #ddd;
  box-sizing: border-box;
  font-family: inherit;
  background: #fff;
}

textarea, textarea.form-control {
  width: 100%;
  min-height: 350px;
  padding: 12px;
  font-family: 'Fira Code', Consolas, Monaco, monospace;
  font-size: 1rem;
  line-height: 1.5;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-sizing: border-box;
  resize: vertical;
}

/* --- Buttons (Uniform Perimeter Transition) --- */
button, .btn {
  display: inline-flex;
  background-color: #3f51b5; /* Material Indigo 500 */
  color: #ffffff !important;
  border: none;
  padding: 10px 24px;
  border-radius: 4px;
  font-weight: 500;
  text-transform: uppercase;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: all 0.2s ease;
}

button:hover, .btn:hover {
  background-color: #303f9f;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.btn-full-width {
  width: 100%;
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.9rem;
  height: 36px;
  margin-top: 0;
}

/* --- Layout Helpers --- */
.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e6e6e6;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.col {
  flex: 1;
  min-width: 140px;
}

.or-divider {
  text-align: center;
  margin: 1.5rem 0;
  color: #777;
  font-weight: bold;
}

/* --- Tooltips --- */
.tooltip {
  position: relative;
  display: inline-block;
  cursor: help;
  margin-left: 4px;
  vertical-align: middle;
}

label .tooltip {
  position: relative !important;
  display: inline-block !important;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 250px;
  background-color: #333;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 8px 10px;
  position: absolute;
  z-index: 9999;
  bottom: 125%;
  left: 50%;
  margin-left: -125px;
  opacity: 0;
  transition: opacity 0.3s;
  font-weight: normal;
  line-height: 1.4;
  font-size: 0.9rem;
  pointer-events: none;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

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

/* --- Alerts --- */
.alert {
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-weight: bold;
}
.alert-danger {
  background-color: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* --- Tool Index Tiles (Uniform Perimeter Transition) --- */

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.tool-tile {
  display: block;
  background: radial-gradient(
    ellipse at center,
    #1e50c4 50%,
    #172b80 90% 
  );
  border: 1px solid #172b80;
  border-radius: 8px;
  padding: 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  color: #fff;
  text-decoration: none !important;
  height: 100%;
  box-sizing: border-box;
}

.tool-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.15);
  background: radial-gradient(ellipse at center, #1b4ab5 50%, #0f1f5e 90%);
  border-color: #0f1f5e;
  text-decoration: none;
}

.tool-tile h3 {
  margin: 0 0 10px 0;
  font-size: 1.2rem;
  color: #fff;
  font-weight: 600;
}

.tool-tile:hover h3 {
  text-decoration: none;
}

.tool-tile .tool-desc {
  margin: 0;
  font-size: 0.95rem;
  color: #f1f5f9;
  line-height: 1.5;
}

/* --- Markdown Output Specifics --- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #e6e6e6;
}

th, td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

th {
  background-color: #f3f4f6;
  font-weight: 600;
}

tr:last-child td {
  border-bottom: none;
}

pre {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 16px;
  border-radius: 6px;
  overflow-x: auto;
  white-space: pre-wrap;
  margin: 1.5rem 0;
}

code {
  font-family: 'Fira Code', Consolas, Monaco, monospace;
  font-size: 0.9em;
}

p > code, li > code, th > code, td > code {
  background-color: #f3f4f6;
  color: #111;
  padding: 0.2em 0.4em;
  border-radius: 4px;
  border: 1px solid #e6e6e6;
}

blockquote {
  margin: 1.5rem 0;
  padding: 0.5rem 0 0.5rem 1.5rem;
  border-left: 4px solid #2563eb;
  background: #f9fafb;
  color: #555;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

hr {
  border: 0;
  border-top: 1px solid #e6e6e6;
  margin: 2rem 0;
}

.footer {
  margin-top: 40px;
  padding-top: 20px;
  text-align: center;
  font-size: 0.85em;
  color: #777;
  border-top: 1px solid #e6e6e6;
}

/* --- Print --- */
@media print {
  body {
    background: white;
    margin: 0;
  }
  .container {
    box-shadow: none;
    max-width: 100%;
    padding: 0;
  }
  .no-print, .btn, header button {
    display: none !important;
  }
  a {
    text-decoration: underline;
    color: #000;
  }
}