/* Custom Mobile Tree Menu */
.mobile-tree-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 9999;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(2px);
}

.mobile-tree-overlay.show {
  display: block;
  opacity: 1;
}

.mobile-tree-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 85%;
  max-width: 320px;
  height: 100vh;
  background: #f8f9fa;
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
  z-index: 10000;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 0 20px 20px 0;
}

.mobile-tree-panel.show {
  transform: translateX(0);
}

.mobile-tree-header {
  background: transparent;
  color: #333;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10001;
}

.mobile-tree-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.mobile-tree-close {
  background: rgba(0, 0, 0, 0.1);
  border: none;
  color: #333;
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.mobile-tree-close:hover {
  background: rgba(0, 0, 0, 0.2);
  transform: scale(1.05);
}

.mobile-tree-content {
  padding: 0;
}

.mobile-tree-item {
  position: relative;
}

.mobile-tree-item-wrapper {
  display: flex;
  align-items: center;
  margin: 4px 12px;
}

.mobile-tree-item-inner {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: #000;
  border-radius: 8px;
  flex: 1;
}

.mobile-tree-item-inner:hover {
  background: #2b38e9;
  color: #ffffff !important;
  text-decoration: none;
}

.mobile-tree-item-inner.active {
  background: #2b38e9 !important;
  color: #ffffff !important;
  font-weight: 500;
}

.mobile-tree-icon {
  width: 24px;
  height: 24px;
  margin-right: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #000;
}

.mobile-tree-item-inner:hover .mobile-tree-icon {
  color: #ffffff;
}

.mobile-tree-item-inner.active .mobile-tree-icon {
  color: #ffffff !important;
}

.mobile-tree-text {
  flex: 1;
  font-size: 15px;
  line-height: 1.4;
}

.mobile-tree-item-inner.active .mobile-tree-text {
  color: #ffffff !important;
}

.mobile-tree-add-btn {
  background: #2b38e9;
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 8px;
  font-size: 14px;
}

.mobile-tree-add-btn:hover {
  background: #1e2bb8;
  transform: scale(1.1);
}

.mobile-tree-text a:hover,
.mobile-tree-text a:active {
  text-decoration: none;
}

/* Arrow styles removed - using tap to expand */

.mobile-tree-children {
  background: transparent;
  display: none;
  margin-left: 20px;
}

.mobile-tree-item.expanded .mobile-tree-children {
  display: block;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mobile-tree-children .mobile-tree-item-inner {
  padding: 10px 16px;
  margin: 2px 12px;
  font-size: 14px;
  color: #000;
}

.mobile-tree-children .mobile-tree-children .mobile-tree-item-inner {
  padding: 10px 20px;
}

.mobile-tree-children
  .mobile-tree-children
  .mobile-tree-children
  .mobile-tree-item-inner {
  padding-left: 116px;
}

/* Job status indicators */
.mobile-tree-job-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-left: 8px;
  flex-shrink: 0;
}

.mobile-tree-job-status.status-quotation {
  background: #fbbf24;
}

.mobile-tree-job-status.status-approved {
  background: #ea580c;
}

.mobile-tree-job-status.status-scheduled {
  background: #3b82f6;
}

.mobile-tree-job-status.status-completed {
  background: #8b5cf6;
}

.mobile-tree-job-status.status-paid {
  background: #10b981;
}

/* Add new buttons */
.mobile-tree-add-button {
  background: #2c3748;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  margin-left: 8px;
  transition: background-color 0.2s ease;
}

.mobile-tree-add-button:hover {
  background: #1e2bb8;
}

/* Empty state */
.mobile-tree-empty {
  padding: 40px 20px;
  text-align: center;
  color: #666;
}

.mobile-tree-empty i {
  font-size: 48px;
  color: #ddd;
  margin-bottom: 16px;
  display: block;
}

.mobile-tree-empty p {
  margin: 0;
  font-size: 14px;
}

/* Loading state */
.mobile-tree-loading {
  padding: 20px;
  text-align: center;
  color: #666;
}

.mobile-tree-loading i {
  font-size: 24px;
  color: #2b38e9;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Responsive adjustments for slide-out effect */
@media (max-width: 480px) {
  .mobile-tree-panel {
    width: 90%;
    max-width: none;
  }
}

@media (min-width: 768px) {
  .mobile-tree-panel {
    width: 70%;
    max-width: 350px;
  }
}

/* Hide on desktop */
@media (min-width: 992px) {
  .mobile-tree-overlay,
  .mobile-tree-panel {
    display: none !important;
  }
}
