/* ==========================================
   GENEL
========================================== */

:root {
  --main: #000;
  --accent: #ffb43a;
  --bg: #0f0f0f;
  --card: #1a1a1a;
  --text: #eaeaea;
  --border: #2a2a2a;
}

html.light-theme {
  --main: #ffffff;
  --accent: #2563eb;
  --bg: #f5f5f5;
  --card: #ffffff;
  --text: #1e1e1e;
  --border: #dcdcdc;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
}

html,
body,
.section,
.vehicle-header,
.info-item,
.photo-owner,
.gallery-item,
.vehicle-code,
.theme-toggle {
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

body {
  padding: 30px 20px;
  font-family: "Inter", sans-serif;
  transition:
    background 0.2s,
    color 0.2s;
}

i {
  color: var(--accent);
}

a {
  color: var(--accent);
  text-decoration: none;
}

.container {
  max-width: 1100px;
  margin: auto;
}

/* ==========================================
   BÖLÜMLER
========================================== */

.section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  margin-bottom: 22px;
}

.section h2 {
  color: var(--text);
  font-size: 19px;
  margin: 0 0 20px;
}

/* ==========================================
   ÜST NAVİGASYON
========================================== */

.top-navigation {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 28px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;

  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;

  font-size: 14px;
  font-weight: 600;
  text-decoration: none;

  transition: all 0.25s ease;
}

.back-link i {
  font-size: 13px;
  color: var(--accent);
  transition: transform 0.25s ease;
}

.back-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--card));
  transform: translateX(-3px);
}

.back-link:hover i {
  transform: translateX(-3px);
}

/* ==========================================
   KAPI KODU
========================================== */

.vehicle-code {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;

  min-width: 180px;
  padding: 15px 25px;

  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 11px;

  position: relative;
}

.vehicle-code span {
  color: var(--text);
  opacity: 0.55;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
}

.vehicle-code strong {
  color: var(--accent);
  font-size: 23px;
  font-weight: 800;
}

.vehicle-code i {
  position: absolute;
  right: 12px;
  top: 12px;
  color: var(--accent);
  opacity: 0.9;
  font-size: 25px;
}

/* ==========================================
   ARAÇ BİLGİLERİ
========================================== */

.vehicle-info {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.info-item {
  grid-column: span 2;
  min-width: 0;

  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 15px;
}

.info-item span {
  display: block;
  color: var(--accent);
  font-size: 12px;
  margin-bottom: 8px;
  font-weight: bold;
}

.info-item strong {
  color: var(--text);
  font-size: 15px;
  overflow-wrap: anywhere;
}

/* ==========================================
   FOTOĞRAF SAHİBİ
========================================== */

.photo-owner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;

  margin-top: 14px;
  padding: 12px 16px;

  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 9px;

  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
}

.photo-owner b {
  color: var(--text);
  font-weight: 700;
}

.photo-owner a {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  color: var(--accent);
  font-weight: 700;
  text-decoration: none;

  transition: opacity 0.2s ease;
}

.photo-owner a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.photo-owner a i {
  font-size: 0.75em;
  margin-left: 4px;
}

/* ==========================================
   ANA FOTOĞRAF
========================================== */

.main-photo {
  display: block;

  width: auto;
  height: auto;

  max-width: 100%;

  object-fit: contain;
  object-position: center;

  margin: 0 auto;

  border-radius: 10px;
  background: var(--bg);

  cursor: zoom-in;
}

/* ==========================================
   GALERİ BAŞLIĞI
========================================== */

.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.gallery-header h2 {
  margin-bottom: 20px;
}

.photo-count {
  color: var(--text);
  opacity: 0.6;
  font-size: 15px;
  white-space: nowrap;
}

/* ==========================================
   FOTOĞRAF GALERİSİ
========================================== */

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.gallery-item {
  min-width: 0;
  overflow: hidden;

  border-radius: 9px;
  background: var(--bg);
  border: 1px solid var(--border);

  cursor: zoom-in;

  transition:
    border-color 0.2s,
    transform 0.2s;
}

.gallery-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.gallery-item img {
  display: block;

  aspect-ratio: 16 / 10;
  width: 100%;
  height: 350px;
  object-fit: cover;
  object-position: center;

  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.04);
}

.gallery-item p {
  padding: 10px;
  margin: 0;

  font-size: 17px;
  color: var(--text);
  opacity: 0.7;

  overflow-wrap: anywhere;
}

.gallery-item p a {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;

  color: var(--accent);
  font-weight: 700;
  text-decoration: none;

  transition: opacity 0.2s ease;
}

