* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: 'Segoe UI', sans-serif;
  overflow: hidden;
  background-color: #f1f2f6;
}

body {
  display: flex;
  flex-direction: column;
}

/* TOPBAR */
.topbar {
  height: 50px;
  background-color: #000000;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 10px;
  font-weight: 500;
  font-size: 16px;
}

.topbar span {
  cursor: pointer;
  transition: color 0.3s;
}

.topbar span:hover {
  color: #70a1ff;
}

/* MAIN AREA */
.main {
  display: flex;
  flex: 1;
  height: calc(100% - 50px);
  position: relative;
}

/* CANVAS WRAPPER */
#canvas-wrapper {
  flex: 1;
  overflow: hidden;
  position: relative;
  background-color: #000000;
  touch-action: none;

  /* Modern gradient ve hafif desen */
  background-image:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.05) 1px, transparent 2px),
    linear-gradient(135deg, #0f2027, #203a43, #2c5364);
  background-repeat: repeat, no-repeat;
  background-size: 40px 40px, cover;

  /* Canvas'ı ortalamak için flex */
  display: flex;
  justify-content: center; /* yatay ortala */
  align-items: center;     /* dikey ortala */
}

#canvas-container {
  position: relative; /* resmin absolute konumu için */
  width: 700px;
  height: 700px;
  display: grid;
  grid-template-columns: repeat(100, 7px);
  grid-template-rows: repeat(100, 7px);
  background-color: rgb(255, 255, 255);
  transform-origin: 0 0;
}

.block {
  width: 7px;
  height: 7px;
  border: 0.2px solid #ccc;
  background-color: white;
}

.block.selected {
  background-color: #0066ff;
}

/* SIDEBAR */
#sidebar {
  width: 350px;
  background-color: #ffffff;
  border-left: 1px solid #ccc;
  padding: 20px;
  position: absolute;
  top: 0;
  right: -400px;
  height: 100%;
  transition: right 0.4s ease;
  box-shadow: -3px 0 10px rgba(0, 0, 0, 0.1);
  z-index: 10;
  overflow-y: auto;
}

#sidebar.active {
  right: 0;
}

#close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 24px;
  cursor: pointer;
  color: #888;
}

#close-btn:hover {
  color: #000;
}

#sidebar h3 {
  margin-top: 40px;
  font-size: 20px;
  color: #2f3542;
}

input,
textarea,
select,
button {
  margin-top: 10px;
  padding: 10px;
  width: 100%;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

button {
  background-color: #2e86de;
  color: white;
  cursor: pointer;
  transition: background 0.3s;
}

button:hover {
  background-color: #1e5cb3;
}

.info-line {
  font-size: 14px;
  margin-top: 10px;
  color: #2f3542;
}

/* RESPONSIVE MEDIA QUERIES */
@media (max-width: 1024px) {
  #sidebar {
    width: 300px;
  }

  #canvas-container {
    width: 600px;
    height: 600px;
    grid-template-columns: repeat(100, 6px);
    grid-template-rows: repeat(100, 6px);
  }

  .block {
    width: 6px;
    height: 6px;
  }
}

@media (max-width: 768px) {
  .topbar {
    font-size: 14px;
    justify-content: space-between;
  }

  #canvas-container {
    width: 500px;
    height: 500px;
    grid-template-columns: repeat(100, 5px);
    grid-template-rows: repeat(100, 5px);
  }

  .block {
    width: 5px;
    height: 5px;
  }

  /* BURAYA EKLEDİM: Mobilde sidebar tamamen gizlensin */
  #sidebar {
    display: none !important;
  }

  /* Orijinal mobil sidebar stilleri kaldırıldı veya üzerine yazıldı */

  /* Bu kısım isteğe bağlı, çünkü display:none zaten gizler
  #sidebar {
    width: 100%;
    height: 50%;
    bottom: 0;
    top: auto;
    right: 0;
    border-left: none;
    border-top: 1px solid #ccc;
    box-shadow: 0 -3px 10px rgba(0, 0, 0, 0.1);
    transition: bottom 0.4s ease;
  }

  #sidebar.active {
    bottom: 0;
  }

  #close-btn {
    top: 10px;
    right: 15px;
  }

  #sidebar h3 {
    margin-top: 20px;
    font-size: 18px;
  }
  */
}

@media (max-width: 480px) {
  #canvas-container {
    position: relative; /* resmin absolute konumu için */
    width: 350px;
    height: 350px;
    grid-template-columns: repeat(100, 3.5px);
    grid-template-rows: repeat(100, 3.5px);
  }

  .block {
    width: 3.5px;
    height: 3.5px;
  }

  input,
  textarea,
  select,
  button {
    font-size: 13px;
  }

  .info-line {
    font-size: 12px;
  }

  .topbar {
    font-size: 12px;
    padding: 0 5px;
  }
}

.block.reserved {
  background-color: #aaa !important;
  pointer-events: none;
}

/* Özel Uyarı Kutusu */
#custom-alert {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.3s ease;
}

#custom-alert.hidden {
  display: none;
}

.alert-box {
  background-color: #fff;
  padding: 25px 35px;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  text-align: center;
  animation: scaleIn 0.3s ease;
  max-width: 320px;
  line-height: 1.5;
}

.alert-box p {
  margin-bottom: 20px;
  font-size: 16px;
  color: #2f3542;
  white-space: pre-line; /* Satır sonlarını destekler */
  font-weight: 700;
}

.alert-box button {
  padding: 10px 22px;
  background-color: #2e86de;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  transition: background 0.3s;
  min-width: 100px;
}

.alert-box button:hover {
  background-color: #1e5cb3;
}

/* NAVBAR TASARIMI */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #111;
  padding: 15px 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
  z-index: 1000;
}

.navbar .logo {
  font-size: 1.6rem;
  font-weight: bold;
  color: #00d4ff;
  text-decoration: none;
  transition: 0.3s;
}

.navbar .logo:hover {
  opacity: 0.8;
}

.navbar .menu {
  display: flex;
  gap: 25px;
}

.navbar .menu a {
  text-decoration: none;
  color: #ddd;
  padding: 8px 16px;
  border-radius: 8px;
  transition: background 0.4s ease, color 0.3s ease;
}

.navbar .menu a:hover {
  background: linear-gradient(135deg, #00d4ff, #007bff);
  color: #fff;
}

@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}

@keyframes scaleIn {
  from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; }
}
