/* Profile Page - Terminal Tree Menu Style */

/* ============================================
   PROFILE HEADER
   ============================================ */

.profile-header {
  background: var(--bg-secondary);
  border: 1px solid var(--border-accent);
  padding: 20px 25px;
  margin-bottom: 30px;
  font-family: var(--font-mono, monospace);
}

.profile-header-terminal {
  margin-bottom: 15px;
}

.terminal-line {
  opacity: 0;
  animation: terminal-type 0.3s ease forwards;
  animation-delay: calc(var(--delay) * 0.4s);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.terminal-prompt {
  color: var(--text-accent);
}

.terminal-text {
  color: var(--text-primary);
}

.terminal-cursor {
  animation: blink 1s step-end infinite;
  color: var(--text-accent);
}

.status-online {
  color: var(--text-accent);
  text-shadow: 0 0 6px currentColor;
}

@keyframes terminal-type {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Header Info */
.profile-header-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
}

.profile-header-user {
  color: var(--text-primary);
  font-size: 1.1rem;
}

.profile-header-user strong {
  color: var(--text-accent);
}

.profile-stat-badges {
  display: flex;
  gap: 15px;
  font-size: 0.85rem;
}

.profile-stat-badge {
  color: var(--text-secondary);
}

.profile-stat-badge .badge-value {
  color: var(--text-accent);
  font-weight: bold;
}

.profile-stat-badge.badge-success .badge-value {
  color: #00ff00;
}

.profile-stat-badge.badge-warning .badge-value {
  color: #ffaa33;
}

/* ============================================
   TREE MENU STRUCTURE
   ============================================ */

.profile-tree {
  font-family: var(--font-mono, monospace);
  font-size: 14px;
}

/* Category (top-level expandable) */
.tree-category {
  margin-bottom: 2px;
}

.tree-category-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  width: 100%;
  cursor: pointer;
  color: var(--text-primary);
  font-family: inherit;
  font-size: inherit;
  text-align: left;
  transition: background 0.15s ease;
}

.tree-category-header:hover {
  background: var(--bg-secondary);
}

.tree-branch {
  color: var(--text-secondary);
  width: 20px;
  flex-shrink: 0;
}

.tree-icon {
  color: var(--text-accent);
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}

.tree-label {
  flex: 1;
}

.tree-indicator {
  color: var(--text-secondary);
  font-size: 10px;
  transition: transform 0.2s ease;
}

.tree-category.expanded .tree-indicator {
  transform: rotate(90deg);
}

/* Category Content */
.tree-category-content {
  display: none;
  padding-left: 20px;
  border-left: 1px solid var(--border-color);
  margin-left: 22px;
}

.tree-category.expanded > .tree-category-content {
  display: block;
}

/* Sub-items */
.tree-item {
  margin-bottom: 2px;
}

.tree-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  width: 100%;
  cursor: pointer;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.tree-item-header:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.tree-item.expanded > .tree-item-header {
  color: var(--text-accent);
}

/* Item Content Panel */
.tree-item-content {
  display: none;
  padding: 15px 12px 15px 36px;
  background: var(--bg-secondary);
  border-left: 2px solid var(--border-accent);
  margin: 5px 0 10px 28px;
}

.tree-item.expanded > .tree-item-content {
  display: block;
  animation: panelFade 0.2s ease;
}

@keyframes panelFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Locked items (not expandable) */
.tree-item.locked > .tree-item-header {
  cursor: default;
}

.tree-item.locked > .tree-item-header:hover {
  background: transparent;
  color: var(--text-secondary);
}

/* Service status badge in tree item header */
.tree-item-header .tree-service-status {
  margin-left: auto;
  font-size: 11px;
  padding: 2px 8px;
  background: var(--bg-secondary);
}

/* Danger Zone Special */
.tree-category.danger .tree-category-header {
  color: #ff6666;
}

.tree-category.danger .tree-icon {
  color: #ff0000;
}

.tree-category.danger .tree-category-content {
  border-left-color: rgba(255, 0, 0, 0.3);
}

.tree-category.danger .tree-item-content {
  border-left-color: #ff0000;
  background: rgba(255, 0, 0, 0.05);
}

/* ============================================
   FORM ELEMENTS WITHIN TREE
   ============================================ */

.tree-item-content .section-description {
  color: var(--text-secondary);
  font-size: 13px;
  margin: 0 0 15px;
  line-height: 1.5;
}

.tree-item-content .profile-form {
  max-width: 400px;
}

.tree-item-content .profile-form-group {
  margin-bottom: 15px;
}

.tree-item-content .profile-form-label {
  font-size: 13px;
  margin-bottom: 6px;
}

.tree-item-content .profile-form-input {
  padding: 10px 12px;
  font-size: 14px;
}

.tree-item-content .profile-form-hint {
  font-size: 11px;
}

.tree-item-content .profile-btn {
  padding: 10px 20px;
  font-size: 13px;
  max-width: none;
  width: auto;
}

/* Status boxes */
.tree-item-content .profile-status-box {
  font-size: 13px;
  padding: 10px 15px;
}

/* Service cards in tree */
.tree-services-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tree-service-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 15px;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  transition: border-color 0.15s ease;
}

.tree-service-item:hover {
  border-color: var(--border-accent);
}

.tree-service-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tree-service-icon {
  color: var(--text-accent);
  font-size: 14px;
}

.tree-service-name {
  color: var(--text-primary);
  font-size: 14px;
}

.tree-service-status {
  font-size: 12px;
  padding: 3px 8px;
  background: var(--bg-secondary);
}

.tree-service-status.connected {
  color: #00ff00;
  border: 1px solid #00ff00;
}

.tree-service-status.pending {
  color: #ffaa33;
  border: 1px solid #ffaa33;
}

.tree-service-status.disconnected {
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

/* Achievements grid */
.tree-achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

/* Account info in tree */
.tree-account-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 13px;
}

.tree-account-row {
  display: flex;
  gap: 10px;
}

.tree-account-label {
  color: var(--text-secondary);
  min-width: 80px;
}

.tree-account-value {
  color: var(--text-primary);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 600px) {
  .profile-header {
    padding: 15px;
  }

  .profile-header-info {
    flex-direction: column;
    align-items: flex-start;
  }

  .tree-category-header {
    padding: 8px 10px;
  }

  .tree-item-content {
    padding: 12px 10px 12px 20px;
    margin-left: 20px;
  }

  .tree-achievements-grid {
    grid-template-columns: 1fr;
  }
}
