/* TOOL PAGE LAYOUT */
.tool-page-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 30px;
  padding-top: 40px;
  padding-bottom: 60px;
  align-items: start;
}

.tool-main {
  min-width: 0;
}

.tool-header {
  margin-bottom: 30px;
}

.tool-header h1 {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 10px;
}

.tool-desc {
  font-size: 18px;
  color: #6b7280;
}

.tool-box {
  background: #fff;
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  margin-bottom: 30px;
}

/* UPLOAD AREA */
.upload-area {
  border: 3px dashed #d1d5db;
  border-radius: 12px;
  padding: 60px 30px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background: #f9fafb;
}

.upload-area:hover,
.upload-area.dragover {
  border-color: #10b981;
  background: #ecfdf5;
}

.upload-icon {
  font-size: 60px;
  margin-bottom: 15px;
}

.upload-area h3 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 8px;
}

.upload-area p {
  color: #6b7280;
  margin-bottom: 20px;
}

.btn-upload {
  display: inline-block;
  background: #10b981;
  color: #fff;
  padding: 14px 35px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s;
  border: none;
}

.btn-upload:hover {
  background: #059669;
}

/* SETTINGS */
.settings-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.setting-group {
  flex: 1;
  min-width: 150px;
}

.setting-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 14px;
}

.setting-group select,
.setting-group input[type="number"],
.setting-group input[type="text"] {
  width: 100%;
  padding: 10px 15px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 15px;
  font-family: 'Poppins', sans-serif;
  outline: none;
  transition: border 0.2s;
}

.setting-group select:focus,
.setting-group input:focus {
  border-color: #10b981;
}

/* OUTPUT */
.output-area {
  margin-top: 25px;
  display: none;
}

.output-area.visible {
  display: block;
}

.output-preview {
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
  background: #f3f4f6;
  text-align: center;
  padding: 20px;
}

.output-preview img {
  max-width: 100%;
  max-height: 400px;
  border-radius: 8px;
}

.output-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.stat-pill {
  background: #ecfdf5;
  color: #059669;
  padding: 8px 20px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 14px;
}

.btn-download {
  display: inline-block;
  background: #10b981;
  color: #fff;
  padding: 14px 40px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  border: none;
  transition: background 0.2s;
}

.btn-download:hover {
  background: #059669;
}

/* RESISTOR CALCULATOR */
.band-toggle {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
}

.band-btn {
  padding: 10px 30px;
  border: 2px solid #e5e7eb;
  border-radius: 25px;
  background: #fff;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  transition: all 0.2s;
}

.band-btn.active {
  background: #10b981;
  color: #fff;
  border-color: #10b981;
}

/* RESISTOR VISUAL */
.resistor-visual {
  margin: 25px 0;
  display: flex;
  justify-content: center;
}

.resistor-body {
  display: flex;
  align-items: center;
  gap: 0;
}

.resistor-lead {
  width: 60px;
  height: 4px;
  background: #9ca3af;
}

.resistor-ceramic {
  background: linear-gradient(135deg, #d4a574, #c8956a);
  width: 200px;
  height: 50px;
  border-radius: 25px;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  padding: 0 20px;
  position: relative;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.band {
  width: 16px;
  height: 100%;
  border-radius: 3px;
  transition: background 0.3s;
}

/* COLOR SELECTORS */
.color-selectors {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 25px;
}

.color-select-group {
  flex: 1;
  min-width: 100px;
}

.color-select-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 8px;
  text-align: center;
}

.color-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}

.color-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.2s, border 0.2s;
}

.color-dot:hover {
  transform: scale(1.2);
}

.color-dot.selected {
  border-color: #1f2937;
  transform: scale(1.2);
}

.selected-color {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}

/* RESULT BOX */
.result-box {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border-radius: 12px;
  padding: 25px;
  text-align: center;
  border: 2px solid #10b981;
}

.result-value {
  font-size: 48px;
  font-weight: 800;
  color: #059669;
  margin-bottom: 10px;
}

.result-details {
  display: flex;
  gap: 20px;
  justify-content: center;
  font-size: 16px;
  color: #374151;
  font-weight: 500;
}

/* COLOR TABLE */
.table-wrapper {
  overflow-x: auto;
  margin-top: 15px;
}

.color-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.color-table th {
  background: #f3f4f6;
  padding: 12px 15px;
  text-align: left;
  font-weight: 600;
}

.color-table td {
  padding: 10px 15px;
  border-bottom: 1px solid #e5e7eb;
}

.color-swatch {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  margin-right: 8px;
  vertical-align: middle;
  border: 1px solid rgba(0,0,0,0.2);
}

/* HOW TO / FAQ */
.how-to-section,
.faq-section,
.color-table-section {
  background: #fff;
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  margin-bottom: 25px;
}

.how-to-section h2,
.faq-section h2,
.color-table-section h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 20px;
}

.steps-list {
  padding-left: 20px;
}

.steps-list li {
  margin-bottom: 12px;
  font-size: 16px;
  line-height: 1.6;
}

.faq-item {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e5e7eb;
}

.faq-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.faq-item h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #1f2937;
}

.faq-item p {
  color: #6b7280;
  font-size: 15px;
}

/* SIDEBAR */
.tool-sidebar {
  position: sticky;
  top: 80px;
}

.sidebar-ad {
  margin-bottom: 25px;
  background: #f9fafb;
  border-radius: 12px;
  padding: 15px;
  text-align: center;
}

.related-tools {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.related-tools h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 15px;
}

.related-link {
  display: block;
  padding: 12px 15px;
  border-radius: 8px;
  font-weight: 500;
  transition: background 0.2s;
  margin-bottom: 5px;
}

.related-link:hover {
  background: #ecfdf5;
  color: #10b981;
}

/* GOVT FORM PAGE */
.form-guide-section {
  background: #fff;
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  margin-bottom: 25px;
}

.form-guide-section h2 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 20px;
}

.step-card {
  display: flex;
  gap: 20px;
  margin-bottom: 25px;
  padding-bottom: 25px;
  border-bottom: 1px solid #e5e7eb;
}

.step-card:last-child {
  border-bottom: none;
}

.step-num {
  width: 45px;
  height: 45px;
  background: #10b981;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  flex-shrink: 0;
}

.step-content h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.step-content p {
  color: #6b7280;
  font-size: 15px;
}

.download-form-btn {
  display: inline-block;
  background: #3b82f6;
  color: #fff;
  padding: 12px 30px;
  border-radius: 25px;
  font-weight: 600;
  margin-top: 15px;
  transition: background 0.2s;
}

.download-form-btn:hover {
  background: #2563eb;
}

/* RESPONSIVE TOOL PAGE */
@media (max-width: 900px) {
  .tool-page-layout {
    grid-template-columns: 1fr;
  }

  .tool-sidebar {
    position: static;
  }

  .sidebar-ad {
    display: none;
  }
}

@media (max-width: 600px) {
  .tool-header h1 {
    font-size: 26px;
  }

  .result-value {
    font-size: 36px;
  }

  .color-selectors {
    flex-direction: column;
  }

  .color-picker {
    grid-template-columns: repeat(6, 1fr);
  }
}
