/* ==========================================================================
   CSS: APP SHELL / TOP CONTROLS / MAIN TABS
   ========================================================================== */

.wrap {
  width: 100%;
  height: calc(100vh - 20px);
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  overflow: hidden;
}

.card {
  background: rgba(53, 53, 60, 0.55);
  border: 1px solid rgba(53, 53, 60, 0.55);
  border-radius: 8px;
  padding: 12px;
  background-image: var(--grain-bg);
  background-size: 20px 20px;
  background-blend-mode: overlay;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
}

.controls-card {
  position: relative;
  z-index: 20;
  padding: 0;
  margin-bottom: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  overflow: visible;
}

.controls-card::before {
  display: none;
}

.controls-card > * {
  position: relative;
}

.controls-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.controls-row + .controls-row {
  margin-top: 10px;
}

.controls-row-top {
  z-index: 3;
  --top-bar-height: var(--top-logo-height, 54px);
  --top-tabs-bridge: 16px;
  align-items: flex-start;
  gap: 12px;
  min-height: calc(var(--top-bar-height) + var(--top-tabs-bridge));
}
.controls-card .top-slot {
  position: relative;
  flex: 0 1 var(--top-search-width, 320px);
  width: var(--top-search-width, 320px);
  max-width: var(--top-search-width, 320px);
  min-width: 0;
  min-height: var(--top-bar-height, 54px);
  align-self: flex-start;
}

.controls-card .top-card {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background-image: none;
}

.controls-row-top .logo-wrapper {
  flex: 0 0 auto;
  margin-bottom: 0;
  align-self: flex-start;
}

    .controls-row-top .top-slot {
  margin-left: auto;
}

#search-card .search-row {
  justify-content: flex-end;
}

#search-card .search-autocomplete {
  flex: 0 0 100%;
  width: 100%;
}
    
.top-tabs-slot {
  --tabs-strip-bg: rgba(132, 170, 251, 0.2);
  --tabs-strip-separator: rgba(255, 255, 255, 0.22);
  --tabs-hover-bg: rgba(53, 53, 60, 0.55);
  --tabs-pane-bg: rgb(47 46 50);
  --pseudo-hover: rgba(53, 53, 60, 1);
  flex: 0 1 auto;
  min-width: 0;
  height: calc(var(--top-bar-height) + var(--top-tabs-bridge));
  display: flex;
  align-items: flex-start;
  align-self: flex-start;
  margin-bottom: 0;
  position: relative;
  z-index: 4;
  overflow: visible;
}

.tabs-bar-top {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0;
  padding: 0;
  height: 100%;
  min-height: 0;
  border-radius: 0;
  overflow-x: auto;
  overflow-y: visible;
}

.tabs-bar-top .tabs-btn {
  height: 100%;
}


.tabs-bar-top .tabs-btn-label {
  transform: none;
  display: flex;
  align-items: center;
  height: var(--top-bar-height, 54px);
}
    
.tabs-bar-top::-webkit-scrollbar {
  display: none;
}

#progress-card {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.35s, visibility 0.35s;
}

#progress-card.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.controls-card #progress-card {
  display: flex;
  align-items: center;
}

#search-card {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s, visibility 0.35s;
}

#search-card.ready {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.controls-card #search-card .search-row {
  height: var(--top-bar-height, 54px);
}

.controls-row-top .search-input {
  height: var(--top-bar-height, 54px);
}

.progress-wrap {
  width: 100%;
  height: 28px;
  background: rgba(132, 170, 251, 0.18);
  border: 1px solid rgba(132, 170, 251, 0.35);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
}

.progress-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.10) 20%,
    rgba(255,255,255,0.22) 50%,
    rgba(255,255,255,0.10) 80%,
    transparent 100%
  );
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
}

#progress-card.loading .progress-wrap::after {
  opacity: 1;
  animation: progressShimmer 1.2s linear infinite;
}

.progress-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 0 12px 1px 12px;
  color: #f3f3f3;
  font-size: 14px;
  font-weight: 700;
  line-height: 14px;
  text-shadow: 0 1px 1px rgba(0,0,0,0.35);
  white-space: nowrap;
  pointer-events: none;
}

@keyframes progressShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.search-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  width: 100%;
}

.grow {
  flex: 1;
  min-width: 0;
}

.search-autocomplete {
  position: relative;
  flex: 1;
  min-width: 0;
}

.search-input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(132, 170, 251, 0.5);
  border-radius: 8px;
  background: #282626;
  color: var(--text);
  font-family: var(--app-font-family);
  font-size: 15px;
  outline: none;
  transition: border-color 0.3s ease;
}

.search-input:hover {
  border-color: rgba(132, 170, 251, 1);
}

.search-input.highlight {
  border-color: #c0392b;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  font-family: var(--app-font-family) !important;
  -webkit-text-fill-color: #f3f3f3 !important;
  box-shadow: 0 0 0px 1000px #282626 inset !important;
  border: 1px solid #84aafb !important;
}

.button {
  height: 42px;
  padding: 0 14px;
  background-color: rgba(132, 170, 251, 0.2);
  color: #f3f3f3;
  border: 1px solid rgba(132, 170, 251, 0);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.3s ease;
  font-family: var(--app-font-family);
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}

.button:hover {
  border-color: rgba(132, 170, 251, 1);
  text-decoration: none;
}

.button.secondary {
  background-color: transparent;
  border: 1px solid rgba(132, 170, 251, 0.5);
}

.button:disabled {
  opacity: 0.45;
  cursor: default;
}
