body {
  font-family: 'Segoe UI', sans-serif;
  margin: 0;
  padding: 0;
  background: #f4f7f9;
  color: #333;
  transition: background 0.3s, color 0.3s;
}

.container {
  max-width: 600px;
  margin: 20px auto;
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

h1 {
  text-align: center;
  margin-bottom: 20px;
}

.inputs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.inputs input {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.legend {
  margin-top: 15px;
  margin-bottom: 10px;
  background: #e0f7fa;
  padding: 10px;
  border-radius: 8px;
  font-size: 14px;
}

.legend-box {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 6px;
  border-radius: 4px;
  vertical-align: middle;
}

.legend-1 { background-color: #a3d9a5; }
.legend-2 { background-color: #90caf9; }
.legend-H { background-color: #ffe082; }
.legend-Y { background-color: #ffab91; }

.days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  margin: 20px 0;
}

.day {
  background: #eee;
  border-radius: 5px;
  text-align: center;
  padding: 8px 5px;
  cursor: pointer;
  user-select: none;
  font-weight: bold;
  transition: background 0.3s;
  height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  gap: 4px;
}

.day-number {
  font-size: 16px;
  font-weight: bold;
}

.day-value {
  font-size: 18px;
  font-weight: bold;
  min-height: 20px;
}

.day.active-1 { background-color: #a3d9a5 !important; color: #000; }
.day.active-2 { background-color: #90caf9 !important; color: #000; }
.day.active-H { background-color: #ffe082 !important; color: #000; }
.day.active-Y { background-color: #ffab91 !important; color: #000; }

button {
  width: 100%;
  padding: 12px;
  background-color: #0077cc;
  color: white;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.results {
  margin-top: 20px;
  font-size: 16px;
  background-color: #f1f8ff;
  padding: 15px;
  border-radius: 10px;
  white-space: pre-wrap;
}

/* 🌞/🌙 toggle */
.theme-toggle {
  position: fixed;
  top: 15px;
  right: 15px;
  width: 70px;
  height: 36px;
  background: #ffecb3;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  transition: background 0.4s ease;
}

.theme-toggle .slider {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 0 6px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.theme-toggle .icon {
  font-size: 16px;
  z-index: 2;
  user-select: none;
}

.theme-toggle .circle {
  position: absolute;
  width: 28px;
  height: 28px;
  background: white;
  border-radius: 50%;
  top: 4px;
  left: 4px;
  transition: transform 0.4s ease;
  z-index: 1;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* DARK MODE */
body.dark {
  background: #121212;
  color: #eee;
}

body.dark .container {
  background: #1e1e1e;
  color: #eee;
}

body.dark .results {
  background-color: #263238;
}

body.dark input,
body.dark button {
  background-color: #2c2c2c;
  color: #eee;
  border: 1px solid #555;
}

body.dark .legend {
  background: #37474f;
}

body.dark .day {
  background: #2c2c2c;
  color: #eee;
}

body.dark .theme-toggle {
  background: #90a4ae;
}

body.dark .theme-toggle .circle {
  transform: translateX(34px);
}

/* Accordion: Renk Anlamları */
.legend-wrapper {
  margin: 15px 0;
}

.legend-toggle {
  background-color: #0077cc;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-size: 15px;
  width: 100%;
  cursor: pointer;
}

.legend-content {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.4s ease;
  background: #e0f7fa;
  border-radius: 8px;
  padding: 0 10px;
}

.legend-content div {
  padding: 8px 0;
  font-size: 14px;
}

/* Açıkken */
.legend-wrapper.open .legend-content {
  max-height: 800px;
  padding: 10px;
}

/* Takvim kontrolleri */
.calendar-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.calendar-controls select {
  flex: 1;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: white;
  font-size: 14px;
  min-width: 100px;
}

.small-btn {
  padding: 8px 12px !important;
  font-size: 14px !important;
  width: auto !important;
  white-space: nowrap;
}

/* Takvim grid */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-header {
  background: #0077cc;
  color: white;
  text-align: center;
  padding: 8px 4px;
  font-weight: bold;
  font-size: 12px;
  border-radius: 4px;
}

.calendar-day {
  background: #f5f5f5;
  border-radius: 4px;
  text-align: center;
  padding: 6px 4px;
  cursor: pointer;
  user-select: none;
  transition: background 0.3s;
  min-height: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.calendar-day.empty {
  background: transparent;
  cursor: default;
}

.calendar-day-number {
  font-size: 13px;
  font-weight: bold;
}

.calendar-day-value {
  font-size: 10px;
  font-weight: bold;
  min-height: 18px;
  line-height: 1.2;
}

.calendar-day.active-1 { background-color: #a3d9a5 !important; }
.calendar-day.active-2 { background-color: #90caf9 !important; }
.calendar-day.active-H { background-color: #ffe082 !important; }
.calendar-day.active-Y { background-color: #ffab91 !important; }

/* Karanlık modda accordion uyumu */
body.dark .legend-content {
  background: #37474f;
  color: #eee;
}

body.dark .legend-toggle {
  background-color: #455a64;
  color: white;
}

body.dark .calendar-controls select {
  background: #2c2c2c;
  color: #eee;
  border: 1px solid #555;
}

body.dark .calendar-header {
  background: #455a64;
}

body.dark .calendar-day {
  background: #2c2c2c;
  color: #eee;
}

/* Sonuç kartları */
.results {
  margin-top: 20px;
  background-color: #f1f8ff;
  border-radius: 12px;
  padding: 15px 20px;
  font-size: 15px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  line-height: 1.7;
  white-space: pre-wrap;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.result-item {
  display: flex;
  gap: 8px;
  align-items: center;
}

.result-item strong {
  margin-left: auto;
}

.total-box {
  background-color: #0077cc;
  color: white;
  font-weight: bold;
  font-size: 18px;
  text-align: center;
  padding: 12px;
  border-radius: 10px;
  margin-top: 15px;
}

body.dark .results {
  background-color: #263238;
}

body.dark .total-box {
  background-color: #0288d1;
}

/* Kayıtlı Maaşlar Listesi */
.salary-list {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.salary-card {
  padding: 12px 16px;
  background-color: #e0f7fa;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
}

.salary-card .info {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: nowrap;
}

.salary-card .month {
  font-weight: bold;
  color: #0077cc;
  white-space: nowrap;
}

.salary-card .amount {
   font-weight: bold;
  color: #333;
  white-space: nowrap;
}

.salary-card button {
  background: none;
  border: none;
  color: #e53935;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  transition: transform 0.2s;
  width: 100px;
}

body.dark .salary-card {
  background-color: #37474f;
  color: white;
}

body.dark .salary-card .month {
  color: #4fc3f7;
}

body.dark .salary-card .amount {
  color: #ffffff;
}

body.dark .salary-card button {
  color: #ef9a9a;
}

.page-toggle {
  position: fixed;
  top: 15px;
  left: 15px;
  background: #0077cc;
  color: white;
  border-radius: 18px;
  cursor: pointer;
  padding: 6px 14px;
  font-weight: 600;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  box-shadow: 0 3px 8px rgba(0, 119, 204, 0.5);
  transition: background-color 0.3s ease;
  z-index: 1000;
}

.page-toggle:hover {
  background-color: #005fa3;
}

.page-toggle .icon {
  font-size: 18px;
}

.page-toggle:active {
  transform: scale(0.95);
  transition: transform 0.1s ease;
}