/* Temel Ayarlar */
* {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

body.preload main,
body.preload footer,
body.preload header,
body.preload #darkModeToggle {
  opacity: 0;
  pointer-events: none;
}

body.ready main,
body.ready footer,
body.ready header,
body.ready #darkModeToggle {
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.5s ease;
}

body.ready header {
  transition: opacity 0.5s ease;
}

body.intro.ready header {
  transition: opacity 0.5s ease;
}
/* Başlangıçta preload varsa her şey gizli */
body.preload header,
body.preload main,
body.preload footer,
body.preload #darkModeToggle {
  opacity: 0;
  pointer-events: none;
}

/* Hazır olduğunda her şey fade ile görünür */
body.ready header,
body.ready main,
body.ready footer,
body.ready #darkModeToggle {
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.5s ease;
}

:root {
  --bg-color: #f2f2f7;
  --card-bg: #ffffff;
  --text-color: #000;
  --subtext-color: #555;
  --link-color: #0071e3;
  --button-bg: #0071e3;
  --button-hover: #005bb5;

  --intro-bg: #ffffff;
  --intro-text: #000000;
}

html.dark-mode {
  --bg-color: #1c1c1e;
  --card-bg: #2c2c2e;
  --text-color: #ffffff;
  --subtext-color: #a1a1a3;
  --link-color: #0a84ff;
  --button-bg: #0a84ff;
  --button-hover: #006fe0;

  --intro-bg: #000000;
  --intro-text: #f2f2f7;
}

img {
  opacity: 0;
  transition: opacity 0.6s ease;
}
img.loaded {
  opacity: 1;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  color: var(--text-color);
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 20px 40px;
  background-color: #000;
  color: #ffffff;
  font-size: 1.2em;
}

.header-left {
  font-weight: bold;
  font-size: 1.5em;
}

.header-right a {
  color: #ffffff;
  margin-left: 20px;
  font-size: 1.2em;
  transition: color 0.3s;
}

.header-right a:hover {
  color: var(--link-color);
}

.header-right a i {
  font-size: 1.2em;
}

/* Projeler */
main,
.projects {
  flex: 1;
}

.projects {
  max-width: 1200px;
  margin: 40px auto;
  text-align: center;
  padding: 0 15px;
}

h2 {
  font-size: 2em;
  margin-bottom: 20px;
}

.project-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 30px;
  padding: 0 15px 40px;
}

.card {
  flex: 1 1 calc(33.33% - 30px);
  max-width: 330px;
  min-height: 550px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: var(--card-bg);
  color: var(--text-color);
  border-radius: 10px;
  box-shadow: rgba(50, 50, 93, 0.25) 0px 6px 12px -2px,
    rgba(0, 0, 0, 0.3) 0px 3px 7px -3px;
  padding: 30px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin: 2px 0;
}

.card:hover {
  transform: scale(1.05);
  z-index: 2;
}

.card h3 {
  font-size: 1.5em;
  margin-bottom: 10px;
}

.card p {
  color: var(--subtext-color);
  margin-bottom: 15px;
}

.card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 15px;
}

/* Kart Butonları */
.card-buttons {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.card-buttons a {
  font-weight: bold;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 12px;
  border: 1px solid var(--link-color);
  background-color: transparent;
  color: var(--link-color);
  display: inline-block;
  width: 100%;
  text-align: center;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.card-buttons button.disabled {
  font-weight: bold;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 12px;
  border: 1px solid #3a3a3c;
  background-color: transparent;
  color: #6c6c70;
  display: inline-block;
  width: 100%;
  text-align: center;
  pointer-events: none;
  cursor: not-allowed;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.card-buttons a:hover {
  background-color: var(--link-color);
  color: #fff;
}

html.dark-mode .card-buttons a {
  background-color: #2c2c2e;
  color: #0a84ff;
  border-color: #0a84ff;
}

html.dark-mode .card-buttons a:hover {
  background-color: #0a84ff;
  color: #fff;
}

.card-buttons button {
  color: white;
  font-weight: bold;
  background-color: var(--button-bg);
  border: none;
  padding: 10px 20px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1em;
  width: 100%;
  text-align: center;
  box-sizing: border-box;
  transition: background-color 0.3s ease;
}

.card-buttons button:hover {
  background-color: var(--button-hover);
}

/* Featured kart */
.featured {
  border: 2px solid var(--link-color);
  box-shadow: 0 0 15px rgba(0, 113, 227, 0.5);
  transform: scale(1.05);
  transition: transform 0.3s, box-shadow 0.3s;
}

.featured:hover {
  transform: scale(1.08);
  box-shadow: 0 0 25px rgba(0, 113, 227, 0.7);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  position: relative;
  width: 90%;
  max-width: 800px;
  background-color: var(--card-bg);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.modal-content iframe {
  width: 100%;
  height: 500px;
  border-radius: 8px;
}

.close {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 24px;
  font-weight: bold;
  color: #333;
  cursor: pointer;
}

.close:hover {
  color: var(--link-color);
}

/* Footer */
.footer {
  background-color: #2e2e2e;
  color: #f2f2f7;
  padding: 20px 0;
  font-size: 14px;
  text-align: center;
  overflow-x: hidden;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 5px;
  padding: 0 10px;
}

.footer-section {
  flex: 1 1 120px;
  min-width: 100px;
  text-align: center;
}

.footer-section h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #f2f2f7;
}

.footer-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-section ul li {
  margin-bottom: 6px;
}

.footer-section ul li a {
  color: #a1a1a6;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-section ul li a:hover {
  color: #f2f2f7;
}

.footer-bottom {
  border-top: 1px solid #444;
  margin-top: 10px;
  padding-top: 10px;
}

.footer-bottom p {
  color: #a1a1a6;
  font-size: 12px;
  margin: 0;
  padding: 0 10px;
}

.footer a {
  color: #888;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer a:hover {
  color: inherit;
}

/* Dark Mode Toggle */
#darkModeToggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--button-bg);
  color: white;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
}

#darkModeToggle:hover {
  background-color: var(--button-hover);
}

#darkModeToggle i {
  font-size: 20px;
  transition: transform 0.4s ease;
}

