* {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  box-sizing: border-box;
}

html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  background-color: #f0f0f0;
  font-family: 'Garet', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Desktop için merkezleme */
@media (min-width: 769px) {
  body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
  }
}

/* Mobil için tam ekran ve scroll optimizasyonu */
@media (max-width: 768px) {
  html {
    height: 100%;
    height: 100dvh;
    overflow-x: hidden;
    overflow-y: hidden;
    position: fixed;
    width: 100%;
    left: 0;
    right: 0;
  }

  body {
    height: 100%;
    height: 100dvh;
    overflow-x: hidden;
    overflow-y: hidden;
    width: 100%;
    position: fixed;
    display: flex;
    flex-direction: column;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
  }
}

@font-face {
  font-family: 'Garet';
  src: url('../Garet-Book.woff2') format('woff2');
  font-style: normal;
  font-weight: normal;
}

.container {
  width: 100%;
  max-width: 400px;
  background-color: white;
  border-radius: 0;
  box-shadow: none;
  overflow-x: hidden;
  text-align: center;
  background-image: url('../images/back3.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: scroll;
  position: relative;
  display: flex;
  flex-direction: column;
  margin: 0 auto;
}

/* Desktop için merkezleme */
@media (min-width: 769px) {
  .container {
    min-height: 100vh;
    height: auto;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
    margin: 20px auto;
  }
}

/* Mobil için tam ekran ve scroll optimizasyonu */
@media (max-width: 768px) {
  .container {
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    min-height: 100%;
    min-height: 100dvh;
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    position: relative;
    padding: 0;
    padding-left: 0;
    padding-right: 0;
    overscroll-behavior-y: contain;
    overscroll-behavior-x: none;
    display: flex;
    flex-direction: column;
  }

  /* Container içindeki ana içerik alanı */
  .container > header ~ *:not(footer) {
    flex: 0 0 auto;
  }

  /* Container içeriğinin scroll edilebilir olması için wrapper */
  .container > main,
  .container > .welcome,
  .container > .menu,
  .container > .buttons,
  .container > .post1,
  .container > .kurum,
  .container > .h2,
  .container > .son,
  .container > .son2 {
    flex: 0 0 auto;
  }

  /* Tüm içerik elementlerinin sağ ve sol padding'ini eşitle */
  .container > *:not(header):not(footer) {
    box-sizing: border-box;
  }

  /* Welcome bölümü */
  .welcome {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  /* Menu grid */
  .menu {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  /* Butonlar - zaten genel tanımda var */

  /* Post/Image container */
  .post1 {
    margin-left: 15px !important;
    margin-right: 15px !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    width: calc(100% - 30px) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
  }

  /* Image container içindeki tüm içerikleri merkezle */
  #imageContainer {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    text-align: center !important;
  }

  #imageContainer .image {
    margin-left: auto !important;
    margin-right: auto !important;
    display: block !important;
  }

  /* Kurum kartları */
  .kurum {
    padding-left: 15px !important;
    padding-right: 15px !important;
  }

  /* Başlık */
  .h2 {
    margin-left: 15px !important;
    margin-right: 15px !important;
  }

  /* Info container - post1 içindeki için özel */
  .post1 .info-container {
    width: calc(100% - 20px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

/* Footer'ın altında boşluk bırakmak için son içerik elemanına margin ekle */
.container > *:last-child:not(footer):not(.son):not(.son2) {
  margin-bottom: 20px;
  padding-bottom: 20px;
}

@media (max-width: 768px) {
  .container > *:last-child:not(footer):not(.son):not(.son2) {
    margin-bottom: 20px;
    padding-bottom: 20px;
  }
}

header {
  background-color: white;
  color: white;
  text-align: center;
  padding: 15px 10px;
  padding-left: 70px; /* Back button için alan */
  position: sticky;
  top: 0;
  z-index: 100;
  background-image: url('../images/back.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 100%;
}

@media (max-width: 768px) {
  header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding-left: 70px;
  }
}

/* Ana sayfada padding'i normale döndür */
.index-page header {
  padding-left: 10px;
  padding-right: 10px;
}

header h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
  font-weight: normal;
  flex: 1;
  text-align: center;
}

@media (max-width: 480px) {
  header {
    padding: 12px 8px;
    padding-left: 60px;
    min-height: 56px;
  }

  header h2 {
    font-size: 16px;
    line-height: 1.3;
  }
}

header .close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
}

.welcome {
  padding: 25px 20px;
  animation: fadeIn 0.4s ease-in;
}

.welcome p {
  margin: 8px 0;
  font-size: 14px;
  color: #333;
}

.welcome h2 {
  margin: 12px 0;
  font-size: 22px;
  color: #2d4653;
  font-weight: bold;
}

.welcome h3 {
  margin: 10px 0;
  font-size: 20px;
  color: #2d4653;
}

@media (max-width: 480px) {
  .welcome {
    padding: 20px 15px;
  }

  .welcome h2 {
    font-size: 20px;
  }

  .welcome h3 {
    font-size: 18px;
  }

  .welcome p {
    font-size: 13px;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.notification-btn {
  background-color: #003366;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  margin-top: 10px;
}

.menu {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: minmax(70px, auto);
  gap: 12px;
  padding: 20px;
  animation: fadeIn 0.5s ease-in;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 480px) {
  .menu {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 15px;
  }
}

.menu-item {
  background-color: #de9f26;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 70px;
  font-size: 14px;
  text-align: center;
  color: #2d4653;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

.menu-item::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.menu-item:active::before {
  width: 300px;
  height: 300px;
}

.menu-item i {
  font-size: 26px;
  margin-bottom: 6px;
  color: #2d4653;
  transition: transform 0.3s;
  z-index: 1;
}

.menu-item span {
  font-size: 12px;
  font-weight: 500;
  z-index: 1;
}

.menu-item:active {
  transform: scale(0.95);
  background-color: #c88f1f;
}

.menu-item:active i {
  transform: scale(1.1);
}

/* Mobil için daha büyük dokunma alanları */
@media (max-width: 480px) {
  .menu-item {
    min-height: 80px;
    border-radius: 10px;
  }

  .menu-item i {
    font-size: 30px;
    margin-bottom: 8px;
  }

  .menu-item span {
    font-size: 13px;
    font-weight: 600;
  }
}

/* Hover sadece dokunmatik olmayan cihazlarda */
@media (hover: hover) {
  .menu-item:hover {
    background-color: #c88f1f;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  }

  .menu-item:hover i {
    transform: scale(1.1);
  }
}

footer {
  background-color: #fffcf0;
  color: white;
  padding: 18px 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  position: relative;
  z-index: 50;
  flex-shrink: 0;
  margin-top: auto;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

@media (max-width: 768px) {
  footer {
    position: relative;
    margin-top: auto;
  }
}

/* Bu kural yukarıda tanımlandı, tekrar tanımlamaya gerek yok */

@media (max-width: 480px) {
  footer {
    padding: 12px 8px;
    gap: 6px;
  }
}

.post1 {
  border: none;
  margin: 10px;
  padding: 10px;
  border-radius: 8px;
  text-align: center;
  min-height: 300px;
  background: transparent;
  animation: fadeIn 0.4s ease-in;
  width: calc(100% - 20px);
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

@media (max-width: 480px) {
  .post1 {
    margin: 8px 15px;
    padding: 8px;
    min-height: 250px;
    width: calc(100% - 30px) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
  }
}

.image {
  max-width: 100%;
  width: 100%;
  height: auto;
  margin: 0 auto 5px auto;
  border-radius: 0px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: block;
  object-fit: contain;
  box-sizing: border-box;
}

@media (max-width: 480px) {
  .image {
    max-width: 100%;
    margin-bottom: 8px;
  }
}

.image1 {
  max-width: 28%;
  width: auto;
  height: auto;
  max-height: 80px;
  min-height: 50px;
  margin: 0 4px;
  border-radius: 0px;
  transition: transform 0.2s;
  flex-shrink: 0;
  object-fit: contain;
  box-sizing: border-box;
}

.image1:active {
  transform: scale(0.95);
}

@media (max-width: 480px) {
  .image1 {
    max-width: 32%;
    max-height: 70px;
    min-height: 45px;
    margin: 0 3px;
  }

  footer {
    padding: 12px 8px;
    gap: 6px;
  }
}

/* Back button */
.back-btn {
  position: absolute;
  top: 15px;
  left: 15px;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 101;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  touch-action: manipulation;
  text-decoration: none;
  color: inherit;
}

.back-btn i {
  color: #2d4653;
  font-size: 20px;
  transition: transform 0.3s;
}

.back-btn:active,
.back-btn:focus {
  transform: scale(0.9);
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.back-btn:active i {
  transform: translateX(-3px);
}

/* Hover effect for non-touch devices */
@media (hover: hover) {
  .back-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateX(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }

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

@media (max-width: 480px) {
  .back-btn {
    width: 48px;
    height: 48px;
    top: 10px;
    left: 10px;
  }

  .back-btn i {
    font-size: 22px;
  }
}

/* Buttons */
.button {
  color: black;
  padding: 12px 15px;
  margin: 6px;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  background-color: #de9f26;
  transition: all 0.3s;
  font-size: 14px;
  font-weight: 500;
  touch-action: manipulation;
  min-height: 44px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
  flex-shrink: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.button:active {
  transform: scale(0.95);
  background-color: #c88f1f;
}

.button.active {
  background-color: #007bff;
  color: white;
  box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

@media (max-width: 480px) {
  .button {
    padding: 12px 10px;
    font-size: 13px;
    margin: 4px;
    min-height: 48px;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.3;
  }
}

.buttons {
  margin-bottom: 15px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0 15px;
  animation: fadeIn 0.4s ease-in;
  width: 100%;
  box-sizing: border-box;
  gap: 4px;
}

@media (max-width: 480px) {
  .buttons {
    padding: 0 15px;
    margin-bottom: 12px;
  }
}

/* Bilgiler sayfası için özel stiller */
.info-container {
  max-width: 100%;
  margin: 0 auto;
  text-align: left;
  background-color: rgba(248, 248, 248, 0.95);
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  min-height: auto;
}

.info-item {
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.6;
  padding: 8px;
  background: white;
  border-radius: 5px;
}

.info-item .name {
  font-weight: bold;
  color: #2d4653;
}

h4 {
  text-align: left;
  font-size: 18px;
  margin-bottom: 10px;
  color: #2d4653;
}

.small-text {
  font-size: 13px;
  color: #666;
  margin-bottom: 15px;
  text-align: center;
}

.info-container a {
  text-decoration: none;
  color: #007bff;
  word-break: break-all;
}

.info-container a:active {
  color: #0056b3;
}

@media (max-width: 480px) {
  .info-container {
    padding: 12px;
  }

  .info-item {
    font-size: 13px;
    padding: 10px;
    margin-bottom: 10px;
  }

  h4 {
    font-size: 16px;
    margin-bottom: 8px;
  }

  .small-text {
    font-size: 12px;
    margin-bottom: 12px;
  }
}

/* Loading spinner */
.loading {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #de9f26;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

@media (max-width: 768px) {
  html {
    -webkit-overflow-scrolling: touch;
  }
}

/* Kurumlar sayfası için özel stiller */
.kurum {
  text-align: center;
  padding: 20px 15px;
  margin-bottom: 15px;
  animation: fadeIn 0.4s ease-in;
}

.kurum .image {
  max-width: 50%;
  width: 100%;
  height: auto;
  margin: 15px auto;
  display: block;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  object-fit: contain;
  box-sizing: border-box;
}

a.konum-link {
  color: #007bff;
  text-decoration: none;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
  padding: 8px 15px;
  background: rgba(0, 123, 255, 0.1);
  border-radius: 20px;
  transition: all 0.3s;
  touch-action: manipulation;
}

a.konum-link:active {
  background: rgba(0, 123, 255, 0.2);
  transform: scale(0.95);
}

.fa-map-marker-alt {
  margin-left: 5px;
}

.son {
  height: 20px;
}

/* Yakındakiler sayfası için özel .son yüksekliği */
.yakindakiler-page .son {
  height: 40px;
}

@media (max-width: 480px) {
  .kurum {
    padding: 15px 10px;
    margin-bottom: 12px;
    width: 100%;
    box-sizing: border-box;
  }

  .kurum .image {
    max-width: 70%;
    width: 100%;
    margin: 12px auto;
  }

  a.konum-link {
    font-size: 14px;
    padding: 10px 18px;
    margin-top: 12px;
    word-break: break-word;
    text-align: center;
  }
}

/* Yakındakiler sayfası için özel menü */
.yakindakiler .menu-item {
  background-color: #9aeba3;
}

.yakindakiler .menu-item:active {
  background-color: #7dd87d;
}

/* Yakındakiler sayfası için özel stiller */
.h2 {
  color: #2d4653;
  padding: 12px 15px;
  margin: 15px 20px;
  border: none;
  border-radius: 8px;
  background-color: #de9f26;
  font-size: 16px;
  font-weight: 500;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Yakındakiler sayfasında .son için özel yükseklik - h2'den önceki .son */
.son:has(+ .h2) {
  height: 40px;
}

.son2 {
  height: 100px;
}

@media (max-width: 480px) {
  .h2 {
    margin: 12px 15px;
    padding: 10px 12px;
    font-size: 15px;
  }

  .son2 {
    height: 80px;
  }
}

/* Linkler için mobil optimizasyonu */
a {
  -webkit-tap-highlight-color: rgba(0, 123, 255, 0.2);
  touch-action: manipulation;
}

/* Text selection için */
p,
span,
h1,
h2,
h3,
h4 {
  -webkit-user-select: text;
  user-select: text;
}

/* Safe area için (iPhone X ve üzeri) */
@supports (padding: max(0px)) {
  .container {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
  }

  header {
    padding-top: max(15px, env(safe-area-inset-top));
    padding-left: max(70px, calc(70px + env(safe-area-inset-left)));
  }

  .index-page header {
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
  }

  footer {
    padding-bottom: max(15px, env(safe-area-inset-bottom));
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
  }

  .back-btn {
    left: max(15px, calc(15px + env(safe-area-inset-left)));
  }
}

/* Mobil için ek scroll optimizasyonları */
@media (max-width: 768px) {
  .container {
    overscroll-behavior-y: contain;
    overscroll-behavior-x: none;
    -webkit-overflow-scrolling: touch;
  }

  body {
    overscroll-behavior-y: none;
    overscroll-behavior-x: none;
  }

  /* Tüm içerik elementlerinin taşmasını engelle */
  .container > * {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Image container için ek kontrol */
  #imageContainer {
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    text-align: center !important;
  }

  #imageContainer img,
  #imageContainer .image {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    margin-left: auto !important;
    margin-right: auto !important;
    display: block !important;
  }

  /* Info container için de merkezleme */
  #imageContainer .info-container {
    width: calc(100% - 30px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}
