/* app-frame.css - Main application frame layout
 * BroJack SOLIUS App Redesign - October 2025
 * Design specs from Figma (design-app-frame-1.md)
 */

/* ===== MAIN FRAME CONTAINER ===== */
.app-frame {
  display: flex;
  flex-direction: row;
  width: 100vw;
  height: 100vh;
  background: #00091E;
  margin: 0;
  padding: 0;
  position: fixed;
  top: 0;
  left: 0;
  overflow: hidden;
  font-family: 'Montserrat', sans-serif;
}

/* ===== LEFT SIDEBAR ===== */
.app-sidebar {
  position: relative;
  width: 220px;
  height: 100%;
  padding: 16px 40px 16px 10px;
  background: #00091E;
  transition: width 0.3s ease-in-out, padding 0.3s ease-in-out;
  overflow-x: hidden;
  overflow-y: auto;
}

.app-sidebar.collapsed {
  width: 50px;
  border-right: 1px solid rgba(83, 98, 133, 0.2);
  padding-left: 10px;
}

.sidebar-container {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 140px;
  height: 100%;
  min-height: 100%;
}

/* Logo */
.sidebar-logo {
  width: 64px;
  height: 64px;
  margin-bottom: 24px;
  cursor: pointer; /* 🏠 Clickable cursor */
  transition: all 0.3s ease-in-out;
}

.sidebar-logo:hover {
  transform: scale(1.05); /* Subtle scale on hover */
  opacity: 0.9;
}

.sidebar-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: all 0.3s ease-in-out;
}

/* Collapsed logo - smaller and repositioned for perfect centering */
.app-sidebar.collapsed .sidebar-logo img {
  width: 30px;
  margin-top: -9px;
  margin-left: 0px;
}

/* Navigation */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 12px 10px;
  gap: 8px;
  width: 140px;
  height: 48px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Montserrat', sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
  color: #536285;
}

.nav-item .nav-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* Nav icon wrapper for badge positioning */
.nav-icon-wrapper {
  position: relative;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.nav-icon-wrapper .nav-icon {
  width: 24px;
  height: 24px;
}

/* Unread message badge */
.nav-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #EF4444;
  border-radius: 100px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 11px;
  line-height: 1;
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
  z-index: 10;
}

/* Badge animation when updating */
@keyframes badge-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
}

.nav-badge.updated {
  animation: badge-pulse 0.3s ease-in-out;
}

/* Hide menu icon is smaller */
[data-action="toggle-sidebar"] .nav-icon {
  width: 16px;
  height: 16px;
}

/* Hide menu span - margin pushes it out so it disappears on collapse */
[data-action="toggle-sidebar"] span {
  margin-left: 10px;
}

.nav-item:hover {
  background: rgba(113, 120, 254, 0.1);
}

.nav-item.active {
  background: rgba(113, 120, 254, 0.15);
  color: #7178FE;
}

/* Active state - Make icons blue */
.nav-item.active .nav-icon {
  /* CSS filter to convert grey (#536285) to blue (#7178FE) */
  filter: brightness(0) saturate(100%) invert(47%) sepia(96%) saturate(2638%) hue-rotate(220deg) brightness(102%) contrast(99%);
}

/* Inactive state - Keep grey for stroke-based icons */
.nav-item:not(.active) .nav-icon {
  /* Keep original colors from SVG */
  opacity: 0.8;
}

.nav-item:hover .nav-icon {
  opacity: 1;
}

/* Sidebar bottom */
.sidebar-bottom {
  margin-top: auto;
}

/* ===== RIGHT CONTENT AREA ===== */
.app-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* ===== TOP HEADER ===== */
/* Agent #3 - Removed border-bottom for cleaner look */
.app-header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 16px 40px 16px 16px;
  gap: 64px;
  width: 100%;
  height: 80px;
  flex-shrink: 0;
  /* border-bottom removed */
}

.header-title {
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 32px;
  line-height: 36px;
  color: #FFFFFF;
}

/* Header actions - Figma specs Frame 881234823 */
.header-actions {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  align-items: center;
  padding: 0px;
  gap: 64px;
  width: 361px;
  height: 48px;
  flex: none;
  order: 1;
  flex-grow: 0;
}