.gallery-item p a:hover {
  opacity: 0.75;
  text-decoration: underline;
}

.gallery-item p i,
.gallery-item p a i {
  color: var(--accent);
  font-size: 10px;
}

/* ==========================================
   FOTOĞRAF YOK
========================================== */

.no-photos {
  padding: 40px 15px;
  text-align: center;
  color: var(--text);
  opacity: 0.65;
}

.no-photos i {
  font-size: 35px;
  margin-bottom: 15px;
  color: var(--accent);
}

/* ==========================================
   TEMA BUTONU
========================================== */

.theme-toggle {
  position: fixed;
  top: 20px;
  right: 10px;
  z-index: 9999;

  width: 45px;
  height: 45px;

  border: none;
  outline: none;
  border-radius: 50%;

  background: transparent;
  cursor: pointer;
  font-size: 17px;

  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);

  transition: all 0.25s ease;
}

.theme-toggle:hover {
  transform: scale(1.05);
}

.theme-toggle i {
  display: inline-block;
  transition:
    transform 0.2s ease,
    color 0.25s ease;
}

/* Koyu tema */

html:not(.light-theme) .theme-toggle i {
  color: #ffb43a;
}

html:not(.light-theme) .theme-toggle:hover {
  background: #ffb43a;
}

html:not(.light-theme) .theme-toggle:hover i {
  color: #000000;
}

/* Açık tema */

html.light-theme .theme-toggle i {
  color: #2563eb;
}

html.light-theme .theme-toggle:hover {
  background: #2563eb;
}

html.light-theme .theme-toggle:hover i {
  color: #ffffff;
}

/* ==========================================
   LIGHTBOX - GENEL
========================================== */

#lightbox {
  display: none;

  position: fixed;
  inset: 0;

  z-index: 99999;

  width: 100%;
  height: 100vh;
  height: 100dvh;

  padding: max(55px, env(safe-area-inset-top))
    max(15px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom))
    max(15px, env(safe-area-inset-left));

  background: rgba(0, 0, 0, 0.97);

  align-items: center;
  justify-content: center;

  gap: 0;
  overflow: hidden;
}

#lightbox.active {
  display: flex;
}

/* Fotoğraf ve bilgi alanı */

.lightbox-content {
  display: flex;
  flex-direction: column;

  align-items: center;
  justify-content: center;

  width: 100%;
  height: 100%;

  max-width: 100%;
  max-height: 100%;

  min-width: 0;
  min-height: 0;

  gap: 12px;
}

/* ==========================================
   LIGHTBOX FOTOĞRAFI
========================================== */

#lightboxImage {
  display: block;

  width: auto;
  height: auto;

  max-width: calc(100vw - 140px);
  max-width: calc(100dvw - 140px);

  max-height: calc(100vh - 170px);
  max-height: calc(100dvh - 170px);

  object-fit: contain;
  object-position: center;

  flex-shrink: 1;

  border-radius: 8px;
  background: transparent;

  image-rendering: auto;
}

/* ==========================================
   LIGHTBOX FOTOĞRAF BİLGİLERİ
========================================== */

.lightbox-meta {
  display: flex;
  flex-direction: column;

  align-items: center;
  justify-content: center;

  flex-shrink: 0;

  width: 100%;
  max-width: 100%;

  gap: 7px;
}

#lightboxOwner {
  display: flex;

  align-items: center;
  justify-content: center;
  flex-wrap: wrap;

  gap: 6px;

  width: fit-content;
  max-width: 100%;

  margin: 0;
  padding: 7px 16px;

  background: rgba(255, 255, 255, 0.09);

  border: 1px solid rgba(255, 255, 255, 0.18);
  border-left: 4px solid var(--accent);

  border-radius: 9px;

  color: #ffffff;

  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;

  text-align: center;
  overflow-wrap: anywhere;
}

#lightboxOwner a {
  color: #ffffff;
  text-decoration: none;
}

#lightboxOwner a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ==========================================
   LIGHTBOX FOTOĞRAF SAYACI
========================================== */

#lightboxCounter {
  position: absolute;

  right: 18px;
  bottom: 18px;

  padding: 8px 15px;
  border-radius: 20px;

  background: rgba(20, 22, 28, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.18);

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  color: #ffffff;

  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;

  text-align: center;

  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  z-index: 5;
}

/* Koyu tema sayacı */

html:not(.light-theme) #lightboxCounter {
  background: rgba(0, 0, 0, 0.88);
  color: #ffb43a;
  border: 1px solid rgba(255, 180, 58, 0.55);
  box-shadow: 0 4px 18px rgba(255, 180, 58, 0.12);
}

