/* assets/css/layout.css
 * Top GNOME bar, search bar section, responsive overview grid, workspace rail, and pagination.
 */

/* Top Panel */
.top-panel {
  position: relative;
  z-index: 40;
  width: 100%;
  height: 30px;
  padding: 0 12px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  background: var(--gnome-panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.top-panel-left {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: start;
}

.brand-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.92);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  user-select: none;
  cursor: default;
}

.brand-name:hover {
  background: rgba(255, 255, 255, 0.14);
}

.top-panel-right {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  justify-self: end;
}

.top-panel-user {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 180px;
  padding: 2px 10px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.92);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
}

.top-panel-user svg {
  flex-shrink: 0;
  opacity: 0.85;
}

.top-panel-user-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 639px) {
  .top-panel-user-name { display: none; }
  .top-panel-user { max-width: 36px; padding: 2px 6px; }
}

.brand-center {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.95);
  text-align: center;
  white-space: nowrap;
  cursor: default;
  user-select: none;
}

.panel-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 2px 11px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.16s ease;
}

.panel-pill:hover {
  background-color: rgba(255, 255, 255, 0.14);
}

.panel-pill.active {
  background-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.workspace-pill-dots {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ws-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
  transition: all 0.2s ease;
}

.ws-dot.active {
  width: 12px;
  background: #ffffff;
}

/* Main Workspace Container */
.overview-main {
  position: relative;
  z-index: 10;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px 12px 16px;
  overflow: hidden;
}

@media (min-width: 640px) {
  .overview-main {
    padding: 20px 40px 12px 40px;
  }
}

/* Search Section */
.search-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.search-pill {
  width: 260px;
  height: 36px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 999px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (min-width: 640px) {
  .search-pill {
    width: 290px;
  }
}

.search-pill:focus-within {
  width: 340px;
  max-width: 90vw;
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(53, 132, 228, 0.85);
  box-shadow: 0 0 0 2px rgba(53, 132, 228, 0.45), 0 8px 26px rgba(0, 0, 0, 0.28);
}

.search-input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: #ffffff;
  font-family: inherit;
  font-size: 13.5px;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.clear-search-btn {
  padding: 2px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.clear-search-btn:hover {
  color: #ffffff;
}

.drag-hint {
  margin-top: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(53, 132, 228, 0.25);
  border: 1px solid rgba(98, 160, 234, 0.4);
  color: #dbeafe;
  font-size: 12px;
  backdrop-filter: blur(12px);
}

/* Grid Viewport & Responsive App Grid */
.grid-viewport {
  width: 100%;
  max-width: 1024px;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px 0;
  overflow: hidden;
  touch-action: pan-x;
}

.app-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 8px;
  justify-items: center;
  align-items: start;
  transition: opacity 0.15s ease;
}

@media (min-width: 640px) {
  .app-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px 16px;
  }
}

@media (min-width: 768px) {
  .app-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .app-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.empty-state-title {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
}

.empty-state-sub {
  margin: 4px 0 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

/* Right-Edge Workspace Rail */
.workspace-side-rail {
  display: none;
}

@media (min-width: 640px) {
  .workspace-side-rail {
    position: fixed;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 10px 6px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
}

.rail-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: all 0.2s ease;
}

.rail-dot:hover {
  background: rgba(255, 255, 255, 0.7);
}

.rail-dot.active {
  height: 20px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

/* Horizontal Pagination Dots */
.pagination-dots {
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-shrink: 0;
}

.page-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: all 0.18s ease;
}

.page-dot:hover {
  background: rgba(255, 255, 255, 0.65);
}

.page-dot.active {
  background: #ffffff;
  transform: scale(1.15);
}

/* Workspace Vertical Slide Animations */
@keyframes workspaceSlideUp {
  from {
    opacity: 0;
    transform: translateY(34px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes workspaceSlideDown {
  from {
    opacity: 0;
    transform: translateY(-34px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.workspace-anim-up {
  animation: workspaceSlideUp 0.24s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.workspace-anim-down {
  animation: workspaceSlideDown 0.24s cubic-bezier(0.2, 0.9, 0.3, 1);
}