/* SOL Balance Display - Figma specs Frame 1000006162 */
.sol-balance-display {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0px;
  gap: 8px;
  width: 142px;
  height: 24px;
  flex: none;
  order: 0;
  flex-grow: 0;
}

.sol-icon {
  width: 24px;
  height: 19px;
  flex: none;
  order: 0;
  flex-grow: 0;
}

.sol-amount {
  width: 110px;
  height: 24px;
  font-family: 'Montserrat', sans-serif;
  font-style: normal;
  font-weight: 500;
  font-size: 16px;
  line-height: 24px;
  color: #536285;
  flex: none;
  order: 1;
  flex-grow: 0;
  white-space: nowrap;
}

/* Bell Icon Button - Figma specs */
.bell-icon-btn {
  position: relative; /* For badge positioning - Agent #1 (Oct 22, 2025) */
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  order: 1;
  flex-grow: 0;
  transition: all 0.2s ease;
  border-radius: 4px;
}

.bell-icon-btn:hover {
  background: #111a40;
  transform: scale(1.05);
}

.bell-icon {
  width: 24px;
  height: 24px;
}

/* Bug Report Icon Button (BroJack Agent #12 - Oct 28, 2025) */
.bug-report-icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 20px;
  flex: none;
  order: 2;
  flex-grow: 0;
}

.bug-report-icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

.bug-report-icon-btn:active {
  transform: scale(0.95);
}

.header-wallet-container {
  display: flex;
  align-items: center;
}

/* Profile avatar button in header */
.header-profile-avatar {
  display: flex;
  align-items: center;
  cursor: pointer;
  order: 2;
}

.profile-avatar-button {
  position: relative;
}

.profile-avatar-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7178FE 0%, #555DFF 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.profile-avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.profile-avatar-circle:hover {
  border-color: #7178FE;
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(113, 120, 254, 0.4);
}

.profile-avatar-circle i {
  font-size: 24px;
  color: #FFFFFF;
}

.profile-avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== CONTENT AREA ===== */
.app-content-area {
  width: 100%;
  height: calc(100% - 80px);
  flex: 1;
  padding: 24px 40px;
  overflow-y: auto;
  overflow-x: hidden;
  transition: opacity 0.3s ease-in-out;
}

/* Remove padding for chat state - needs full width/height */
/* Agent #3 - Small right padding for breathing room + flex for full stretch */
.app-content-area[data-state="chat"],
.app-content-area:has(.chat-three-panel) {
  padding: 0 16px 0 0; /* Small right padding for breathing room */
  overflow: hidden;
  display: flex; /* Enable flex for full stretch */
  flex-direction: column; /* Stack children vertically */
}

/* Agent #3 - Ensure #chat-container stretches full height (PROPER FLEX WAY) */
#chat-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  flex: 1; /* Take all available space - THIS is the real hero! */
  min-height: 0; /* Allow flex shrinking */
  margin-bottom: 20px; /* Bottom spacing - the flex-native way! */
}

/* Inner content gets rounded container styling applied by specific components */

/* Smooth transitions */
.app-content-area.fade-out {
  opacity: 0;
}

.app-content-area.fade-in {
  opacity: 1;
}

/* Custom scrollbar */
.app-content-area::-webkit-scrollbar {
  width: 8px;
}

.app-content-area::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.app-content-area::-webkit-scrollbar-thumb {
  background: rgba(113, 120, 254, 0.3);
  border-radius: 4px;
}

.app-content-area::-webkit-scrollbar-thumb:hover {
  background: rgba(113, 120, 254, 0.5);
}

/* ===== RESPONSIVE (Future) ===== */
@media (max-width: 1440px) {
  /* App is already full-screen, no overrides needed */
}

@media (max-width: 768px) {
  .app-sidebar {
    width: 80px;
    padding: 16px 20px;
  }
  
  .sidebar-container {
    width: 40px;
  }
  
  .nav-item span {
    display: none;
  }
  
  .app-content {
    width: calc(100vw - 80px);
  }
}

/* ===== ERROR MESSAGES ===== */
.error-message {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 400px;
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  color: #536285;
}