.rotate-on {
  transform: rotate(180deg);
}

.rotate-off {
  transform: rotate(0deg);
}

/* Intro Overlay */
#introOverlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  justify-content: center;
  align-items: center;
  background-color: var(--intro-bg);
  color: var(--intro-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  font-weight: 600;
  font-size: clamp(3rem, 8vw, 6rem);
  transition: transform 0.6s ease-in-out;
  overflow: hidden;
  will-change: transform;
}

#greetingText {
  opacity: 0;
  animation: fadeIn 0.5s ease-in forwards;
  will-change: content;
}

#introOverlay.fade-out {
  transform: translateY(-100%);
}

/* Intro Card */

.intro-card {
  background-color: #ffffff;
  padding: 2rem;
  border-radius: 1rem;
  margin: 2rem auto;
  max-width: 750px;
  transform: scale(0.97) translateX(14px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transform-origin: center center;
  margin-bottom: -18px;
  display: block;
  margin-left: 589px;
  margin-right: auto;
  transition: transform 0.2s ease;
}

.intro-card-content {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.intro-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  transform: scale(1);
  border: 4px solid #444;
  object-fit: cover;
}

.intro-name {
  margin: 0;
  font-size: 1.5rem;
  color: black;
}

.intro-desc {
  margin-top: 0.5rem;
  color: #555;
  max-width: 500px;
  font-size: 0.95rem;
}

.intro-links {
  margin-top: 1rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.intro-button {
  text-decoration: none;
  background-color: #007aff;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.intro-button:hover {
  background-color: #005fcc;
}

.dark-mode .intro-card {
  background-color: #1c1c1e;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

.dark-mode .intro-name {
  margin: 0;
  font-size: 1.5rem;
  color: #ffffff;
}

.dark-mode .intro-desc {
  color: #bbb;
}

.dark-mode .intro-avatar {
  border: 4px solid #444;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

body.fade-out {
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

/* Temporary Fix */
@media (max-width: 768px) {
  .project-cards {
    flex-direction: column;
    align-items: center;
  }

  .card {
    flex: 1 1 100%;
    max-width: 90%;
  }
}

@media (min-width: 768px) {
  .intro-card:hover {
    transform: scale(0.985) translateX(14px);
  }
}

@media (max-width: 1600px) {
  .intro-card {
    margin-left: auto !important;
    margin-right: auto;
    transform: scale(0.97); /* Eski davranışa yakın */
    max-width: 55%;
    padding: 2rem;
  }

  .intro-card:hover {
    transform: scale(0.985); /* Hover sırasında çok hafif büyüme */
  }
}

@media (max-width: 1800px) {
  .intro-card {
    margin-left: auto !important;
    margin-right: auto;
    transform: scale(0.97); /* Eski davranışa yakın */
    max-width: 45%;
    padding: 2rem;
  }

  .intro-card:hover {
    transform: scale(0.985); /* Hover sırasında çok hafif büyüme */
  }
}

@media (max-width: 1115px) {
  .intro-card {
    margin-left: auto !important;
    margin-right: auto;
    transform: scale(0.97);
    max-width: 55%;
    padding: 2rem;
  }
}

@media (max-width: 1050px) {
  .intro-card {
    margin-left: auto !important;
    margin-right: auto;
    transform: scale(0.97);
    max-width: 55%;
    padding: 2rem;
  }
  .intro-card:hover {
    transform: scale(0.985); /* Hover sırasında çok hafif büyüme */
  }
}
@media (max-width: 800px) {
  .intro-card {
    margin-left: auto !important;
    margin-right: auto;
    transform: scale(0.97);
    max-width: 55%;
    padding: 2rem;
  }
  .intro-card:hover {
    transform: scale(0.985); /* Hover sırasında çok hafif büyüme */
  }
}

@media (max-width: 600px) {
  .header {
    flex-direction: column;
    align-items: center;
    padding: 12px;
    text-align: center;
  }

  .header-left {
    font-size: 1.4em;
    margin-bottom: 10px;
  }

  .header-right {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
  }

  .header-right a {
    font-size: 1.2em;
    padding: 6px;
    margin: 0 5px;
  }

  .main-title {
    transform: translateY(-10px);
  }

  #darkModeToggle {
    bottom: 50px;
  }

  .intro-card {
    margin: 1rem auto;
    transform: none;
    max-width: 87%;
    padding: 1.25rem;
    margin-left: auto;
    margin-right: auto;
  }

  .intro-card-content {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    flex-wrap: nowrap;
  }
  .intro-card:hover {
    transform: none;
  }
  .intro-desc,
  .intro-name,
  .intro-links {
    text-align: left;
  }

  .intro-links {
    justify-content: flex-start;
  }
}