/* Açık tema sayacı */

html.light-theme #lightboxCounter {
  background: rgba(255, 255, 255, 0.95);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.35);
  box-shadow: 0 4px 18px rgba(37, 99, 235, 0.12);

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ==========================================
   LIGHTBOX KAPATMA BUTONU
========================================== */

#lightboxClose {
  position: absolute;

  top: max(12px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));

  z-index: 10;

  width: 44px;
  height: 44px;

  display: flex;
  align-items: center;
  justify-content: center;

  border: none;
  border-radius: 50%;

  background: rgba(255, 255, 255, 0.12);

  color: #ffffff;

  font-size: 32px;
  line-height: 1;

  cursor: pointer;
}

#lightboxClose:hover {
  color: var(--accent);
}

/* ==========================================
   LIGHTBOX GEZİNME OKLARI
========================================== */

.lightbox-arrow {
  position: absolute;
  top: 50%;

  width: 48px;
  height: 48px;

  display: flex;
  align-items: center;
  justify-content: center;

  flex-shrink: 0;

  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;

  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;

  font-size: 18px;

  cursor: pointer;

  transform: translateY(-50%);
  transition: 0.2s;
}

.lightbox-arrow.prev {
  left: 20px;
}

.lightbox-arrow.next {
  right: 20px;
}

.lightbox-arrow:hover {
  background: var(--accent);
  color: var(--main);
  border-color: var(--accent);
}

/* Koyu tema okları */

html:not(.light-theme) .lightbox-arrow {
  background: #000000;
  color: #ffb43a;
  border: 1px solid #ffb43a;
}

html:not(.light-theme) .lightbox-arrow:hover {
  background: #ffb43a;
  color: #000000;
  border-color: #ffb43a;
}

/* Açık tema okları */

html.light-theme .lightbox-arrow {
  background: #ffffff;
  color: #2563eb;
  border: 1px solid #2563eb;
}

html.light-theme .lightbox-arrow:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.lightbox-arrow i {
  color: inherit !important;
  transition: color 0.2s ease;
}

html:not(.light-theme) .lightbox-arrow:hover i {
  color: #000000 !important;
}

html.light-theme .lightbox-arrow:hover i {
  color: #ffffff !important;
}

/* ==========================================
   PC VE LAPTOP
========================================== */

@media (min-width: 768px) {
  .info-item:nth-child(7) {
    grid-column: span 2;
  }

  .info-item:nth-child(8) {
    grid-column: span 4;
  }
}

/* ==========================================
   TELEFON VE TABLET
========================================== */

@media (max-width: 767px) {
  .theme-toggle {
    width: 35px;
    height: 35px;
    top: 5px;
    right: 5px;
    font-size: 17px;
  }

  .filter-box {
    margin-top: 35px;
  }

  .vehicle-info {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .info-item:nth-child(-n + 6) {
    grid-column: span 1;
  }

  .info-item:nth-child(7),
  .info-item:nth-child(8) {
    grid-column: 1 / -1;
  }

  .info-item strong {
    font-size: 12px;
  }

  .info-item:last-child strong {
    font-size: 10px;
  }

  .gallery-item img {
    height: auto;
  }
}

/* ==========================================
   KÜÇÜK EKRANLAR
========================================== */

@media (max-width: 650px) {
  body {
    padding: 20px 10px;
  }

  .vehicle-header {
    padding: 13px;
    gap: 10px;
    align-items: flex-start;
  }

  .vehicle-title h1 {
    font-size: 21px;
  }

  .vehicle-subtitle {
    font-size: 9px;
  }

  .top-navigation {
    gap: 10px;
    align-items: flex-start;
  }

  .back-link {
    padding: 10px 12px;
    font-size: 12px;
  }

  .vehicle-code {
    min-width: 120px;
    padding: 5px;

  }

  .vehicle-code span {
    font-size: 6px;
  }

  .vehicle-code strong {
    font-size: 14px;
  }

  .vehicle-code i {
    font-size: 20px;
    right: 6px;
    top: 6px;
  }

  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .section {
    padding: 15px;
  }

  .vehicle-tags span {
    font-size: 13px;
  }

  .main-photo {
    max-width: 100%;
    max-height: 65vh;
    max-height: 65dvh;
  }

  /* Lightbox */

  #lightbox {
    flex-direction: column;
    justify-content: center;
    gap: 12px;

    padding: 50px 10px 15px;
  }

  .lightbox-content {
    width: 100%;
    height: auto;

    max-width: 100%;
    max-height: calc(100dvh - 145px);

    flex: 0 1 auto;
  }

  #lightboxImage {
    max-width: calc(100dvw - 20px);
    max-height: calc(100dvh - 190px);

    width: auto;
    height: auto;

    object-fit: contain;
    border-radius: 5px;
  }

  #lightboxOwner {
    font-size: 12px;
    padding: 8px 11px;
  }

  #lightboxClose {
    top: max(8px, env(safe-area-inset-top));
    right: 10px;

    width: 38px;
    height: 38px;

    font-size: 27px;
  }

  /* Okları fotoğrafın altına taşı */

  .lightbox-arrow {
    position: absolute;

    top: auto;
    bottom: 12px;

    width: 42px;
    height: 42px;

    font-size: 16px;

    transform: none;
    z-index: 20;
  }

  .lightbox-arrow.prev {
    left: calc(50% - 52px);
    right: auto;
  }

  .lightbox-arrow.next {
    right: calc(50% - 52px);
    left: auto;
  }
}

