/* tree-sheet.css */

.tree-bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-bottom-sheet, 1100);
  background: var(--store-sheet-bg);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
  transform: translateY(100%);
  transition: var(--store-sheet-transition);
  height: var(--store-sheet-max-expanded, 75vh);
  max-height: var(--store-sheet-max-expanded, 75vh);
  touch-action: pan-y;
  will-change: transform;
}

.tree-bottom-sheet.visible {
  transform: translateY(0);
}

/* Drag handle */
.tree-sheet-handle {
  display: flex;
  justify-content: center;
  padding: 12px 0 8px;
  cursor: grab;
  touch-action: pan-y;
}
.tree-sheet-handle:active {
  cursor: grabbing;
}
.handle-bar {
  width: 45px;
  height: 5px;
  background: var(--store-sheet-handle);
  border-radius: 4px;
  opacity: 0.8;
}

/* Content area */
.tree-sheet-body {
  padding: 0 20px calc(20px + var(--safe-b, 0px));
  overflow-y: auto;
  max-height: calc(var(--store-sheet-max-expanded, 75vh) - 40px);
  direction: rtl;
}

.tree-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
}
.tree-logo {
  width: 50px;
  height: 50px;
  background: #e8f5e9;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: bold;
  color: var(--c-accent);
  flex-shrink: 0;
}
.tree-name {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0;
  color: var(--c-text);
}

/* Notes (NOTE: tree-sheet.js currently renders this element with class "tree-description";
   change it to "tree-notes" there so these styles apply) */
.tree-notes {
  color: #4b5563;
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 12px 0;
}

/* Action buttons */
.tree-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 20px 0 15px;
}
.action-btn {
  background: #f3f4f6;
  border: none;
  border-radius: 40px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}
.action-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}
.action-btn.share {
  background: var(--c-accent, #3498db);
  color: white;
  width: auto;
  margin-top: 0;
}
.action-btn:active { transform: scale(0.96); }

/* Responsive small screens */
@media (max-width: 480px) {
  .tree-actions { gap: 8px; }
  .action-btn { padding: 6px 10px; font-size: 0.75rem; }
  .tree-name { font-size: 1.1rem; }
}

/* عداد المشاهدات */
.tree-view-counter {
  background: #f0f2f5;
  border-radius: 30px;
  padding: 6px 12px;
  font-size: 0.8rem;
  color: #2c3e50;
  display: inline-block;
  margin: 5px 0 10px;
  direction: ltr;
  text-align: center;
  width: fit-content;
}