:root {
  --primary: #2c3e50;
  --accent: #27ae60;
  --bg: #f5f5f5;
  --font: 'Segoe UI', sans-serif;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: #333;
}

header, footer {
  background: var(--primary);
  color: #fff;
  text-align: center;
  padding: 1em;
}

main {
  max-width: 800px;
  margin: auto;
  padding: 0 2em 2em 2em;
}

label, select, button {
  font-size: 1.1em;
}

.calculator.modern-box {
  background: #fff;
  border-radius: 12px;
  padding: 1em 2em;
  margin-top: 2em;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.07);
}

.calculator h2 {
  margin-top: 0;
  color: var(--primary);
  font-size: 1.5em;
}

.calculator p {
  color: #666;
  margin-bottom: 1.5em;
}

.form-group {
  margin-bottom: 1.2em;
}

.form-group label {
  font-weight: 600;
  margin-bottom: 0.4em;
}

.bands {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75em;
  margin-bottom: 1em;
  justify-content: flex-start;
}

.bands label {
  flex: 1 1 30%;
  min-width: 120px;
  max-width: 180px;
}

.band-option {
  padding: 0.8em 1em;
  border: 2px solid #ccc;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  width: 100%;
  font-weight: bold;
}

.band-option:hover {
  border-color: var(--accent);
}

/* CONTRAST DÜZENLEMESİ */
button {
  background: #1e874b;
  color: white;
  padding: 0.8em 2em;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 1em;
  font-weight: 600;
}

button:hover {
  background: #166d3a;
}

#result {
  margin-top: 1.5em;
  font-size: 1.2em;
  font-weight: bold;
}

.result-box {
  background: #eafaf1;
  padding: 1em;
  border-left: 6px solid var(--accent);
  border-radius: 6px;
  margin-top: 1.5em;
}

.btn-secondary {
  background: #ddd;
  color: #000;
  padding: 0.5em 1.5em;
  text-decoration: none;
  border-radius: 4px;
}

.info {
  margin-top: 3em;
  line-height: 1.6;
}

.info h2, .info h3 {
  margin-top: 2em;
  color: var(--primary);
}

.responsive-table {
  overflow-x: auto;
  margin-top: 1em;
}

.responsive-table table {
  border-collapse: collapse;
  width: 100%;
  min-width: 600px;
}

.responsive-table th,
.responsive-table td {
  border: 1px solid #ccc;
  padding: 0.75em;
  text-align: left;
  background-color: white;
}

.responsive-table th {
  background-color: var(--primary);
  color: white;
}

.th-wrap {
  white-space: normal;
  text-align: center;
  word-break: break-word;
  line-height: 1.2;
}

.modern-bands label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3em;
  margin: 1em 0;
}

.modern-bands select.band-option {
  padding: 0.5em;
  border-radius: 6px;
  font-weight: bold;
  transition: background 0.3s ease;
  border: 2px solid #ccc;
}

.modern-bands select.band-option:focus {
  outline: none;
  border-color: var(--accent);
}

.color-preview {
  background-color: #eee;
  color: #000;
  padding: 0.3em 0.8em;
  border-radius: 4px;
  font-weight: bold;
  display: inline-block;
  margin-top: 0.5em;
}

.resistor-type {
  background: #fdfdfd;
  border-left: 5px solid var(--primary);
  padding: 1em;
  margin-top: 2em;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* CONTRAST DÜZENLEMESİ */
.resistor-type h3 {
  margin-top: 0;
  color: #145a32;
}

.example-box {
  background: #eafaf1;
  border-left: 4px solid var(--accent);
  padding: 0.75em 1em;
  margin-top: 1em;
  border-radius: 4px;
  font-weight: bold;
  font-size: 1.05em;
}

.explanation {
  margin-top: 0.8em;
  font-size: 0.95em;
  background: #fffcea;
  border-left: 4px solid #f1c40f;
  padding: 0.75em;
  border-radius: 4px;
  color: #333;
}

.error {
  background: #ffe6e6;
  border-left: 4px solid red;
  padding: 0.75em;
  margin-top: 1em;
  border-radius: 4px;
  color: #900;
  font-weight: bold;
}

.accordion-item {
  border-bottom: 1px solid #ddd;
}
.accordion-header {
  cursor: pointer;
  padding: 1rem;
  font-weight: bold;
  background-color: #f7f7f7;
  transition: background-color 0.3s ease;
}
.accordion-header:hover {
  background-color: #e9e9e9;
}
.accordion-content {
  display: none;
  padding: 0 1rem 1rem;
  background-color: #fff;
}
.accordion-item.active .accordion-content {
  display: block;
}
.accordion-item.active .accordion-header {
  background-color: #30dd87b8;
}

.infobox-m {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
}

.resistor-image {
  margin: 0 1em;
}

/* Responsive destek */
@media (max-width: 768px) {
  main {
    padding: 1rem;
  }

  h1 {
    margin-top: 5px;
    margin-bottom: 5px;
  }

  .responsive-table table {
    font-size: 0.9em;
    min-width: unset;
    width: 100%;
  }

  .responsive-table th,
  .responsive-table td {
    padding: 0.5em;
    word-break: break-word;
  }

  .bands label {
    flex: 1 1 45%;
    min-width: unset;
  }

  .band-option {
    width: 100%;
  }

  .modern-bands label {
    width: 100%;
  }

  select.band-option {
    width: 100%;
    max-width: 100%;
  }

  button {
    width: 100%;
  }

  #result {
    font-size: 1em;
  }

  .calculator h2 {
    font-size: 1.25em;
  }

  .calculator p {
    font-size: 0.95em;
  }

  .calculator.modern-box {
    padding: 1rem 1rem;
    margin-top: 0.5rem;
  }

  .accordion-header {
    padding: 1rem 0.5rem;
  }

  .resistor-image {
    margin: 0;
  }

  .infobox-m {
    flex-direction: column;
  }
}
