/* webapp/static/css/components.css */
.ui-icon { width: 18px; height: 18px; flex-shrink: 0; display: block; }
.ui-icon--lg { width: 28px; height: 28px; }
.ui-icon--xl { width: 40px; height: 40px; }

.nav-island {
  background: var(--bg-surface);
  padding: 10px 16px;
  position: sticky;
  top: 0;
  z-index: 60;
}

@media (min-width: 768px) {
  .nav-island {
    width: var(--sidebar-width);
    height: calc(100dvh - 2 * var(--shell-inset));
    top: var(--shell-inset);
    border-radius: var(--radius-surface);
    padding: var(--sidebar-padding);
    box-shadow: var(--shadow-island);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-shrink: 0;
  }
}

.island-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.brand-lockup { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand-title { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; }
.badge-region {
  font-size: 12px;
  background: var(--bg-field);
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: var(--radius-control);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.header-controls { display: flex; align-items: center; gap: 6px; }

.tab-nav { display: flex; gap: 4px; }
@media (min-width: 768px) {
  .island-top { flex-direction: column; align-items: stretch; gap: 10px; margin-bottom: 16px; }
  .brand-lockup { flex-direction: column; align-items: flex-start; gap: 4px; }
  .badge-region { max-width: 100%; }
  .tab-nav { flex-direction: column; gap: 4px; margin-bottom: auto; }
}

.nav-btn {
  flex: 1;
  height: var(--control-height);
  padding: 0 10px;
  border: none;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
@media (min-width: 768px) {
  .nav-btn { justify-content: flex-start; flex: none; }
}
.nav-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-btn.active { background: var(--bg-selected); color: var(--text-primary); font-weight: 600; }

.btn-primary, .btn-secondary, .btn-pro, .btn-icon, .joined-main, .joined-aux {
  border: none;
  box-shadow: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out);
}
.btn-primary {
  height: var(--control-height);
  padding: 0 16px;
  border-radius: var(--radius-control);
  background: var(--accent-primary);
  color: var(--text-inverse);
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary {
  height: var(--control-height);
  padding: 0 14px;
  border-radius: var(--radius-control);
  background: var(--bg-field);
  color: var(--text-primary);
}
.btn-secondary:hover:not(:disabled) { background: var(--bg-hover); }
.btn-icon {
  width: var(--control-compact);
  height: var(--control-compact);
  border-radius: var(--radius-control);
  background: var(--bg-field);
  color: var(--text-primary);
}
.btn-icon:hover:not(:disabled) { background: var(--bg-hover); }
.btn-pro {
  height: var(--control-compact);
  padding: 0 10px;
  border-radius: var(--radius-control);
  background: var(--bg-field);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
}
.btn-pro:hover { background: var(--bg-hover); }
.btn-primary:disabled, .btn-secondary:disabled { opacity: 0.55; cursor: not-allowed; }
.full-width { width: 100%; }

.joined-action { display: inline-flex; align-items: center; gap: var(--joined-gap); }
.joined-main {
  height: var(--control-compact);
  padding: 0 12px;
  background: var(--accent-primary);
  color: var(--text-inverse);
  border-start-start-radius: var(--radius-control);
  border-end-start-radius: var(--radius-control);
  border-start-end-radius: var(--radius-joined);
  border-end-end-radius: var(--radius-joined);
}
.joined-aux {
  width: var(--control-compact);
  height: var(--control-compact);
  background: var(--accent-primary);
  color: var(--text-inverse);
  border-start-start-radius: var(--radius-joined);
  border-end-start-radius: var(--radius-joined);
  border-start-end-radius: var(--radius-control);
  border-end-end-radius: var(--radius-control);
}
.joined-main:hover, .joined-aux:hover { background: var(--accent-hover); }

.segmented-control {
  display: flex;
  background: var(--bg-field);
  padding: 3px;
  border-radius: var(--radius-control);
  gap: 2px;
}
.segment-btn {
  flex: 1;
  height: 30px;
  padding: 0 8px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.segment-btn:hover { color: var(--text-primary); }
.segment-btn.active { background: var(--bg-surface); color: var(--text-primary); font-weight: 600; }

.spinner-container { display: flex; justify-content: center; align-items: center; }
.svg-spinner { width: 18px; height: 18px; animation: svg-rotate 1.4s linear infinite; color: currentColor; }
.svg-spinner--lg { width: 26px; height: 26px; }
.svg-spinner-circle {
  stroke: currentColor;
  stroke-linecap: round;
  stroke-dasharray: 44 60;
  stroke-dashoffset: 0;
  animation: svg-dash 1.4s ease-in-out infinite;
}
@keyframes svg-rotate { 100% { transform: rotate(360deg); } }
@keyframes svg-dash {
  0% { stroke-dasharray: 4 60; stroke-dashoffset: 0; }
  50% { stroke-dasharray: 42 60; stroke-dashoffset: -14px; }
  100% { stroke-dasharray: 4 60; stroke-dashoffset: -56px; }
}

.custom-tooltip {
  position: fixed;
  z-index: 2000;
  background: var(--text-primary);
  color: var(--text-inverse);
  font-size: 12px;
  line-height: 16px;
  padding: 5px 9px;
  border-radius: 7px;
  pointer-events: none;
  white-space: nowrap;
}
