/* Toolbar Styles */
.toolbar {
    /* DÜZENLEME: Sabit piksel yerine yüzdesel genişlik */
    width: 20%;
    min-width: 220px; /* Çok küçülmesini engelle */
    max-width: 300px; /* Çok büyümesini engelle */

    background: white;
    padding: 1rem;
    border-right: 1px solid #ddd;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.tool-section {
    margin-bottom: 1.5rem;
}

.tool-section h3 {
    margin-bottom: 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
    color: var(--dark-color);
    font-size: 1rem;
}

.tool-btn {
    display: block;
    width: 100%;
    padding: 0.7rem;
    margin-bottom: 0.5rem;
    background: var(--light-color);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.tool-btn:hover {
    background: var(--secondary-color);
    color: white;
}

.tool-btn.active {
    background: var(--secondary-color);
    color: white;
    font-weight: 500;
}

/* Properties Panel */
.properties-panel {
    /* DÜZENLEME: Sabit piksel yerine yüzdesel genişlik */
    width: 22%;
    min-width: 240px; /* Çok küçülmesini engelle */
    max-width: 320px; /* Çok büyümesini engelle */
    
    margin-bottom: 4px; /* Boşluğu ayarla */
    font-weight: 500; /* Biraz daha ince */
    color: #34495e; /* Koyu renk */
    font-size: 0.8rem; /* <<< Temel boyuta göre küçük */
    line-height: 1.4;
    background: white;
    padding: 1rem;
    border-left: 1px solid #ddd;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Checkbox etiketleri */
.properties-panel label[for*="toggle-"],
.properties-panel label[for="toggle-detail-selection"] /* Yeni ID için de */
{
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
    margin-bottom: 8px; /* Checkbox grupları arasına boşluk */
}

/* toolbar.css içine YENİ kural olarak ekleyin */
.properties-panel input[type="text"],
.properties-panel input[type="number"],
.properties-panel input[type="range"],
.properties-panel select,
.properties-panel textarea {
    width: 100%;
    padding: 6px 10px; /* İç boşluk */
    margin-bottom: 10px; /* Elemanlar arasına dikey boşluk */
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 0.9rem; /* <<< Temel boyuta yakın */
    background-color: #fff;
    color: #333;
}
.properties-panel input[type="checkbox"] {
    width: auto;
    margin-right: 6px;
    margin-bottom: 0; /* Checkbox için alt boşluk olmaz */
}
.properties-panel select {
    /* Select için tarayıcı stillerini biraz daha iyileştir */
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23333' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 1em;
    padding-right: 2rem; /* Ok için yer aç */
}
.property-section,
.action-section {
    margin-bottom: 1.5rem;
}

.property-section h3,
.action-section h3 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
    color: var(--dark-color);
    font-size: 1rem;
}

.property-group {
    margin-bottom: 1rem;
}

.property-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 500;
    color: var(--dark-color);
}

.property-group input, 
.property-group select {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 2.5rem;
}

.direction-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.dir-btn {
    flex: 1; /* Eşit genişlik */
    padding: 6px 8px; /* <<< Daha küçük padding */
    border: 1px solid #ccc;
    background: #f0f0f0;
    cursor: pointer;
    font-size: 0.85rem; /* <<< Daha küçük font */
    text-align: center;
}

.dir-btn:hover {
    background: #dfe6e9;
}

/* Action Buttons */
.action-btn {
    display: block;
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 0.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}
/* === Nesne Kütüphanesi: sürükleme sadece tutamaçtan === */
.ol-header{display:flex;align-items:center;gap:.5rem}
.ol-drag-handle{cursor:grab;user-select:none;-webkit-user-select:none}
.ol-panel.dragging .ol-drag-handle{cursor:grabbing}

.action-btn.primary { background: var(--secondary-color); color: white; }
.action-btn.secondary { background: var(--light-color); color: var(--dark-color); }
.action-btn.danger { background: var(--accent-color); color: white; }
.action-btn:hover { opacity: 0.9; }
.toolbar-btn { padding:6px 10px; border:1px solid #ccd; background:#f8fafc; border-radius:8px; cursor:pointer; }
.toolbar-btn:hover { background:#eef2f7; }

/* css/toolbar.css */
#btnObjectLibrary{
  position: fixed;
  right: 14px !important;
  left: auto !important;
  /* Use runtime header metric + safe area to avoid overlap in touch mode */
  top: calc(env(safe-area-inset-top, 0px) + var(--header-bottom, 56px) + 12px) !important;
  z-index: 9999;
}

/* Panelin tamamını kaydırılabilir yap */
#objectLibraryPanel{
  /* mevcut position/left/top/stilini bozma */
  max-height: 80vh;                 /* ekrana sığdır */
  overflow-y: auto;                 /* dikey scroll */
  -webkit-overflow-scrolling: touch;/* iOS'ta momentum scroll */
  overscroll-behavior: contain;     /* taşma/bounce taşmasını engelle */
}

/* İçeride uzun bir liste varsa sadece gövdeyi kaydırmak istersen: */
#objectLibraryPanel .panel-body,
#objectLibraryPanel .content,
#objectLibraryPanel .list {
  max-height: inherit;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