/* ==========================================
   TELEFONDA KÜÇÜK YAZILAR
========================================== */

@media (max-width: 600px) {
  .gallery-item p {
    font-size: 9px;
  }

  .photo-owner {
    font-size: 10px;
  }

  #lightboxCounter {
    right: 12px;
    bottom: 12px;

    padding: 10px 20px;
    font-size: 14px;
  }
}

/* ==========================================
   TABLET
========================================== */

@media (min-width: 651px) and (max-width: 1100px) {
  #lightboxImage {
    max-width: calc(100dvw - 120px);
    max-height: calc(100dvh - 160px);
  }

  .lightbox-arrow {
    width: 42px;
    height: 42px;
  }
}

/* ==========================================
   KISA EKRAN / YATAY TELEFON
========================================== */

@media (max-height: 600px) {
  #lightboxImage {
    max-height: 58vh;
  }

  #lightboxOwner {
    padding: 7px 12px;
  }

  #lightboxCounter {
    margin-top: 5px;
  }
}

@media (max-height: 500px) {
  #lightbox {
    padding-top: 45px;
    padding-bottom: 8px;
  }

  #lightboxImage {
    max-height: calc(100dvh - 95px);
  }

  .lightbox-content {
    gap: 5px;
  }

  #lightboxOwner {
    padding: 5px 10px;
    font-size: 11px;
  }

  #lightboxCounter {
    font-size: 10px;
  }
}

.lightbox-photo-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    margin-left: 9px;
    padding: 4px 9px;

    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.2px;

    color: #e5e5e5;
    background: rgba(255, 255, 255, 0.06);

    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 6px;

    white-space: nowrap;
    vertical-align: middle;
}

.lightbox-photo-date i {
    color: #FFB43A;
    font-size: 11px;
}

@media (max-width: 600px) {
  .lightbox-photo-date {
    font-size: 9px;
    padding: 3px 6px;
    gap: 4px;
  }
}

/* ==========================================
   ÜST NAVİGASYON FOTOĞRAF YÜKLEME BUTONU
========================================== */

.top-navigation {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
}

.top-navigation .back-link {
    justify-self: start;
}

.top-navigation .vehicle-code {
    justify-self: end;
}

.top-upload-button {
    justify-self: center;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 12px 20px;

    background: var(--accent);
    color: #000;

    border: 1px solid var(--accent);
    border-radius: 10px;

    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;

    transition: all .2s ease;
}

.top-upload-button i {
    color: inherit;
}

.top-upload-button:hover {
    filter: brightness(.92);
    transform: translateY(-2px);
}

html.light-theme .top-upload-button {
    color: #fff;
}

@media (max-width: 650px) {

.top-navigation {
    grid-template-columns: 1fr auto 1fr;
    column-gap: 30px;
    row-gap: 5px;
}

.top-upload-button {
    transform: translateX(-5px);
}

    .top-navigation .back-link {
        padding: 9px 8px;
        font-size: 10px;
        gap: 5px;
    }

    .top-navigation .vehicle-code {
        min-width: 0;
        width: 100%;
        padding: 7px 4px;
    }

    .top-navigation .vehicle-code strong {
        font-size: 13px;
    }

    .top-navigation .vehicle-code span {
        font-size: 6px;
    }

    .top-navigation .vehicle-code i {
        font-size: 14px;
        right: 4px;
        top: 5px;
    }

    .top-upload-button {
        padding: 9px 8px;
        gap: 5px;
        font-size: 9px;
        border-radius: 8px;
    }

    .top-upload-button i {
        font-size: 10px;
    }
}