.container {
  overflow-x: auto;
}

.main-card {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 6.1rem);
  border-radius: 0.75rem;
  overflow: hidden;
  background: var(--card-background);
  min-width: 100rem;
  border: 1px solid var(--p-content-border-color);

  > * + * {
    margin: 0.25rem;
  }
}

.header {
  padding: 1.5rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--p-content-border-color);
  margin-bottom: 1.5rem;

  @media (min-width: 768px) {
    padding: 1.5rem 1.5rem 1rem;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.header-content {
  h2 {
    font-size: 1.25rem;
    font-weight: 600;
    padding-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  p {
    font-size: 0.875rem;
    color: rgb(156, 163, 175);

    strong {
      color: var(--primary-color);
    }
  }
}

.header-actions {
  margin-top: 1rem;

  @media (min-width: 768px) {
    margin-top: 0;
  }
}

.external-link-icon {
  color: rgb(2, 132, 199);
  cursor: pointer;
  font-size: 0.9rem;
}

.loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  border-radius: 0.75rem;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;

  > * + * {
    margin-top: 0.75rem;
  }

  span {
    color: rgb(209, 213, 219);
  }

  p-progressSpinner {
    width: 2rem;
    height: 2rem;
  }
}

.controls-section {
  padding: 0 1.5rem 0.5rem;
}

.saving-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 50;
  border-radius: 0.75rem;

  > * + * {
    margin-top: 0.75rem;
  }

  p-progressSpinner {
    width: 2rem;
    height: 2rem;
  }
}

.saving-message {
  background: rgba(17, 24, 39, 0.9);
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;

  span {
    font-size: 0.875rem;
    color: rgb(229, 231, 235);
    text-align: center;
  }
}

.controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0 0.25rem;
}

.default-controls {
  display: flex;
  gap: 1rem;
  align-items: center;

  span {
    font-size: 0.875rem;
    color: rgb(209, 213, 219);
    font-weight: 500;
  }

  p-select {
    min-width: 8rem;
    max-width: 16rem;
  }
}

.action-buttons {
  display: flex;
  gap: 1rem;
}

.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1rem 1rem;

  > * + * {
    margin-top: 0.5rem;
  }

  @media (min-width: 768px) {
    padding: 1rem 1.5rem 1rem;
  }
}

.empty-state {
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgb(156, 163, 175);
  font-style: italic;
  padding: 2rem 0;
}

.file-item {
  display: flex;
  flex-direction: column;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0.75rem 0.75rem 0 0;
  padding: 0.5rem 1rem;
}

.status-indicator {
  font-size: 0.75rem;
}

.cover-image {
  width: 1.5rem;
  height: 2rem;
  border-radius: 0.125rem;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.2s;

  &:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  }
}

.file-name {
  flex: 1;
  font-weight: 500;
  font-size: 0.875rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metadata-status {
  &.copied {
    color: rgb(34, 197, 94);
  }

  &.no-metadata {
    color: rgb(59, 130, 246);
  }

  &.not-applied {
    color: rgb(239, 68, 68);
  }
}

.library-select,
.path-select {
  min-width: 8rem;
  max-width: 16rem;
}

.details-section {
  padding: 2rem 3rem;
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  border-top: none;
  border-radius: 0 0 0.625rem 0.625rem;
}

.footer {
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-left,
.footer-right {
  display: flex;
  gap: 1rem;
  align-items: center;
  min-width: 10rem;
}

.footer-left {
  justify-content: flex-start;
}

.footer-right {
  min-width: 12.5rem;
  justify-content: flex-end;
}

.footer-center {
  flex-grow: 1;
  display: flex;
  justify-content: center;
}

.spacer {
  min-width: 10rem;
}
