/* Hub Layout Styles */

/* Mobile Header */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);
  padding: 0 var(--space-4);
  align-items: center;
  justify-content: space-between;
  z-index: var(--z-sticky);
}

.mobile-title {
  font-size: var(--font-size-lg);
  margin: 0;
}

/* Hamburger Menu */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.hamburger span {
  width: 100%;
  height: 3px;
  background-color: var(--color-text-primary);
  border-radius: var(--radius-sm);
  transition: all var(--transition-base);
}

.hamburger:hover span {
  background-color: var(--color-accent-primary);
}

/* Main Container */
.hub-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--color-bg-secondary);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  padding: var(--space-6) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  transition: all var(--transition-base);
}

.sidebar-header:hover {
  background-color: var(--color-bg-tertiary);
}

.sidebar-title {
  font-size: var(--font-size-2xl);
  margin: 0 0 var(--space-2) 0;
  color: var(--color-text-primary);
}

.sidebar-subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
  margin: 0;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4);
}

/* Navigation Groups */
.nav-group {
  margin-bottom: var(--space-6);
}

.nav-group-header {
  padding: var(--space-2) var(--space-3);
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}

.nav-group-header.clickable {
  cursor: pointer;
}

.nav-group-header.clickable:hover {
  background-color: var(--color-bg-secondary);
  color: var(--color-accent-primary);
}

.nav-group-header.active {
  background-color: var(--color-accent-primary);
  color: var(--color-bg-primary);
}

/* Group-specific colors */
.nav-group[data-group-id="software-engineering"] .nav-group-header.active,
.nav-group[data-group-id="software-engineering"] .site-item.active {
  border-left-color: #3b82f6; /* Blue for software */
}

.nav-group[data-group-id="martial-arts-fitness"] .nav-group-header.active,
.nav-group[data-group-id="martial-arts-fitness"] .site-item.active {
  border-left-color: #ef4444; /* Red for martial arts */
}

.nav-group[data-group-id="making-anything"] .nav-group-header.active,
.nav-group[data-group-id="making-anything"] .site-item.active {
  border-left-color: #f59e0b; /* Orange for making */
}

/* Add left border to active items */
.nav-group-header.active,
.site-item.active {
  border-left: 4px solid var(--color-accent-primary);
  padding-left: calc(var(--space-3) - 4px);
}

.nav-group-sites {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

/* Site Items */
.site-item {
  display: block;
  padding: var(--space-3) var(--space-3);
  padding-left: var(--space-6);
  margin-bottom: var(--space-1);
  margin-left: var(--space-4);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.site-item:hover {
  background-color: var(--color-bg-tertiary);
  border-color: var(--color-border-light);
}

.site-item.active {
  background-color: var(--color-accent-primary);
  border-color: var(--color-accent-primary);
}

.site-item.active .site-label {
  color: var(--color-bg-primary);
  font-weight: var(--font-weight-semibold);
}

.site-item.active .site-description {
  color: var(--color-bg-primary);
  opacity: 0.9;
}

.site-label {
  display: block;
  font-size: var(--font-size-base);
  color: var(--color-text-primary);
  margin-bottom: var(--space-1);
}

.site-description {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--color-text-tertiary);
  line-height: var(--line-height-normal);
}

/* Content Area */
.content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Toolbar */
.toolbar {
  height: var(--toolbar-height);
  background-color: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);
  padding: 0 var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.toolbar-left {
  flex: 1;
  min-width: 0;
}

.current-site-title {
  font-size: var(--font-size-lg);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toolbar-right {
  display: flex;
  gap: var(--space-2);
}

/* Content Pane */
.content-pane {
  flex: 1;
  position: relative;
  overflow: hidden;
  background-color: var(--color-bg-primary);
}

/* Loading Spinner */
.loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  display: none;
}

.loading-spinner.active {
  display: block;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--color-bg-tertiary);
  border-top-color: var(--color-accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto var(--space-4);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Welcome Message */
.welcome-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  max-width: 500px;
  padding: var(--space-6);
}

.welcome-message h2 {
  color: var(--color-text-primary);
  margin-bottom: var(--space-4);
}

.welcome-message p {
  color: var(--color-text-secondary);
}

/* Iframe Container */
.iframe-container {
  width: 100%;
  height: 100%;
}

#content-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background-color: white;
}

/* Fallback Message */
.fallback-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 500px;
  width: 90%;
}

.fallback-message .card {
  text-align: center;
}

.fallback-message h3 {
  color: var(--color-text-primary);
  margin-bottom: var(--space-3);
}

.fallback-message p {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-6);
}

/* Sidebar Overlay (Mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: calc(var(--z-overlay) - 1);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* Mobile Styles */
@media (max-width: 768px) {
  .mobile-header {
    display: flex;
  }

  .hub-container {
    padding-top: var(--header-height);
  }

  .sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
    transition: transform var(--transition-base);
    z-index: var(--z-overlay);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .content-area {
    width: 100%;
  }
}

