/* Profil menü — sağ üst topbar profil+çıkışı karşılıyorsa navbar kopyası gizlenir */
#profile-menu-item {
  display: list-item !important;
  visibility: visible !important;
}

body.map-page #profile-menu-item,
#profile-menu-item.cm-nav-profile-legacy {
  display: none !important;
  visibility: hidden !important;
}

/* Toast Notification Animasyonu */
@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Profil Modal — above map chrome + above other modals / backdrop */
#profileModal {
  z-index: 11070 !important;
}

#profileModal.in,
#profileModal.show {
  z-index: 11070 !important;
  pointer-events: auto !important;
}

body.modal-open #profileModal.in ~ .modal-backdrop,
body.modal-open #profileModal.show ~ .modal-backdrop {
  z-index: 11060 !important;
}

/* When profile is open, keep the topmost backdrop under the dialog */
body.modal-open:has(#profileModal.in) .modal-backdrop:last-of-type,
body.modal-open:has(#profileModal.show) .modal-backdrop:last-of-type {
  z-index: 11060 !important;
}

#profileModal .modal-dialog {
  max-width: 900px;
  pointer-events: auto !important;
}

#profileModal .modal-content {
  border-radius: 15px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  pointer-events: auto !important;
  position: relative;
  z-index: 1;
}

#profileModal .modal-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-top-left-radius: 15px;
  border-top-right-radius: 15px;
  padding: 20px 30px;
}

#profileModal .modal-title {
  font-size: 24px;
  font-weight: 600;
}

#profileModal .nav-tabs {
  border-bottom: 0;
  margin-bottom: 20px;
}

#profileModal .nav-tabs > li > a {
  font-family: 'Cynetiq', sans-serif;
}

/* Profil Bilgileri Formu */
.profile-form-group {
  margin-bottom: 20px;
}

.profile-form-group label {
  font-weight: 600;
  color: var(--cm-text);
  margin-bottom: 8px;
  display: block;
  font-family: 'Cynetiq', sans-serif;
}

.profile-form-group input {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid var(--cm-border);
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s ease;
  background: var(--cm-surface);
  color: var(--cm-text);
  font-family: 'Cynetiq', sans-serif;
}

.profile-form-group input:focus {
  outline: none;
  border-color: var(--cm-primary);
  box-shadow: 0 0 0 3px rgba(0, 122, 51, 0.12);
}

.profile-form-group input:disabled {
  background-color: var(--cm-surface-2);
  cursor: not-allowed;
}

.profile-save-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  margin-top: 10px;
}

.profile-save-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Parsel Kartları */
.parcel-cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  padding: 10px 0;
}

.parcel-card {
  background: var(--cm-surface);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 12px var(--cm-shadow);
  transition: all 0.3s ease;
  border: 2px solid var(--cm-border);
  position: relative;
  color: var(--cm-text);
  font-family: 'Cynetiq', sans-serif;
}

.parcel-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px var(--cm-shadow);
  border-color: var(--cm-primary);
}

.parcel-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 2px solid #f0f0f0;
}

.parcel-card-title {
  font-size: 18px;
  font-weight: 700;
  color: #333;
  margin: 0;
}

.parcel-card-badge {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.parcel-card-info {
  margin-bottom: 15px;
}

.parcel-info-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #f5f5f5;
}

.parcel-info-item:last-child {
  border-bottom: none;
}

.parcel-info-label {
  font-weight: 600;
  color: #666;
  font-size: 13px;
}

.parcel-info-value {
  color: #333;
  font-size: 13px;
  text-align: right;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.parcel-card-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.parcel-action-btn {
  flex: 1;
  padding: 10px 15px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 13px;
}

.parcel-goto-btn {
  background-color: #4CAF50;
  color: white;
}

.parcel-goto-btn:hover {
  background-color: #45a049;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.parcel-remove-btn {
  background-color: #f44336;
  color: white;
}

.parcel-remove-btn:hover {
  background-color: #da190b;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

/* Feature modal header: title left, actions right */
#featureModal .cm-feature-header,
.cm-feature-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
}

#featureModal .cm-feature-header .modal-title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding-right: 8px;
  line-height: 1.25;
}

.cm-feature-header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
  margin-left: auto;
}

#featureModal .cm-feature-close.close {
  float: none;
  position: static;
  margin: 0;
  padding: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  opacity: 1;
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-shadow: none;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

#featureModal .cm-feature-close.close:hover,
#featureModal .cm-feature-close.close:focus {
  opacity: 1;
  background: rgba(255, 255, 255, 0.26);
  border-color: rgba(255, 255, 255, 0.45);
  transform: none;
}

/* Favori Buton (Parsel Detay Modalında) */
.favorite-parcel-btn {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.32);
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  box-shadow: none;
  white-space: nowrap;
}

.modal-header .favorite-parcel-btn {
  position: static;
  right: auto;
  top: auto;
  transform: none;
  margin: 0;
  padding: 9px 14px;
  font-size: 13px;
  line-height: 1.2;
  z-index: 1;
}

.favorite-parcel-btn:hover {
  background: rgba(255, 255, 255, 0.26);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  transform: translateY(-1px);
}

.modal-header .favorite-parcel-btn:hover {
  transform: translateY(-1px);
}

.favorite-parcel-btn.in-favorites {
  background: rgba(255, 255, 255, 0.92);
  color: #1b7a3a;
  border-color: rgba(255, 255, 255, 0.95);
}

.favorite-parcel-btn.in-favorites:hover {
  background: #fff;
  color: #146330;
}

.favorite-parcel-btn i {
  font-size: 14px;
}

@media (max-width: 520px) {
  #featureModal .cm-feature-header {
    align-items: flex-start;
    gap: 12px;
  }

  .cm-feature-header-actions {
    gap: 10px;
  }

  .modal-header .favorite-parcel-btn {
    padding: 8px 10px;
    font-size: 12px;
    max-width: 150px;
  }

  #featureModal .modal-header .favorite-parcel-btn {
    max-width: none;
  }

  .modal-header .favorite-parcel-btn #favorite-btn-text {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #featureModal .cm-feature-close.close {
    width: 36px;
    height: 36px;
    font-size: 22px;
  }
}

/* Boş durum mesajı */
.empty-parcels-message {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.empty-parcels-message i {
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.3;
}

.empty-parcels-message h4 {
  font-size: 20px;
  margin-bottom: 10px;
  color: #666;
}

.empty-parcels-message p {
  font-size: 14px;
}

/* Scroll handled by curved scrollbar (.scroll-content) */

/* Responsive */
@media (max-width: 768px) {
  .parcel-cards-container {
    grid-template-columns: 1fr;
  }
  
  #profileModal .modal-dialog {
    max-width: 520px;
    margin: auto;
  }
}
