/* GENEL */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background-color: #faf9f6;
  color: #2c2c2c;
  transition: background-color 0.4s ease, color 0.4s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

header,
footer {
  padding: 2rem 1rem;
  flex-shrink: 0;
  text-align: center;
  user-select: none;
}

header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  background-color: transparent;
}

header h1 {
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-size: 2rem;
  margin-bottom: 0.7rem;
  color: #1a2a6c;
}

footer {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 0.9rem;
  color: #666;
  margin-top: auto;
  background-color: transparent;
}

/* Toggle buton */
input[type='checkbox'] {
  width: 0;
  height: 0;
  visibility: hidden;
}

label {
  width: 70px;
  height: 35px;
  position: fixed;
  top: 20px; /* Üstten mesafe */
  right: 20px; /* Sağdan mesafe */
  display: block;
  background: #ebebeb;
  border-radius: 50px;
  box-shadow: inset 0px 3px 8px rgba(0, 0, 0, 0.4),
    inset 0px -3px 8px rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: background 0.3s ease;
}

label:after {
  content: '';
  width: 25px;
  height: 25px;
  position: absolute;
  top: 5px;
  left: 5px;
  background: linear-gradient(180deg, #ffcc89, #d8860b);
  border-radius: 50%;
  box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.2);
  transition: left 0.3s ease, background 0.3s ease, transform 0.3s ease;
}

label svg {
  position: absolute;
  width: 14px; /* İkon boyutu */
  height: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  transition: fill 0.3s ease;
}

label svg.sun {
  left: 10px;
  fill: #fff;
}

label svg.moon {
  right: 10px;
  fill: #7e7e7e;
}

input[type='checkbox']:checked + label {
  background: #242424;
}

input[type='checkbox']:checked + label:after {
  left: 40px; /* Knob sağa kayma mesafesi */
  background: linear-gradient(180deg, #777, #3a3a3a);
}

input[type='checkbox']:checked + label svg.sun {
  fill: #7e7e7e;
}

input[type='checkbox']:checked + label svg.moon {
  fill: #fff;
}

/* MAIN CONTAINER */
main.container {
  max-width: 900px;
  flex-grow: 1;
  padding: 2.5rem 1.5rem;
}

/* SERTIFIKA KARTLARI GRID */
#certificatesList {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.8rem 1.8rem;
}

/* KARTLAR */
.card {
  padding: 1rem 1.5rem;
  border-radius: 1rem;
  background: rgba(255 255 255 / 0.9);
  box-shadow: 0 8px 32px rgb(31 38 135 / 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255 255 255 / 0.3);
  transition: box-shadow 0.3s ease, transform 0.25s ease;
  color: #1b1b1b;
  cursor: default;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 160px;
}

.card:hover,
.card:focus-within {
  box-shadow: 0 12px 48px rgb(31 38 135 / 0.18);
  transform: translateY(-3px);
  outline: none;
}

/* Kart başlığı */
.card h2 {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
  color: #0b1a58;
  line-height: 1.3;
  user-select: text;
}

/* Veren kuruluş */
.card p.issuer {
  font-style: italic;
  color: #666;
  font-size: 0.88rem;
  margin-bottom: 0.4rem;
  user-select: text;
}

/* Genel paragraf */
.card p {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 0.3rem;
  user-select: text;
  line-height: 1.2;
}

/* Link */
a {
  color: #1a2a6c;
  text-decoration: underline;
  word-break: break-word;
  font-weight: 600;
  font-size: 0.9rem;
  transition: color 0.25s ease;
  user-select: text;
}
a:hover,
a:focus {
  color: #0a58ca;
  text-decoration: none;
  outline-offset: 3px;
}

/* Küçük yazılar */
.small-text {
  font-size: 0.8rem;
  color: #888;
  user-select: text;
}

/* Koyu mod */
body.dark-mode {
  background-color: #1e1e2f;
  color: #d0d0d0;
}

body.dark-mode header h1 {
  color: #f0f0f0;
}

body.dark-mode footer {
  color: #999999;
  border-top-color: rgba(255 255 255 / 0.12);
}

body.dark-mode header {
  border-bottom-color: rgba(255 255 255 / 0.12);
}

body.dark-mode .card {
  background: rgba(40 40 55 / 0.75);
  box-shadow: 0 8px 32px rgb(255 255 255 / 0.08);
  border: 1px solid rgba(255 255 255 / 0.10);
  color: #e0e0e0;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

body.dark-mode .card:hover,
body.dark-mode .card:focus-within {
  box-shadow: 0 12px 48px rgb(255 255 255 / 0.15);
  transform: translateY(-3px);
}

body.dark-mode .card h2 {
  position: relative;
  color: #f5f5f5;
  padding: 0.15rem 0.6rem;
  border-radius: 0.5rem;
  background: rgba(255 255 255 / 0.1);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

body.dark-mode .card p,
body.dark-mode .card p.issuer {
  color: #bbb;
}

body.dark-mode a {
  color: #82b1ff;
  text-decoration: none;
  transition: color 0.3s ease;
}

body.dark-mode a:hover,
body.dark-mode a:focus {
  color: #a9c9ff;
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 767.98px) {
  main.container {
    max-width: 100%;
    padding: 1.5rem 1rem;
  }
  #certificatesList {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .card {
    height: auto;
    padding: 1.3rem 1.5rem;
  }
}

@media (max-width: 479.98px) {
  header h1 {
    font-size: 1.6rem;
  }
  .toggle-btn {
    font-size: 0.9rem;
    padding: 0.35rem 1.2rem;
  }
}
