﻿/* TreeView için ayrı CSS - style.css ile çakışma önlenir */
.tree-item {
    margin: 5px 0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.tree-header {
    display: flex;
    align-items: center;
    gap: 5px;
}

.tree-toggle {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.3s ease;
    font-size: 0.7rem;
    color: #b5a599;
}

.tree-toggle:hover {
    background-color: #fdf6f0;
    color: #7C381D;
}

.tree-toggle.expanded {
    transform: rotate(90deg);
    color: #9a4623;
}

.tree-spacer {
    width: 16px;
    height: 16px;
}

.tree-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    text-decoration: none;
    color: #2d2520;
    border-radius: 8px;
    transition: all 0.3s ease;
    flex: 1;
    font-size: 0.9rem;
}

.tree-link i {
    color:#f39c12;
}

.tree-item:hover .tree-link {
    background-color: #fdf6f0;
}

/* Active state - sadece renk değişimi */
.tree-item.tree-active .tree-link {
    color: #7C381D;
    font-weight: 600;
}

.tree-icon {
    font-size: 1.2rem;
    width: 18px;
    text-align: center;
}

.tree-item.tree-active .tree-icon {
    color: #9a4623;
}

.tree-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.tree-count {
    font-size: 0.7rem;
    background-color: rgba(124, 56, 29, 0.1);
    padding: 2px 6px;
    border-radius: 10px;
    color: #7C381D;
	margin-left: auto;
}

.tree-item.tree-active .tree-count {
    background-color: rgba(154, 70, 35, 0.2);
    color: #9a4623;
    font-weight: 600;
}

.tree-subs {
    display: none;
    margin-top: 5px;
    margin-left: 10px;
    border-left: 1px dashed #e8d5c4;
    padding-left: 10px;
}

.tree-subs.show {
    display: block;
    animation: treeSlideDown 0.2s ease;
}

@keyframes treeSlideDown {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 300px; }
}


/* —— EK: Seviye bazlı isim genişliği —— */
/* Ellipsis'in doğru çalışması için: */
.tree-header { min-width: 0; }
.tree-link   { min-width: 0; }

/* Varsayılan: level 0 */
.tree-item[data-level="0"] { --name-max: 150px; }
/* Alt seviye 1 */
.tree-item[data-level="1"] { --name-max: 120px; }
/* Alt seviye 2 */
.tree-item[data-level="2"] { --name-max: 100px; }

/* .tree-name için sabit 150px'i kaldır ve değişkeni kullan */
.tree-item > .tree-header .tree-name {
  max-width: var(--name-max, 150px);
}

/* 320px–768px arası (ikisi de dahil) */
@media (min-width: 375px) and (max-width: 768px) {
  /* data-level hangi değerde olursa olsun */
  .tree-item[data-level] { 
    --name-max: none;   /* var(--name-max) => none olur */
  }
  .tree-name {white-space: normal;}
}